summaryrefslogtreecommitdiff
path: root/faraday_and_psr/builder_tasks.m
blob: 3d8105717f79267b4cc67d64f7e3d0d7771fc4b6 (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
31
32
33
34
35
36
37
38
#!/usr/bin/octave -qf

task_dir='tasks/';
task_base_name='task_';
task_ext='.mat';
data_dir='results/';
output_dir='results/';
detuning_freq=0;


% assign some defaults
gmg=.7; % gyro magnetic ration for ground level

%[psr_rad]=psr_vs_detuning(Ep, psi_el, B_field, theta, phi) 

% phi is angle between linear polarization and axis x
phi=0;
% theta is angle between lab z axis (light propagation direction) and magnetic field axis (z')
theta=0;
% psi_el is the ellipticity parameter (phase difference between left and right polarization)
psi_el=0*3/180*pi;

Ep=sqrt(100);

% we are going to sweep B so parts related to sweep paramer(s)
zeeman_splitting=+0.5;
Nsteps=101;
B_fields=linspace(-zeeman_splitting/gmg, zeeman_splitting/gmg, Nsteps);

for i=1:Nsteps
	filename_task=strcat(task_dir, task_base_name);
	i_str=num2str(i, "%04d");
	filename_task=strcat(filename_task,i_str, task_ext);
	B_field = B_fields(i);
	save(filename_task, 'detuning_freq', 'Ep', 'psi_el', 'B_field', 'theta', 'phi');
endfor

disp("Tasks creation done");