[go: up one dir, main page]

Menu

[73c35b]: / anal / chk_par1.m  Maximize  Restore  History

Download this file

296 lines (285 with data), 8.3 kB

  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
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
% chk_par1: Interface betwen the user supplied and internal control parameters
% GUISDAP v.1.81 03-02-27 Copyright EISCAT, Huuskonen&Lehtinen
%
% chk_par1 is the main interface between the user supplied control parameters and
% the internal GUISDAP control parameters. There is mostly a one-to-one correspondence
% between the parameters e.g.
% User parameter GUISDAP parameter
% analysis_altit a_altit
% analysis_integr a_integr
% display_figures di_figures
% integ_deffile a_integdeffile
% The user parameters are local to the workspace whereas the GUISDAP parameters are global
% If any of the user parameters is not specified, or empty, the corresponding GUISDAP
% parameter will get the values specified in the routine.
%
% See also: an_start globals chk_par2
% make sure that the various path names have directory separators at the end
data_path=fullfile(deblank(strjust(data_path,'left')),filesep);
result_path=fullfile(deblank(strjust(result_path,'left')),filesep);
path_GUP=fullfile(path_GUP,filesep);
path_exps=fullfile(path_exps,filesep);
path_tmp=fullfile(path_tmp,filesep);
if exist('analysis_plasmaline','var') & analysis_plasmaline
display_figures(2:5)=[];
analysis_do=0;
d_saveint.var=0;
d_saveint.dir=result_path;
if exist('plasma_range','var'), d_saveint.range=plasma_range; end
end
if ~isempty(d_saveint)
d=strfind(d_saveint.dir,'AUTO');
if length(d)==1
d_saveint.dir=[d_saveint.dir(1:d-1) sprintf('%s_%s%d_%d@%s',datestr(analysis_start,29),name_expr,expver,analysis_integr(1),name_site)];
if isfield(d_saveint,'range')
d_saveint.dir=[d_saveint.dir 'p'];
end
end
d_saveint.dir=fullfile(d_saveint.dir,filesep);
if ~exist(d_saveint.dir,'dir')
[i,j]=fileparts(d_saveint.dir(1:end-1));
if isempty(i), mkdir(j), else, mkdir(i,j), end
end
if ~isfield(d_saveint,'var')
d_saveint.var=1;
end
end
% The first if-block tries to locate the data source and produces variables
% necessary for integration:
a_simul=[];
if exist('analysis_simul','var')
% The second branch is for simulated data to be calculated from the theory
% The presence of the variable a_simul is the flag, which is used later
% a_simul(1): integration time
% a_simul(2): controls the start time in steps of 7200 s, i.e. 2 hours.
% a_simul(3): The transmitter power
% a_simul(4): The background temperature
% a_simul(5:7): Antenna range, azimuth and elevation
% a_simul(8): The calibration temperature
a_simul=[0 1 1.2e6 100 300 180 90 210];
a_simul(1:length(analysis_simul))=analysis_simul;
a_year=2000;
a_start=7200*a_simul(2);
a_end=7200*a_simul(2)+a_simul(1);
analysis_control(4)=2;
else
if exist('analysis_integr','var')
a_integr=analysis_integr;
else
a_skip=zeros(size(a_integr));
end
if exist('analysis_realtime','var')
a_realtime=analysis_realtime;
else
a_realtime=0;
end
if exist('analysis_txlimit','var')
a_txlimit=analysis_txlimit;
else
a_txlimit=100e3;
end
if exist('analysis_skip','var')
a_skip=analysis_skip;
else
a_skip=zeros(size(a_integr));
end
if ~exist('recurse','var'), recurse=[]; end
a_rawdata=0;
if exist('analysis_rawdata','var')
a_rawdata=analysis_rawdata;
end
if a_rawdata==1 & exist('PI_init')==3, % NW's package is to be used
NW2
elseif a_rawdata==2, % HDF5 format
d_filelist=h5read(data_path,'/Time/MatlabTime');
i=datevec(d_filelist(1));
d_filelist=(d_filelist-datenum(i(1),1,1))*86400;
a_start=tosecs(analysis_start); % the programs uses internally only seconds,
a_end =tosecs(analysis_end); % counted from the beginning of year
a_year=analysis_start(1);
a_ind=0;
elseif name_site=='Q'
% The data are binary Quijing files
global a_timestamp qmeta
a_timestamp=[3.9 6.2];
if exist('analysis_timestamp','var')
a_timestamp(1:length(analysis_timestamp))=analysis_timestamp;
end
load(fullfile(path_GUP,'matfiles','q_metadata'))
[d_filelist,msg]=qetfilelist(data_path);
if ~isempty(msg)
error(msg)
end
a_start=86400*datenum(analysis_start);
a_end =86400*datenum(analysis_end);
a_year=analysis_start(1);
a_ind=0;
else
% The normal case where it is expeced the data are matlab files
if ~a_realtime
recurse(strfind(recurse,'?'))='*';
end
i=strfind(recurse,'**');
for i=fliplr(i)
recurse(i+1)=[];
end
if isempty(dir([data_path '*.mat*']))
data_path=fullfile(data_path,recurse,filesep);
end
[d_filelist,msg]=getfilelist(data_path);
if ~isempty(msg)
error(msg)
end
a_start=tosecs(analysis_start); % the programs uses internally only seconds,
a_end =tosecs(analysis_end); % counted from the beginning of year
a_year=analysis_start(1);
a_ind=0;
end
end
a_control=[-1 0.01 100 1];
% a_control(1) No fit is tried, if the error of Ne is larger than (1) at the start
% a_control(2) Fitting is stopped when step for all parameters is less than (2)
% a_control(3) Maximum number of iterations
% a_control(4) Variance calculation
% = 1 when variance estimated from data
% = 2 when variance estimated using ambiguity functions
if exist('analysis_control','var')
ind=find(analysis_control>0);
a_control(ind)=analysis_control(ind);
end
a_Magic_const=1;
if exist('Magic_const','var')
a_Magic_const=Magic_const;
end
a_NCAR=2;
if a_realtime & isunix & ~isempty(local.site)
a_NCAR=3;
end
if exist('NCAR','var')
NCAR_output
a_NCAR=NCAR;
end
a_HDF=0;
if exist('analysis_HDF','var')
a_HDF=analysis_HDF;
end
if exist('analysis_code','var')
a_code=analysis_code;
end
di_figures=[0 0 0 0 0]; di_results=0; di_spectra=0;
if name_site=='S' | name_site=='K', di_results=1; end
if exist('display_figures','var')
di_figures(1:length(display_figures))=display_figures;
end
if exist('display_results','var')
di_results=display_results;
end
if exist('display_spectra','var')
di_spectra=display_spectra;
end
a_save=1;
if exist('analysis_save','var')
a_save=analysis_save;
if ~a_save
a_NCAR=0; di_figures(5)=0; result_path=path_tmp;
end
end
a_savespec=0;
if exist('analysis_savespec','var')
a_savespec=analysis_savespec;
end
a_do=1;
if exist('analysis_do','var')
a_do=analysis_do;
end
a_intfixed=1;
if exist('analysis_intfixed','var')
a_intfixed=analysis_intfixed;
end
a_intallow=[.2 .2 1000 0];
if exist('analysis_intallow','var')
a_intallow(1:length(analysis_intallow))=analysis_intallow;
end
a_intfix=[9 10 42 64];
if exist('analysis_intfix','var')
d=find(analysis_intfix);
a_intfix(d)=analysis_intfix(d);
a_intallow(length(a_intallow)+1:length(a_intfix))=0;
end
if exist('analysis_intfixforce','var')
a_intfixforce=analysis_intfixforce;
end
if exist('analysis_sweep','var')
if strfind(analysis_sweep,'az')
a_intallow(2)=Inf;
elseif ~strfind(analysis_sweep,'el')
warning('GUISDAP:parse','analysis_sweep has to contain ''el'' and/or ''az'' strings')
end
if strfind(analysis_sweep,'el')
a_intallow(1)=Inf;
end
end
if exist('analysis_txpower','var')
a_txpower=analysis_txpower;
elseif name_site=='V' & a_year>2006
a_txpower=[70 1000];
warning('GUISDAP:chkpar','Using measured tx power, override with analysis_txpower=8;')
elseif name_site~='V' & a_year>2004
a_txpower=[65 1000];
warning('GUISDAP:chkpar','Using measured tx power, override with analysis_txpower=8;')
else
a_txpower=[8 1];
end
if length(a_txpower)==1
if a_txpower(1)==8, a_txpower(2)=1; else, a_txpower(2)=1e3; end
end
sysTemp=[];
if exist('analysis_Tsys','var')
sysTemp=analysis_Tsys;
end
a_rcprog=1;
if exist('analysis_rcprog','var')
a_rcprog=analysis_rcprog;
end
a_ppshortlags=0;
if exist('analysis_ppshortlags','var')
a_ppshortlags=analysis_ppshortlags;
end
if length(a_ppshortlags)==1
a_ppshortlags(2)=Inf;
end
a_gating=0;
if exist('analysis_gating','var')
a_gating=analysis_gating;
end
a_pponly=0;
if exist('analysis_pponly','var')
a_pponly=analysis_pponly;
end
a_ppcombine=0;
if exist('analysis_ppcombine','var')
a_ppcombine=analysis_ppcombine;
end
a_lagprofiling.do=0;
if exist('analysis_lagprofiling','var')
a_lagprofiling=analysis_lagprofiling;
end
if a_lagprofiling.do
chk_lagprofiling()
end
if exist('display_analysis_pars','var')
empty_pars=[];
for i=who('a_*','d_s*','path_*')'
j=char(i);
if isempty(eval(j))
empty_pars=[empty_pars ' ' j];
else
eval(j)
end
end
if ~isempty(empty_pars)
fprintf('Empty parameters:%s\n',empty_pars)
end
fprintf('<Press return>')
pause
end