64 lines
1.9 KiB
Matlab
64 lines
1.9 KiB
Matlab
|
|
base = "C:\Users\Silas\Nextcloud\Cluster";
|
|
all_files = dir(fullfile(base, "**/*.mat"));
|
|
|
|
schemes = ["co","pair","alt","seg"];
|
|
|
|
% Preallocate as table (minimal + convenient)
|
|
T = table('Size',[0 10], ...
|
|
'VariableTypes', ["string","string","string","datetime","double","double","double","double","double","double"], ...
|
|
'VariableNames', ["folder","file","scheme","date","node","jobid","L_km","Nch","df_GHz","alpha"]);
|
|
|
|
% filename parser
|
|
rx = "^WDM_(?<date>\d{8})_(?<time>\d{6})_n(?<node>\d+)_(?<jobid>\d+)_" + ...
|
|
"(?<L>\d+)km_(?<Nch>\d+)ch_(?<df>\d+)ghz_(?<scheme>[a-z]+)_alpha(?<alpha>\d+(?:_\d+)?)\.mat$";
|
|
|
|
for k = 1:numel(all_files)
|
|
f = all_files(k);
|
|
folder = string(f.folder);
|
|
file = string(f.name);
|
|
|
|
tok = regexp(file, rx, 'names');
|
|
if isempty(tok)
|
|
continue
|
|
end
|
|
|
|
% scheme from filename is the most reliable
|
|
scheme = string(tok.scheme);
|
|
|
|
% optional: ignore unexpected schemes
|
|
if ~any(strcmpi(scheme, schemes)), continue; end
|
|
|
|
node = str2double(tok.node);
|
|
jobid = str2double(tok.jobid);
|
|
L_km = str2double(tok.L);
|
|
Nch = str2double(tok.Nch);
|
|
df_GHz = str2double(tok.df);
|
|
date = datetime(strcat(tok.date, tok.time), 'InputFormat','yyyyMMddHHmmss');
|
|
|
|
|
|
% alpha uses "_" as decimal separator in your filenames
|
|
alpha = str2double(strrep(tok.alpha, "_", "."));
|
|
|
|
T(end+1,:) = {folder, file, scheme,date, node, jobid, L_km, Nch, df_GHz, alpha};
|
|
end
|
|
|
|
%%
|
|
idx = strcmp(T.scheme,"co") & ...
|
|
T.alpha == 0.4 & ...
|
|
T.date >= datetime(2026,1,9) & ...
|
|
T.date <= datetime(2026,1,10,23,59,59);
|
|
|
|
T_sel = T(idx,:);
|
|
|
|
i = 2;
|
|
res = load(fullfile(T_sel.folder(i),T_sel.file(i)),'res');
|
|
res = res.res;
|
|
|
|
%%
|
|
% Routine A: plot BER curves and compute crossings
|
|
S = plot_BER_vs_ROP(res, 'fec', 3.8e-3);
|
|
|
|
%% Routine B: violin plot (independent)
|
|
plot_FEC_violin(res, 'tech','VNLE', 'fec',3.8e-3, 'ylim',[-10 0]);
|