summaryrefslogtreecommitdiff
path: root/loadSimulations.m
blob: 306fe7eff9b3585590ec16c3893429dd250a065d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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 = [directory, dataFiles(i).name];
		data = load(dataFile);
		detunings = data(:,1);
		absorptions = data(:,2);
		[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, contrasts];
	data = sortrows(data, 1);
	drives = data(:,1); widths = data(:,2); minAbsorptions = data(:,3); contrasts = data(:,4:5);
	loglog(drives, widths);
	hold all
	loglog(drives, minAbsorptions.*10^5);
end