diff options
author | Hunter Rew <hbrew@email.wm.edu> | 2014-04-23 22:44:37 -0400 |
---|---|---|
committer | Hunter Rew <hbrew@email.wm.edu> | 2014-04-23 22:44:37 -0400 |
commit | ee48a590f2b518adc4d478f4c68c95fdfede8385 (patch) | |
tree | 68cbb275247c952d9b14cd9447ba2637aad40041 /loadSimulations.m | |
parent | addbb92ff06b21d2188eeefdb17692beb85e4b1c (diff) | |
download | eit_filter_simulations-ee48a590f2b518adc4d478f4c68c95fdfede8385.tar.gz eit_filter_simulations-ee48a590f2b518adc4d478f4c68c95fdfede8385.zip |
Diffstat (limited to 'loadSimulations.m')
-rw-r--r-- | loadSimulations.m | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/loadSimulations.m b/loadSimulations.m index 046e336..306fe7e 100644 --- a/loadSimulations.m +++ b/loadSimulations.m @@ -1,27 +1,30 @@ -function [data] = loadSimulations(decay_bc, dephase_bc) - dataFiles = dir(['data/', decay_bc, '*_*_*_', dephase_bc, '*.dat']); +function [data] = loadSimulations(directory, decay_bc, detuning, dephase_bc) + dataFiles = dir([directory, decay_bc, '*_*_', detuning, '*_', dephase_bc, '*.dat']); widths = []; minAbsorptions = []; + contrasts = []; drives = []; deltas = []; for i = 1:length(dataFiles) - dataFile = ['data/', dataFiles(i).name]; + dataFile = [directory, dataFiles(i).name]; data = load(dataFile); detunings = data(:,1); absorptions = data(:,2); - [width, absorption] = getPeak(detunings, absorptions); + [width, absorption, contrast_left, contrast_right] = getPeak(detunings, absorptions); + contrast = [contrast_left, contrast_right]; widths = [widths; width]; minAbsorptions = [minAbsorptions; absorption]; + contrasts = [contrasts; contrast]; sections = strfind(dataFile, '_'); drive = dataFile(sections(1)+1:sections(2)-1); drives = [drives; str2num(drive)]; delta = dataFile(sections(2)+1:sections(3)-1); deltas = [deltas; str2num(delta)]; end - data = [drives, widths, minAbsorptions]; + data = [drives, widths, minAbsorptions, contrasts]; data = sortrows(data, 1); - drives = data(:,1); widths = data(:,2); minAbsorptions = data(:,3); - loglog(drives.^2, widths); + drives = data(:,1); widths = data(:,2); minAbsorptions = data(:,3); contrasts = data(:,4:5); + loglog(drives, widths); hold all - loglog(drives.^2, minAbsorptions*10^5); + loglog(drives, minAbsorptions.*10^5); end
\ No newline at end of file |