2
* Copyright (c) 1999-2009 Delft University of Technology, The Netherlands
4
* This file is part of Doris, the Delft o-o radar interferometric software.
6
* Doris program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* Doris is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22
/****************************************************************
23
* $Source: /users/kampes/DEVELOP/DORIS/doris/src/RCS/readinput.cc,v $
25
* $Date: 2009/01/09 11:09:20 $
28
* implementation of readinput.
29
****************************************************************/
31
#include "matrixbk.hh"
32
#include "constants.hh" // global constants
33
#include "ioroutines.hh" // ?
34
#include "utilities.hh" // ispower2
35
#include "exceptions.hh" // my exceptions class
37
#include <fstream> // for file streams
38
#include <strstream> // for file streams
39
#include <iomanip> // for setprecision etc.
40
#include <cstring> // for strcmp etc.
41
#include <cstdlib> // exit, atoi
42
#include <cctype> // isspace
46
// ______ displevel used in ioroutines.h, changed here ______
47
char WARNS[6][ONE27]; // remember 6 last warnings in WARNS
48
int32 beeplevel=1; // global variable for beeping.
49
// 0: nobeep; BEEP OFF
50
// -1: beep on error exit ; BEEP ERROR
51
// 1: beep on error, warnings; BEEP WARNING
52
// 2: beep on error, warnings, progress;
53
// BEEP PROGRESS, BEEP [ON]
54
int32 displevel=30000; // controls level of screen output
56
// 0: warnings and errors
57
// 10000: progress, warn and err
58
// 20000: info, pro, warn and err
59
// 30000: debug, info, pro, warn, err
62
// ______ Checks input prototypes (see below in this file) ______
63
void checkgeneral (input_gen &generalinput, const int16 onlyprocess);
64
void checkreadfiles (const input_readfiles &readfilesinput, const int16 id);
65
void checkcrop (const input_crop &cropinput, const int16 id);
66
//____RaffaeleNutricato START MODIFICATION SECTION 1
67
void checkoversample (const input_oversample &oversampleinput, const int16 id);
68
//____RaffaeleNutricato END MODIFICATION SECTION 1
69
void checkporbits (const input_pr_orbits &porbitsinput, const int16 id);
70
void checksimamp (const input_simamp &simampinput); //[MA] ?nec. id check?
71
void checkmtiming (const input_mtiming &mtiminginput); //[MA] ?nec. id check?
72
void checkslant2h (const input_slant2h &slant2hinput);
73
void checkunwrap (const input_unwrap &unwrapinput);
74
void checkgeocode (const input_geocode &geocodeinput);
75
void checkcoarsecorr (const input_coarsecorr &coarsecorrinput);
76
void checkfine (const input_fine &fineinput);
77
void checkreltiming (const input_reltiming &reltiminginput); //[FvL]
78
void checkdemassist (const input_demassist &demassistinput); //[FvL]
79
void checkcoregpm (const input_coregpm &coregpminput);
80
void checkcomprefpha (const input_comprefpha &comprefphainput);
81
void checksubtrrefpha (const input_subtrrefpha &subtrrefphainput);
82
void checkresample (const input_resample &resampleinput);
83
void checkinterfero (const input_interfero &interferoinput);
84
void checkcoherence (const input_coherence &coherenceinput);
85
void checkcomprefdem (const input_comprefdem &comprefdeminput);
86
void checksubtrrefdem (const input_subtrrefdem &subtrrefdeminput);
87
void checkfiltrange (const input_filtrange &filtrangeinput);
88
void checkdinsar (const input_dinsar &dinsarinput);
89
void checkfiltphase (const input_filtphase &filtphaseinput);
90
void checkfiltazi (const input_filtazi &filtaziinput, const int16 id);
92
/****************************************************************
94
* echo arg to screen if debug defined *
96
****************************************************************/
98
void writearg(const Type argument)
100
TRACE_FUNCTION("writearg");
101
DEBUG << "Read argument: " << argument;
107
/****************************************************************
110
* Read and interpret *
111
* "inputoptionsfile" (file in variable: logfile). *
112
* Write to logfile (via "scratchreadinput") *
113
* mandatory input is checked on presence by checksums (cs). *
114
* If there are more methods, process card switches default *
115
* methodselector (if present) is used later to correct *
116
* see for example unwrap methodeselector *
117
* linecounter only used in case of errors *
120
* - struct: general input options *
121
* - struct: master readfiles input options *
122
* - struct: slave readfiles input options *
123
* - struct: master crop input options *
124
* - struct: slave crop input options *
127
* - (updated input structs) *
128
* - (file copy of input) *
130
* Bert Kampes, 11-Dec-1998 *
131
* Mahmut Arikan, 09-Jan-2009 (code to fix linecnt bug *
132
* G.J. van Zwieten, 09-Jan-2009 and line extend ) *
133
* Mahmut Arikan, 29-Aug-2010 Fix: Read only those prms *
135
****************************************************************/
137
input_gen &generalinput,
138
input_ell &ellipsinput,
139
input_pr_orbits &porbitsinput,
140
input_readfiles &m_readfilesinput,
141
input_morbits &morbitsinputmaster, // [HB]
142
input_crop &m_cropinput,
143
//____RaffaeleNutricato START MODIFICATION SECTION 2
144
input_oversample &m_oversample,
145
input_simamp &simampinput, // master simamp [FvL],[MA]
146
input_mtiming &mtiminginput, // mtiming correl [MA]
147
//____RaffaeleNutricato END MODIFICATION SECTION 2
148
input_readfiles &s_readfilesinput,
149
input_morbits &morbitsinputslave, // [HB]
150
input_crop &s_cropinput,
151
//____RaffaeleNutricato START MODIFICATION SECTION 3
152
input_oversample &s_oversample,
153
//____RaffaeleNutricato END MODIFICATION SECTION 3
154
input_filtazi &filtaziinput,
155
input_coarsecorr &coarsecorrinput,
156
input_fine &fineinput,
157
input_reltiming &reltiminginput, //[FvL]
158
input_demassist &demassistinput, //[FvL]
159
input_coregpm &coregpminput,
160
input_resample &resampleinput,
161
input_filtrange &filtrangeinput,
162
input_interfero &interferoinput,
163
input_coherence &coherenceinput,
164
input_comprefpha &comprefphainput,
165
input_subtrrefpha &subtrrefphainput,
166
input_comprefdem &comprefdeminput,
167
input_subtrrefdem &subtrrefdeminput,
168
input_filtphase &filtphaseinput,
169
input_dinsar &dinsarinput,
170
input_unwrap &unwrapinput,
171
input_estorbits &estorbitsinput, // [HB]
172
input_slant2h &slant2hinput,
173
input_geocode &geocodeinput)
175
//TRACE_FUNCTION("readinput (BK 11-Dec-1998)");
176
TRACE_FUNCTION("readinput rev.5 (TUDelft 29-Aug-2010)");
178
// ______ Set ids ______
179
m_readfilesinput.fileid = MASTERID;
180
m_cropinput.fileid = MASTERID;
181
s_readfilesinput.fileid = SLAVEID;
182
s_cropinput.fileid = SLAVEID;
184
// ______ Misuse generalinput.logfile to store name: open file here! ______
185
//ifstream optionsfile(generalinput.logfile, ios::in | ios::nocreate);
186
ifstream optionsfile(generalinput.logfile, ios::in);
187
bk_assert(optionsfile,generalinput.logfile,__FILE__,__LINE__);
188
string inputoptionsfile = generalinput.logfile; // [MA] keep input filename
189
// later variable is updated
192
int16 onlyprocess = -1; // flag for ONLYPROCESS card
193
int16 linecnt = 0; // counter
194
const int16 BASE10 = 10; // [MA] base 10 defined for strtol
195
//char keyword[EIGHTY];
196
//char filename[4*ONE27]; // string for filenames // [MA] changed EIGHTY --> 2*ONE27, due to comments line gets longer
197
char eachline[4*ONE27]; // assuming maximum char lenght of the line is 4*ONE27. It should be sufficient.
199
// ______ Check (multiple) occurence of cards ______
200
bool priorscreen = false; // no screen card present
201
bool priormemory = false; // check if present for info
202
bool priorbatch = false; // check if present for info
203
bool prioroverwrite = false; // check if present for info
204
bool priorlistinput = false; // check if present for info
205
bool priorrs_fileout = false; //
208
// ====== Initialization, defaults ======
210
bool listinput = true; // default copy input to log
211
bool ellipsoid = false; // set default if no card present
212
ellipsinput = WGS84; // default
215
for (i=0; i<NUMPROCESSES; i++)
216
generalinput.process[i] = 0; // default no processing step
217
generalinput.interactive = true; // default interactive mode
218
generalinput.overwrit = false; // default no overwriting
219
generalinput.memory = real8(MEMORY_DEF); // default memory (500MB), see constants.hh
220
strcpy(generalinput.logfile, "log.out"); // default logfile
221
strcpy(generalinput.m_resfile, "master_result.out"); // default resultfile
222
strcpy(generalinput.s_resfile, "slave_result.out"); // default resultfile
223
strcpy(generalinput.i_resfile, "interferogram.out"); // default interf_out
224
generalinput.orb_interp = ORB_DEFAULT; // default polyfit
225
generalinput.dumpbaselineL = 0; // default no dump
226
generalinput.dumpbaselineP = 0; // default no dump
227
generalinput.preview = 0; // default no preview
228
generalinput.terrain_height = 0.0; // above ellipsoid
229
generalinput.tiepoint.x = 0.0; // default none
230
generalinput.tiepoint.y = 0.0; // default none
231
generalinput.tiepoint.z = 0.0; // default none
233
//m_readfilesinput.method = readfiles_ers; // default
234
m_readfilesinput.sensor_id = SLC_ERS; // default
235
setunspecified(m_readfilesinput.volfile); // check later, then set default
236
setunspecified(m_readfilesinput.leaderfile); // check later, then set default
237
setunspecified(m_readfilesinput.nullfile); // check later, then set default
238
setunspecified(m_readfilesinput.datfile); // check later, then set default
239
m_readfilesinput.rg_timing_error = 0.0; // default
240
m_readfilesinput.az_timing_error = 0.0; // default
241
//s_readfilesinput.sensor_id = readfiles_ers; // default
242
s_readfilesinput.sensor_id = SLC_ERS; // default
243
setunspecified(s_readfilesinput.volfile); // check later, then set default
244
setunspecified(s_readfilesinput.leaderfile); // check later, then set default
245
setunspecified(s_readfilesinput.nullfile); // check later, then set default
246
setunspecified(s_readfilesinput.datfile); // check later, then set default
247
s_readfilesinput.rg_timing_error = 0.0; // default
248
s_readfilesinput.az_timing_error = 0.0; // default
250
setunspecified(porbitsinput.m_orbdir); // check later, then set default
251
setunspecified(porbitsinput.s_orbdir); // check later, then set default
252
porbitsinput.timeinterval = 1; // default time interval
253
porbitsinput.timebefore = 4*porbitsinput.timeinterval; // default 4 extra datapoints
254
porbitsinput.dumpmasterorbit = -1.; // default no dump
255
porbitsinput.dumpslaveorbit = -1.; // default no dump
257
strcpy(m_cropinput.idcrop,"master step01"); // default identifier
258
strcpy(s_cropinput.idcrop,"slave step01"); // default identifier
259
strcpy(m_cropinput.fileout1,"master.raw"); // default output filename
260
strcpy(s_cropinput.fileout1,"slave.raw"); // default output filename
261
m_cropinput.dbow.linelo = 0; // min. line coord. initialization
262
m_cropinput.dbow.linehi = 0; // max. line coord. initialization
263
m_cropinput.dbow.pixlo = 0; // min. pixel coord. initialization
264
m_cropinput.dbow.pixhi = 0; // max. pixel coord. initialization
265
s_cropinput.dbow.linelo = 0; // min. line coord. initialization
266
s_cropinput.dbow.linehi = 0; // max. line coord. initialization
267
s_cropinput.dbow.pixlo = 0; // min. pixel coord. initialization
268
s_cropinput.dbow.pixhi = 0; // max. pixel coord. initialization
269
m_cropinput.dbow_geo.linelo = 0; // min. line coord. initialization
270
m_cropinput.dbow_geo.linehi = 0; // max. line coord. initialization
271
m_cropinput.dbow_geo.pixlo = 0; // min. pixel coord. initialization
272
m_cropinput.dbow_geo.pixhi = 0; // max. pixel coord. initialization
273
s_cropinput.dbow_geo.linelo = 0; // min. line coord. initialization
274
s_cropinput.dbow_geo.linehi = 0; // max. line coord. initialization
275
s_cropinput.dbow_geo.pixlo = 0; // min. pixel coord. initialization
276
s_cropinput.dbow_geo.pixhi = 0; // max. pixel coord. initialization
278
//____RaffaeleNutricato START MODIFICATION SECTION 4
279
m_oversample.OsrRange = 1; // Default for oversampling ratio in range.
280
m_oversample.OsrAzimuth = 1; // Default for oversampling ratio in azimuth.
281
m_oversample.FilterSize = 16; // Default for length of the interpolation kernel in range.
282
m_oversample.oformatflag = FORMATCI2; // Default for output format.
283
strcpy(m_oversample.fileoutovs,"master_ovs.raw"); // Default output filename.
284
s_oversample.OsrRange = 1; // Default for oversampling ratio in range.
285
s_oversample.OsrAzimuth = 1; // Default for oversampling ratio in azimuth.
286
s_oversample.FilterSize = 16; // Default for length of the interpolation kernel in range.
287
s_oversample.oformatflag = FORMATCI2; // Default for output format.
288
strcpy(s_oversample.fileoutovs,"slave_ovs.raw"); // Default output filename.
289
//____RaffaeleNutricato END MODIFICATION SECTION 4
291
//____ added by MA ____
293
setunspecified(simampinput.firefdem); // check later, mandatory
294
//setunspecified(simampinput.fodemi); // check later, then set default
295
setunspecified(simampinput.fodemlp); // check later, then set default // MA SPT
296
setunspecified(simampinput.fothetalp); // check later, then set default // MA SPT
297
strcpy(simampinput.fodem,"demcrop_sam.raw"); // default name
298
setunspecified(simampinput.fosimamp); // check later, then set default
299
simampinput.iformatflag = FORMATI2; // default gtopo30
300
simampinput.demrows = 6000; // default gtopo30
301
simampinput.demcols = 4800; // default gtopo30
302
simampinput.demnodata = -9999; // default gtopo30
303
simampinput.demdeltalat = deg2rad(0.00833333333333333333); // default gtopo30
304
simampinput.demdeltalon = deg2rad(0.00833333333333333333); // default gtopo30
305
simampinput.demlatleftupper = deg2rad(89.995833333333333333); // w020n90.DEM
306
simampinput.demlonleftupper = deg2rad(-19.995833333333333333); // w020n90.DEM
307
strcpy(simampinput.fosimamp,"master.sam"); // default name
310
const int32 def_mte_nwin = 16; // default #windows
311
setunspecified(mtiminginput.ifpositions); // check later, then set default
312
mtiminginput.MasksizeL = 256; // default correlation size
313
//mtiminginput.MasksizeP = mtiminginput.MasksizeL; // default correlation size
314
mtiminginput.MasksizeP = 128; // default correlation size
315
mtiminginput.AccL = 32; // default searching limit
316
mtiminginput.AccP = mtiminginput.AccL; // default searching limit
317
mtiminginput.initoffsetL = 0; // default initial offset
318
mtiminginput.initoffsetP = 0; // default initial offset
320
// ____ end added by MA ____
322
// ____ start added by HB ____
323
morbitsinputmaster.coeff = matrix<real8>(10,2); //
324
morbitsinputmaster.coeff = 0; // default: no modification
325
setunspecified(morbitsinputmaster.reforbitfile); //
326
morbitsinputslave.coeff = matrix<real8>(10,2); //
327
morbitsinputslave.coeff = 0; // default: no modification
328
setunspecified(morbitsinputslave.reforbitfile); //
329
// ____ end added by HB ____
331
filtaziinput.oformatflag = FORMATCR4; // default
332
filtaziinput.fftlength = 1024; // default
333
filtaziinput.overlap = -1; // default to fftlength/8
334
filtaziinput.hammingalpha = 0.75; // default (slc)
335
strcpy(filtaziinput.fomaster,"master.afilter"); // default
336
strcpy(filtaziinput.foslave,"slave.afilter"); // default
338
const int32 def_cc_nwin = 11; // default #windows
339
setunspecified(coarsecorrinput.ifpositions); // check later, then set default
340
coarsecorrinput.MasksizeL = 64; // default correlation size
341
coarsecorrinput.MasksizeP = coarsecorrinput.MasksizeL;// default correlation size
342
coarsecorrinput.AccL = 8; // default searching limit
343
coarsecorrinput.AccP = coarsecorrinput.AccL; // default searching limit
344
coarsecorrinput.initoffsetL = 0; // default initial offset
345
coarsecorrinput.initoffsetP = 0; // default initial offset
347
setunspecified(fineinput.ifpositions); // check later, then set default
348
const int32 def_fc_nwin = 601; // default #windows
349
fineinput.MasksizeL = 64; // default correlation size
350
fineinput.MasksizeP = fineinput.MasksizeL; // default correlation size
351
fineinput.AccL = 8; // default searching limit
352
fineinput.AccP = fineinput.AccL; // default searching limit
353
fineinput.initoffsetL = 0; // default initial offset
354
fineinput.initoffsetP = 0; // default initial offset
355
fineinput.osfactor = 32; // default oversampling factor
356
fineinput.plotoffsets = false; // default no plotting
357
fineinput.plotmagbg = false; // default no plotting
358
fineinput.plotthreshold = 0.3; // default no plotting
360
//____ added by FvL ____
361
reltiminginput.threshold = 0.4; // default threshold data
362
reltiminginput.maxiter = 10000; // default max. 10000 outliers removed
363
reltiminginput.k_alpha = 1.97; // critical value for outliers
365
setunspecified(demassistinput.firefdem); // check later, mandatory
366
setunspecified(demassistinput.fodemi); // check later, then set default
367
setunspecified(demassistinput.forefdemhei); // check later, then set default
368
strcpy(demassistinput.fodem,"demcrop.raw"); // default name
369
demassistinput.iformatflag = FORMATI2; // default gtopo30
370
demassistinput.demrows = 6000; // default gtopo30
371
demassistinput.demcols = 4800; // default gtopo30
372
demassistinput.demnodata = -9999; // default gtopo30
373
demassistinput.demdeltalat = deg2rad(0.00833333333333333333);// default gtopo30
374
demassistinput.demdeltalon = deg2rad(0.00833333333333333333);// default gtopo30
375
demassistinput.demlatleftupper = deg2rad(89.995833333333333333); // w020n90.DEM
376
demassistinput.demlonleftupper = deg2rad(-19.995833333333333333);// w020n90.DEM
377
// ____ end added by FvL ____
379
coregpminput.threshold = 0.2; // default threshold data
380
coregpminput.degree = 1; // default degree polynomial
381
coregpminput.weightflag = 0; // default no weighting of data
382
coregpminput.maxiter = 10000; // default max. 10000 outliers removed, changed by [FvL]
383
coregpminput.k_alpha = 1.97; // critical value for outliers
384
coregpminput.dumpmodel = false; // default no files
385
coregpminput.plot = false; // default no plots
386
coregpminput.plotmagbg = false; // default no plots
388
filtrangeinput.method = rf_adaptive; // default
389
filtrangeinput.terrainslope = 0.0; // default porbits
390
filtrangeinput.fftlength = -999; // set default later
391
filtrangeinput.overlap = 0; // default no overlap
392
filtrangeinput.nlmean = 15; // default
393
filtrangeinput.hammingalpha = 0.75; // default
394
filtrangeinput.SNRthreshold = 5.0; // default
395
filtrangeinput.oversample = 2; // default
396
filtrangeinput.doweightcorrel = false; // default
397
strcpy(filtrangeinput.fomaster,"master.rfilter"); // default
398
strcpy(filtrangeinput.foslave,"slave.rfilter"); // default
399
filtrangeinput.oformatflag = FORMATCR4; // default
401
setunspecified(comprefphainput.ifpositions); // check later, then set default
402
const int32 def_fe_Npoints = 501; // default
403
const int32 def_fe_degree = 5; // default
405
strcpy(resampleinput.fileout,"s_resampled.raw"); // default
406
resampleinput.oformatflag = FORMATCR4; // default
407
resampleinput.dbow.linelo = 0; // min. line coord. initialization
408
resampleinput.dbow.linehi = 0; // max. line coord. initialization
409
resampleinput.dbow.pixlo = 0; // min. pixel coord. initialization
410
resampleinput.dbow.pixhi = 0; // max. pixel coord. initialization
411
resampleinput.dbow_geo.linelo = 0; // min. line coord. initialization
412
resampleinput.dbow_geo.linehi = 0; // max. line coord. initialization
413
resampleinput.dbow_geo.pixlo = 0; // min. pixel coord. initialization
414
resampleinput.dbow_geo.pixhi = 0; // max. pixel coord. initialization
415
resampleinput.shiftazi = true; // default apply shift
417
interferoinput.method = int_oldmethod; // default method
418
setunspecified(interferoinput.focint); // check later, then set default
419
setunspecified(interferoinput.foint); // use later if specified
420
//setunspecified(interferoinput.foflatearth); // check later, then set default
421
interferoinput.multilookL = 5; // default multilookfactor
422
interferoinput.multilookP = 1; // default multilookfactor
424
coherenceinput.method = coh_oldmethod; // default method
425
setunspecified(coherenceinput.focoh); // check later, then set default
426
setunspecified(coherenceinput.foccoh); // check later, then set default
427
coherenceinput.multilookL = 10; // default multilookfactor
428
coherenceinput.multilookP = 2; // default multilookfactor
429
coherenceinput.cohsizeL = coherenceinput.multilookL; // default windowsize.
430
coherenceinput.cohsizeP = coherenceinput.multilookP; // default windowsize.
432
subtrrefphainput.method = srp_polynomial; // default method
433
strcpy(subtrrefphainput.forefpha, "refphase.raw"); // default name
434
strcpy(subtrrefphainput.focint,"cint.minrefpha.raw");// default
435
subtrrefphainput.multilookL = 1; // default multilookfactor
436
subtrrefphainput.multilookP = 1; // default multilookfactor
437
subtrrefphainput.dumponlyrefpha = false; // default not
439
setunspecified(subtrrefphainput.foh2ph); // check later, then set default
440
// ____ end added by FvL
442
filtphaseinput.method = fp_goldstein; // default method
443
filtphaseinput.alpha = 0.2; // default
444
// ______ 32 blocks default for goldstein, kernel as large as possible, ______
445
// ______ 2Dkernel then specify ______
446
filtphaseinput.blocksize = 32; // default
447
filtphaseinput.overlap = 3; // default
448
// set default later with alpha in name
449
setunspecified(filtphaseinput.fofiltphase); // check later, then set default
450
setunspecified(filtphaseinput.fifiltphase); // if specified, use it
451
setunspecified(filtphaseinput.fikernel2d); // if specified, use it
452
filtphaseinput.finumlines = 0; // numlines.
454
strcpy(dinsarinput.fodinsar,"differentialinterf.raw");// default
455
setunspecified(dinsarinput.foscaleduint); // default no output
456
// ______ set mastertopo file to same as master resfile if not specified ______
457
setunspecified(dinsarinput.topomasterresfile); // if specified, use 4 pass
458
setunspecified(dinsarinput.toposlaveresfile); // check later, mandatory
459
setunspecified(dinsarinput.topointresfile); // check later, mandatory
461
setunspecified(comprefdeminput.firefdem); // check later, mandatory
462
setunspecified(comprefdeminput.fodemi); // check later, then set default
464
setunspecified(comprefdeminput.foh2ph); // check later, then set default
465
// ____ end added by FvL
466
setunspecified(comprefdeminput.forefdemhei); // check later, then set default
467
strcpy(comprefdeminput.forefdem,"refdem.raw"); // default name
468
strcpy(comprefdeminput.fodem,"demcrop.raw"); // default name [FvL]
469
comprefdeminput.iformatflag = FORMATI2; // default gtopo30
470
// comprefdeminput.method = crd_trilinear; // default method
471
// comprefdeminput.extradense = 0.5; // default (now interpolated in l,p)
472
comprefdeminput.demrows = 6000; // default gtopo30
473
comprefdeminput.demcols = 4800; // default gtopo30
474
comprefdeminput.demnodata = -9999; // default gtopo30
475
comprefdeminput.demdeltalat = deg2rad(0.00833333333333333333);// default gtopo30
476
comprefdeminput.demdeltalon = deg2rad(0.00833333333333333333);// default gtopo30
477
comprefdeminput.demlatleftupper = deg2rad(89.995833333333333333); // w020n90.DEM
478
comprefdeminput.demlonleftupper = deg2rad(-19.995833333333333333);// w020n90.DEM
480
strcpy(subtrrefdeminput.focint,"cint.minrefdem.raw"); // default name
481
subtrrefdeminput.offsetL = 0; // default no offset
482
subtrrefdeminput.offsetP = 0; // default no offset
484
strcpy(unwrapinput.fouint,"unwrapped_interferogram.raw"); // default name
485
strcpy(unwrapinput.foregions,"regions_unwrapped.raw"); // default name
486
setunspecified(unwrapinput.seedfile); // check later, then set default
487
unwrapinput.deltaLseed = 100; // default 100 pixels;
488
unwrapinput.deltaPseed = unwrapinput.deltaLseed; // default 100 pixels;
489
setunspecified(unwrapinput.snaphu_log);// " "
490
setunspecified(unwrapinput.snaphu_coh);// " "
491
strcpy(unwrapinput.snaphu_mode,"DEFO"); // default to DEFO from TOPO
492
strcpy(unwrapinput.snaphu_init,"MST"); // default method
493
strcpy(unwrapinput.snaphu_verbose,"TRUE"); // default verbose
494
unwrapinput.oformatflag = FORMATR4; // default to
495
// REAL4 from FORMATHGT
497
// block for Tile.CONTROL: only for SNAPHU; defaults for single CPU
498
unwrapinput.ntilerow = 1; // number of tiles in range
499
unwrapinput.ntilecol = 1; // number of tiles in azimuth
500
unwrapinput.rowovrlp = 0; // overlap between tiles in rng
501
unwrapinput.colovrlp = 0; // overlap between tiles in az
502
unwrapinput.nproc = 1; // no.cpus or nodes on load
504
unwrapinput.tilecostthresh = 500; // cost threshold boundaries of reliable regions
507
slant2hinput.Npoints = 200; // default 100 pixels;
508
slant2hinput.degree1d = 2; // default 2
509
slant2hinput.degree2d = 5; // default 5
510
slant2hinput.Nheights = slant2hinput.degree1d+1;// minimum
511
strcpy(slant2hinput.fohei,"hei.raw"); // default
512
strcpy(slant2hinput.fophi,"phi.raw"); // default
513
strcpy(slant2hinput.folam,"lam.raw"); // default
515
strcpy(geocodeinput.fophi,"geo_phi.raw"); // default name
516
strcpy(geocodeinput.folam,"geo_lambda.raw"); // default name
518
// ____ start added by HB ____
519
estorbitsinput.method = eo_lsq; // default: least squares method
520
setunspecified(estorbitsinput.fiheightmap); // default: use no heights
521
setunspecified(estorbitsinput.foresiduals); // default: no output
522
estorbitsinput.weighting = eo_noweighting; // default: unweighted
523
const uint def_eo_nobs = 1000; // default value, apply later
524
setunspecified(estorbitsinput.ifpositions); // default: no file input
525
estorbitsinput.threshold = 0; // default: ignore coherence estimate
526
estorbitsinput.maxiter = 0; // default: no iteration
527
estorbitsinput.k_alpha = 3.29; // default: norminv(.9995) \approx tinv(.9995,redund)
528
estorbitsinput.maxfringesaz = 15; //
529
estorbitsinput.maxfringesrg = 15; //
530
setunspecified(estorbitsinput.reforbitfile); // default: use master as reference
531
setunspecified(estorbitsinput.foobsdata); // default: do not dump observation data
532
estorbitsinput.poldegree = 1; //
533
estorbitsinput.constrained = true; // default: constrain BPAR0 BPERP1 (define later)
534
// end added by HB ____
536
// ====== (default) Methods ======
537
const int16 def_mte_method = cc_magspace;
538
const int16 def_cc_method = cc_magfft;
539
const int16 def_fc_method = fc_magfft;
540
const int16 def_fe_method = fe_porbits;
541
const int16 def_rs_method = rs_cc4p;
542
const int16 def_uw_method = uw_method2;// snaphu, system call, see www
543
const int16 def_s2h_method = s2h_ambiguity;
545
// ______ To check later if default should be used ______
546
mtiminginput.method = def_mte_method - 999; // default method (repair later)
547
mtiminginput.Nwin = def_mte_nwin + 999; // default #windows
548
coarsecorrinput.method = def_cc_method - 999; // default method (repair later)
549
coarsecorrinput.Nwin = def_cc_nwin + 999; // default #windows
550
fineinput.method = def_fc_method - 999; // default method (repair later)
551
fineinput.Nwin = def_fc_nwin + 999; // default #windows
552
unwrapinput.method = def_uw_method - 999; // default method (repair later)
553
comprefphainput.method = def_fe_method - 999; // default method (repair later)
554
comprefphainput.degree = def_fe_degree - 999; // default degree polynomial
555
comprefphainput.Npoints = def_fe_Npoints - 999; // default degree polynomial
556
resampleinput.method = def_rs_method - 999; // default method (repair later)
557
slant2hinput.method = def_s2h_method - 999; // default method (repair later)
558
estorbitsinput.nobs = 0; // set default later
564
// ====== Process "inputoptionsfile" ======
565
bool continuereading = true;
566
//while (! optionsfile.eof()) // read file until end of file.
567
//while (continuereading || ! optionsfile.eof()) // read file until STOP card or if fails exit at end of the file
568
while (continuereading) // read file until STOP card
571
optionsfile.getline(eachline,4*ONE27,'\n'); // get line. [MA] if the line is longer than 4*ONE27 then loops forever.
572
//cerr << "line: " << linecnt << " : " << eachline << endl;
574
if ( optionsfile.eof() ) // && strcmp(keyword,"STOP") ) // [MA] STOP is missing
576
ERROR << "STOP: \t is missing"
577
<< " in file '" << inputoptionsfile << "'";
578
PRINT_ERROR(ERROR.get_str())
579
WARNING.print("Please make sure the inputfile line: STOP has ended with [eol] character");
580
throw(keyword_error);
581
continuereading = false; // break while loop
584
const int maxwords = 8; // [GJ, MA]
585
char *word[ maxwords ];
588
for ( int i = 0; i < maxwords; i++ )
590
while ( *c == ' ' || *c == '\t' ) // get rid of leadin white space
594
word[ i ] = c; // pass first char address of a word
596
while ( *c != ' ' && *c != '\t' && *c != '\0' )
601
if ( *c != '\0' ) // at last char
608
char *keyword = word[0]; // start off with the card.
609
// word[1] --> first argument
610
// word[2] --> second argument and so on.
613
DEBUG << linecnt << ": Read keyword: " << keyword;
616
// *******************************************************************
618
// *******************************************************************
619
if (!strcmp(keyword,"COMMENT") ||
620
!strcmp(keyword,"C"))
622
; // comment: no action
624
else if (!strncmp(keyword,"//",2) || // assume user comments out
625
!strncmp(keyword,"#",1)) // with // or '#' as delimiter
626
{ // but no blank after keyword
627
; // comment: no action
629
//else if (!strncmp(keyword,'\0',1)) // empty line? crashes
630
else if (!strlen(keyword)) // empty line
632
; // comment: no action
635
// **********************************************************************
636
else if (!strcmp(keyword,"BEEP")) // level of beep output (THE CARD)
637
{ // /progress/[warning]/error/ON/OFF
638
//keyword = word[1] ; // pass keyword // argument
639
//writearg((char*)keyword);
640
keyword = word[1]; // pass next word (the argument)
643
if (!strcmp(keyword,"ERROR"))
648
PROGRESS.bellrings(0);
649
WARNING.bellrings(0);
652
INFO.print("BEEP: \tbeeping enabled at level: \tERROR");
654
else if (!strcmp(keyword,"PROGRESS"))
659
PROGRESS.bellrings(1);
660
WARNING.bellrings(2);
663
INFO.print("BEEP: \tbeeping enabled at level: \tPROGRESS");
665
else if (!strcmp(keyword,"WARNING"))
670
PROGRESS.bellrings(0);
671
WARNING.bellrings(1);
674
INFO.print("BEEP: \tbeeping enabled at level: \tWARNING");
676
else if (!strcmp(keyword,"OFF"))
681
PROGRESS.bellrings(0);
682
WARNING.bellrings(0);
685
INFO.print("BEEP: \tbeeping disabled");
687
else if (!strcmp(keyword,"ON") ||
688
!strncmp(keyword,"//",2) || // comment
689
!strncmp(keyword,"#",1) || // comment
690
//!strcmp(keyword,\'\\0\'))
691
!(keyword[0] == '\0')) // no keyword
692
// !strcmp(keyword,"")) // no keyword
697
PROGRESS.bellrings(1);
698
WARNING.bellrings(2);
701
INFO.print("BEEP: \tbeeping enabled for all levels: \tON");
709
PROGRESS.bellrings(0);
710
WARNING.bellrings(1);
712
WARNING << "BEEP: line " << linecnt
713
<< ": Argument " << keyword
714
<< " not recognized."
715
<< " [error/warning/progress/on/off] I used WARNING.";
720
// **********************************************************************
721
else if (!strcmp(keyword,"SCREEN")) // level of screen output
722
{ // debug/info/progress/warning or error
726
WARNING << "SCREEN: line " << linecnt << ": stdout: "
727
<< " ignored due to prior occurence.";
733
//keyword = word[1] ; // pass keyword // argument
734
keyword = word[1]; // argument
737
if (!strcmp(keyword,"INFO"))
745
displevel = 20000 + displevel%10000; // for cnt #warnings
746
INFO.print("SCREEN: \tverboseness: \t\t\tINFO");
748
else if (!strcmp(keyword,"PROGRESS"))
756
displevel = 10000 + displevel%10000; // for cnt #warnings
757
INFO.print("SCREEN: \tverboseness: \t\t\tPROGRESS");
759
else if (!strcmp(keyword,"DEBUG"))
767
displevel = 30000 + displevel%10000; // for cnt #warnings
768
INFO.print("SCREEN: \tverboseness: \t\t\tDEBUG");
770
else if (!strcmp(keyword,"TRACE"))
779
else if (!strcmp(keyword,"WARNING"))
787
displevel = 0 + displevel%10000; // for cnt #warnings;
788
INFO.print("SCREEN: \tverboseness: \t\t\tWARNING");
790
else if (!strcmp(keyword,"ERROR"))
798
displevel = -100 + displevel%10000; // for cnt #warnings
799
INFO.print("SCREEN: \tverboseness: \t\t\tERROR");
809
WARNING << "SCREEN: line " << linecnt
810
<< ": Argument " << keyword
811
<< " not recognized."
812
<< " [error/warning/progress/info/debug] I used DEBUG.";
814
displevel = 30000 + displevel%10000; // for cnt #warnings
819
// **********************************************************************
820
else if (!strcmp(keyword,"MEMORY")) // available mem in MB for processing in buffers
825
WARNING << "MEMORY: line " << linecnt
826
<< ": ignored due to prior occurence.";
832
//generalinput.memory = word[1] ; // pass keyword
835
//generalinput.memory = uint(strtod( keyword, &pLast )); // [MA] try strtoul( keyword, &pLast, 10 ) for uint
836
generalinput.memory = strtod( keyword, &pLast );
837
if ( pLast == keyword ) // fail
839
ERROR << "memory argument: " << keyword << " is not valid.";
840
PRINT_ERROR(ERROR.get_str())
841
throw(keyword_error);
843
writearg(generalinput.memory);
844
if (generalinput.memory > real8(MEMORY_MAX))
845
WARNING << "MEMORY: > " << MEMORY_MAX << " MB seems unlikely.";
847
//generalinput.memory *= 1000000; // in B
848
generalinput.memory *= 1e6; // convert Mb --> b
852
// **********************************************************************
853
else if (!strcmp(keyword,"BATCH")) // overrides interactive mode
858
WARNING << "BATCH: line: " << linecnt << ": "
859
<< "ignored due to prior occurence.";
863
priorbatch = true; // flag for occurence
864
// keyword = word[1] ; // pass keyword // argument
865
keyword = word[1]; // pass next word (the argument)
868
if (!strcmp(keyword,"OFF"))
869
generalinput.interactive = true;
870
else if (!strcmp(keyword,"ON") ||
871
!strncmp(keyword,"//",2) || // comment
872
!strncmp(keyword,"#",1) || // comment
873
!(keyword[0] == '\0')) // no keyword
874
generalinput.interactive = false;
877
generalinput.interactive = true;
878
WARNING << "BATCH: line: " << linecnt << ": "
879
<< "argument: " << keyword
880
<< " not recognized, interactive processing.";
886
// **********************************************************************
887
else if (!strcmp(keyword,"OVERWRITE"))
889
switch (prioroverwrite)
892
WARNING << "OVERWRITE: line: " << linecnt << ": "
893
<< "ignored due to prior occurence.";
897
prioroverwrite = true; // flag for occurence
898
keyword = word[1]; // pass next word (the argument)
901
if (!strcmp(keyword,"OFF"))
902
generalinput.overwrit = false;
903
else if (!strcmp(keyword,"ON") ||
904
!strncmp(keyword,"//",2) || // comment
905
!strncmp(keyword,"#",1) || // comment
906
!(keyword[0] == '\0')) // no keyword
907
generalinput.overwrit = true;
910
generalinput.overwrit=false; // don't overwrite files
911
WARNING << "OVERWRITE: line " << linecnt
912
<< ": argument: " << keyword
913
<< " not recognized, existing files are not overwritten.";
919
// **********************************************************************
920
else if (!strcmp(keyword,"LISTINPUT"))
922
switch (priorlistinput)
925
WARNING << "LISTINPUT: line: " << linecnt << ": "
926
<< "ignored due to prior occurence.";
930
priorlistinput = true; // flag for occurence
931
keyword = word[1]; // pass next word (the argument)
934
if (!strcmp(keyword,"OFF"))
936
else if (!strcmp(keyword,"ON") ||
937
!strncmp(keyword,"//",2) || // comment
938
!strncmp(keyword,"#",1) || // comment
939
!(keyword[0] == '\0')) // no keyword
943
listinput = true; // default list input
944
WARNING << "LISTINPUT: line " << linecnt
945
<< ": argument: " << keyword
946
<< " not recognized, input will be appended to logfile.";
952
// **********************************************************************
953
else if (!strcmp(keyword,"ONLYPROCESS")) // process only one step
955
// Read argument and set onlyprocess to value for filling
956
// the flag input array 'process[NUMPROCESSES]' after reading reset input
957
// to avoid interference with PROCESS cards (ONLYPROCESS overrides)
959
if (onlyprocess == -1) // check multiple occurences
961
keyword = word[1]; // pass next word (the argument)
964
if (!strcmp(keyword,"M_READFILES"))
965
onlyprocess=pr_m_readfiles;
966
else if (!strcmp(keyword,"M_CROP"))
967
onlyprocess=pr_m_crop;
968
//____RaffaeleNutricato START MODIFICATION SECTION 5
969
else if (!strcmp(keyword,"M_OVS"))
970
onlyprocess=pr_m_oversample;
971
//____RaffaeleNutricato END MODIFICATION SECTION 5
972
else if (!strcmp(keyword,"M_PORBITS"))
973
onlyprocess=pr_m_porbits;
974
else if (!strcmp(keyword,"M_MORBITS")) // [HB]
975
onlyprocess=pr_m_morbits;
976
else if (!strcmp(keyword,"M_SIMAMP")) // [MA]
977
onlyprocess=pr_m_simamp;
978
else if (!strcmp(keyword,"M_TIMING"))
979
onlyprocess=pr_m_mtiming;
980
else if (!strcmp(keyword,"M_FILTAZI"))
981
onlyprocess=pr_m_filtazi;
982
else if (!strcmp(keyword,"FILTRANGE"))
984
onlyprocess=pr_m_filtrange;
985
onlyprocess=pr_s_filtrange;
987
else if (!strcmp(keyword,"M_EXTRA"))
988
onlyprocess=pr_m_EXTRA;
990
else if (!strcmp(keyword,"S_READFILES"))
991
onlyprocess=pr_s_readfiles;
992
else if (!strcmp(keyword,"S_MORBITS")) // [HB]
993
onlyprocess=pr_s_morbits;
994
else if (!strcmp(keyword,"S_CROP"))
995
onlyprocess=pr_s_crop;
996
//____RaffaeleNutricato START MODIFICATION SECTION 6
997
else if (!strcmp(keyword,"S_OVS"))
998
onlyprocess=pr_s_oversample;
999
//____RaffaeleNutricato END MODIFICATION SECTION 6
1000
else if (!strcmp(keyword,"S_PORBITS"))
1001
onlyprocess=pr_s_porbits;
1002
else if (!strcmp(keyword,"S_FILTAZI"))
1003
onlyprocess=pr_s_filtazi;
1004
else if (!strcmp(keyword,"RESAMPLE"))
1005
onlyprocess=pr_s_resample;
1006
else if (!strcmp(keyword,"S_EXTRA"))
1007
onlyprocess=pr_s_EXTRA;
1009
else if (!strcmp(keyword,"COARSEORB"))
1010
onlyprocess=pr_i_coarse;
1011
else if (!strcmp(keyword,"COARSECORR"))
1012
onlyprocess=pr_i_coarse2;
1013
else if (!strcmp(keyword,"FINE"))
1014
onlyprocess=pr_i_fine; // see methodselector
1015
else if (!strcmp(keyword,"RELTIMING")) // [FvL]
1016
onlyprocess=pr_i_timing;
1017
else if (!strcmp(keyword,"DEMASSIST")) // [FvL]
1018
onlyprocess=pr_i_demassist;
1019
else if (!strcmp(keyword,"COREGPM"))
1020
onlyprocess=pr_i_coregpm;
1021
else if (!strcmp(keyword,"INTERFERO"))
1022
onlyprocess=pr_i_interfero;
1023
else if (!strcmp(keyword,"COHERENCE"))
1024
onlyprocess=pr_i_coherence;
1025
else if (!strcmp(keyword,"FILTPHASE"))
1026
onlyprocess=pr_i_filtphase;
1027
else if (!strcmp(keyword,"COMPREFPHA"))
1028
onlyprocess=pr_i_comprefpha;
1029
else if (!strcmp(keyword,"SUBTRREFPHA"))
1030
onlyprocess=pr_i_subtrrefpha;
1031
else if (!strcmp(keyword,"COMPREFDEM"))
1032
onlyprocess=pr_i_comprefdem;
1033
else if (!strcmp(keyword,"SUBTRREFDEM"))
1034
onlyprocess=pr_i_subtrrefdem;
1035
else if (!strcmp(keyword,"UNWRAP"))
1036
onlyprocess=pr_i_unwrap; // see methodselector
1037
else if (!strcmp(keyword,"ESTORBITS")) // [HB]
1038
onlyprocess=pr_i_estorbits;
1039
else if (!strcmp(keyword,"SLANT2H"))
1040
onlyprocess=pr_i_slant2h;
1041
else if (!strcmp(keyword,"GEOCODE"))
1042
onlyprocess=pr_i_geocoding;
1043
else if (!strcmp(keyword,"DINSAR"))
1044
onlyprocess=pr_i_dinsar;
1045
else if (!strcmp(keyword,"I_EXTRA2"))
1046
onlyprocess=pr_i_EXTRA2;
1049
ERROR << "ONLYPROCESS: line " << linecnt << ": Argument "
1050
<< keyword << " not recognized.";
1051
PRINT_ERROR(ERROR.get_str())
1052
throw(keyword_error);
1054
INFO << "ONLYPROCESS: \tonly processing step: \t\t" << keyword;
1059
WARNING << "ONLYPROCESS: more than one occurence of card, ignored line: "
1066
// **********************************************************************
1067
else if (!strcmp(keyword,"PROCESS")) // which routine to run
1069
if (onlyprocess+1) // initialized to -1;
1071
WARNING << "PROCESS card on line " << linecnt
1072
<< " ignored due to presence of ONLYPROCESS card.";
1077
keyword = word[1]; // pass next word (the argument)
1080
if (!strcmp(keyword,"M_READFILES"))
1081
generalinput.process[pr_m_readfiles] = 1;
1082
else if (!strcmp(keyword,"M_CROP"))
1083
generalinput.process[pr_m_crop] = 1;
1084
//____RaffaeleNutricato START MODIFICATION SECTION 7
1085
else if (!strcmp(keyword,"M_OVS"))
1086
generalinput.process[pr_m_oversample] = 1;
1087
//____RaffaeleNutricato END MODIFICATION SECTION 7
1088
else if (!strcmp(keyword,"M_PORBITS"))
1089
generalinput.process[pr_m_porbits] = 1;
1090
else if (!strcmp(keyword,"M_MORBITS")) // [HB]
1091
generalinput.process[pr_m_morbits] = 1;
1092
else if (!strcmp(keyword,"M_SIMAMP")) // [MA]
1093
generalinput.process[pr_m_simamp] = 1;
1094
else if (!strcmp(keyword,"M_TIMING"))
1095
generalinput.process[pr_m_mtiming] = 1;
1096
else if (!strcmp(keyword,"M_FILTAZI"))
1097
generalinput.process[pr_m_filtazi] = 1;
1098
else if (!strcmp(keyword,"FILTRANGE"))
1100
generalinput.process[pr_m_filtrange] = 1; // use for s_ as well
1101
generalinput.process[pr_s_filtrange] = 1;
1103
else if (!strcmp(keyword,"M_EXTRA"))
1104
generalinput.process[pr_m_EXTRA] = 1;
1106
else if (!strcmp(keyword,"S_READFILES"))
1107
generalinput.process[pr_s_readfiles] = 1;
1108
else if (!strcmp(keyword,"S_MORBITS")) // [HB]
1109
generalinput.process[pr_s_morbits] = 1;
1110
else if (!strcmp(keyword,"S_CROP"))
1111
generalinput.process[pr_s_crop] = 1;
1112
//____RaffaeleNutricato START MODIFICATION SECTION 8
1113
else if (!strcmp(keyword,"S_OVS"))
1114
generalinput.process[pr_s_oversample] = 1;
1115
//____RaffaeleNutricato END MODIFICATION SECTION 8
1116
else if (!strcmp(keyword,"S_PORBITS"))
1117
generalinput.process[pr_s_porbits] = 1;
1118
else if (!strcmp(keyword,"S_FILTAZI"))
1119
generalinput.process[pr_s_filtazi] = 1;
1120
else if (!strcmp(keyword,"RESAMPLE"))
1121
generalinput.process[pr_s_resample] = 1;
1122
else if (!strcmp(keyword,"S_EXTRA"))
1123
generalinput.process[pr_s_EXTRA] = 1;
1125
else if (!strcmp(keyword,"COARSEORB"))
1126
generalinput.process[pr_i_coarse] = 1;
1127
else if (!strcmp(keyword,"COARSECORR"))
1128
generalinput.process[pr_i_coarse2] = 1;
1129
else if (!strcmp(keyword,"FINE"))
1130
generalinput.process[pr_i_fine] = 1;
1131
else if (!strcmp(keyword,"RELTIMING")) // [FvL]
1132
generalinput.process[pr_i_timing] = 1;
1133
else if (!strcmp(keyword,"DEMASSIST")) // [FvL]
1134
generalinput.process[pr_i_demassist] = 1;
1135
else if (!strcmp(keyword,"COREGPM"))
1136
generalinput.process[pr_i_coregpm] = 1;
1137
else if (!strcmp(keyword,"COMPREFPHA"))
1138
generalinput.process[pr_i_comprefpha] = 1;
1139
else if (!strcmp(keyword,"SUBTRREFPHA"))
1140
generalinput.process[pr_i_subtrrefpha] = 1;
1141
else if (!strcmp(keyword,"COMPREFDEM"))
1142
generalinput.process[pr_i_comprefdem] = 1;
1143
else if (!strcmp(keyword,"SUBTRREFDEM"))
1144
generalinput.process[pr_i_subtrrefdem] = 1;
1145
else if (!strcmp(keyword,"INTERFERO"))
1146
generalinput.process[pr_i_interfero] = 1;
1147
else if (!strcmp(keyword,"COHERENCE"))
1148
generalinput.process[pr_i_coherence] = 1;
1149
else if (!strcmp(keyword,"FILTPHASE"))
1150
generalinput.process[pr_i_filtphase] = 1;
1151
else if (!strcmp(keyword,"UNWRAP"))
1152
generalinput.process[pr_i_unwrap] = 1;
1153
else if (!strcmp(keyword,"ESTORBITS")) // [HB]
1154
generalinput.process[pr_i_estorbits] = 1;
1155
else if (!strcmp(keyword,"SLANT2H"))
1156
generalinput.process[pr_i_slant2h] = 1;
1157
else if (!strcmp(keyword,"GEOCODE"))
1158
generalinput.process[pr_i_geocoding] = 1;
1159
else if (!strcmp(keyword,"DINSAR"))
1160
generalinput.process[pr_i_dinsar] = 1;
1162
else if (!strcmp(keyword,"I_EXTRA2"))
1163
generalinput.process[pr_i_EXTRA2] = 1;
1166
ERROR << "PROCESS: line " << linecnt
1167
<< ": Argument " << keyword
1168
<< " not recognized.";
1169
PRINT_ERROR(ERROR.get_str())
1170
throw(keyword_error);
1172
INFO << "PROCESS: \tI will process step: \t\t" << keyword;
1177
// **********************************************************************
1178
else if (!strcmp(keyword,"ELLIPSOID")) // ref. system
1179
{ // inputoptionsfile
1180
ellipsoid = true; // use below
1182
char *keyword2 = word[2];
1186
if (!strcmp(keyword,"WGS84"))
1188
ellipsinput = WGS84;// default
1190
else if (!strcmp(keyword,"GRS80"))
1192
WARNING.print("ELLIPS: not ok, sat. ephemerides should be in this system.");
1193
input_ell GRS80(6378137.0,6356752.3);
1194
GRS80.set_name("GRS80");
1195
ellipsinput = GRS80;// copy
1197
else if (!strcmp(keyword,"BESSEL"))
1199
WARNING.print("ELLIPS: not ok, sat. ephemerides should be in this system.");
1200
input_ell BESSEL(6377397.155,6356078.963);
1201
BESSEL.set_name("BESSEL");
1202
ellipsinput = BESSEL;// copy
1204
else if (isdigit(keyword2[0])) // likely to be a,b
1206
WARNING.print("ELLIPS: not ok, sat. ephemerides should be in this system.");
1207
input_ell ELL_USER_DEFINED(atof(keyword),atof(keyword2));// a,b
1208
ELL_USER_DEFINED.set_name("user_defined");
1209
ellipsinput = ELL_USER_DEFINED;// copy
1210
if (ellipsinput.a<ellipsinput.b || ellipsinput.b<EPS)
1212
ERROR << "ELLIPSOID keyword (real8A real8B): B==0 or A<B: "
1213
<< ellipsinput.a << "<" << ellipsinput.b
1214
<< " at line " << linecnt << ".";
1215
PRINT_ERROR(ERROR.get_str())
1216
throw(keyword_error);
1221
PRINT_ERROR("unknown argument for ellipsoid card.")
1222
throw(keyword_error);
1224
INFO << "ELLIPSOID: \tsemimajor=" << ellipsinput.a
1225
<< ", semiminor=" << ellipsinput.b << "; line " << linecnt << ".";
1229
// **********************************************************************
1230
else if (!strcmp(keyword,"M_RESFILE")) // resultfile filename
1232
//generalinput.m_resfile = word[1] ; // pass keyword
1234
// strcpy(generalinput.m_resfile, keyword);
1235
strcpy(generalinput.m_resfile, keyword);
1236
writearg(generalinput.m_resfile);
1239
// **********************************************************************
1240
else if (!strcmp(keyword,"S_RESFILE")) // resultfile filename
1243
strcpy(generalinput.s_resfile, keyword);
1244
writearg(generalinput.s_resfile);
1247
// **********************************************************************
1248
else if (!strcmp(keyword,"LOGFILE")) // logfile filename
1251
strcpy(generalinput.logfile, keyword);
1252
writearg(generalinput.logfile);
1255
// **********************************************************************
1256
else if (!strcmp(keyword,"I_RESFILE")) // interferogram.out
1259
strcpy(generalinput.i_resfile, keyword);
1260
writearg(generalinput.i_resfile);
1263
// **********************************************************************
1264
else if (!strcmp(keyword,"ORB_INTERP")) // orbit
1266
//keyword = word[1] ; // pass keyword // argument
1270
if (!strcmp(keyword,"POLYFIT"))
1272
INFO.print("ORB_INTERP: polynomial fit for interpolation");
1273
generalinput.orb_interp = ORB_DEFAULT;// depends on number of points
1274
// ___ Check second optional argument with degree ___
1275
// keyword = word[1] ; // pass keyword
1276
char *keyword2= word[2];
1277
int32 degree = atoi(keyword2);
1278
if (degree > 0)// atoi returns 0 if not convertible
1280
generalinput.orb_interp = degree;
1281
INFO << "ORB_INTERP: second argument read: degree = " << degree;
1285
else if (!strcmp(keyword,"SPLINE"))
1287
INFO.print("ORB_INTERP: natural cubic splines used fit interpolation");
1288
generalinput.orb_interp = ORB_SPLINE;// natural cubic splines
1292
WARNING.print("argument ORB_INTERP not recognized, using polyfit");
1293
generalinput.orb_interp = ORB_DEFAULT;// depends on number of points
1297
// **********************************************************************
1298
else if (!strcmp(keyword,"ORB_PRM")) // orbit parameters
1300
keyword = word[1]; // pass keyword // argument
1303
if (!strcmp(keyword,"POSITION") || !strcmp(keyword,"POS") )
1305
INFO.print("ORB_PRM: identified, using position state vectors for orbit interpolation");
1306
generalinput.orb_prm = ORB_PRM_POS;// user positional state vectors only
1308
else if (!strcmp(keyword,"POSVEL"))
1310
INFO.print("ORB_PRM: identified, using positions and velocities for orbit interpolation");
1311
generalinput.orb_prm = ORB_PRM_VEL;// include velocity vectors too
1315
WARNING.print("argument ORB_PRM not identified, using position state vectors only (this ignores any velocity column.)");
1316
generalinput.orb_prm = ORB_PRM_POS;// default positional.
1320
// **********************************************************************
1321
else if (!strcmp(keyword,"DUMPBASELINE")) // eval on grid
1323
// generalinput.dumpbaselineL >> generalinput.dumpbaselineP = word[1] ; // pass keyword
1325
char *keyword2= word[2]; // in local scope
1326
generalinput.dumpbaselineL = atoi( keyword ) ;
1327
generalinput.dumpbaselineP = atoi( keyword2 );
1328
writearg(generalinput.dumpbaselineL);
1329
writearg(generalinput.dumpbaselineP);
1330
if (generalinput.dumpbaselineL==0 || generalinput.dumpbaselineP==0)
1332
ERROR << "DUMPBASELINE: " << generalinput.dumpbaselineL
1333
<< " " << generalinput.dumpbaselineP << " line: "
1334
<< linecnt << ": ==0.\n";
1335
PRINT_ERROR(ERROR.get_str())
1336
throw(keyword_error);
1340
// **********************************************************************
1341
else if (!strcmp(keyword,"PREVIEW")) // system call to cpxfiddle to get SUNraster
1343
//keyword = word[1] ; // pass keyword // argument
1344
keyword = word[1]; // argument
1347
if (!strcmp(keyword,"OFF"))
1349
generalinput.preview = 0;
1350
INFO.print("PREVIEW: \tOFF: generation of SUNraster files disabled.");
1352
else if (!strcmp(keyword,"XV"))
1354
generalinput.preview = 2;
1355
INFO.print("PREVIEW: \tON: generation of SUNraster files enabled + XV sytem call.");
1357
else if (!strcmp(keyword,"ON") ||
1358
!strncmp(keyword,"//",2) || // comment
1359
!strncmp(keyword,"#",1) || // comment
1360
!(keyword[0] == '\0')) // no keyword
1362
generalinput.preview = 1;
1363
INFO.print("PREVIEW: \tON: generation of SUNraster files enabled.");
1367
generalinput.preview = 0;
1368
WARNING << "PREVIEW: line: " << linecnt << ": "
1369
<< "argument: " << keyword
1370
<< " not recognized, no preview generated.";
1375
// **********************************************************************
1376
else if (!strcmp(keyword,"HEIGHT")) // mean height or for CROP
1378
//generalinput.terrain_height = word[1] ; // pass keyword
1381
generalinput.terrain_height = strtod( keyword, &pLast );
1382
if ( pLast == keyword ) // fail
1384
ERROR << "Height argument: " << keyword << " is not valid.";
1385
PRINT_ERROR(ERROR.get_str())
1386
throw(keyword_error);
1388
writearg(generalinput.terrain_height);
1391
// **********************************************************************
1392
else if (!strcmp(keyword,"TIEPOINT")) // lat/lon/hei dec.degrees
1396
char *pLast, *pLast2, *pLast3 = NULL;
1397
generalinput.tiepoint.x = strtod( keyword, &pLast );
1398
generalinput.tiepoint.y = strtod( word[2], &pLast2 ); // 2nd arg
1399
generalinput.tiepoint.z = strtod( word[3], &pLast3 ); // 3rd arg
1400
if ( pLast == keyword || pLast2 == word[2] || pLast3 == word[3] ) // fail
1402
ERROR << "Tiepoints: " << keyword
1404
<< " " << word[3] << " are not valid.";
1405
PRINT_ERROR(ERROR.get_str())
1406
throw(keyword_error);
1408
writearg(generalinput.tiepoint.x);
1409
writearg(generalinput.tiepoint.y);
1410
writearg(generalinput.tiepoint.z);
1413
// **********************************************************************
1414
else if (!strcmp(keyword,"STOP")) // STOP interpreting input
1416
INFO.print("STOP: \tEncountered.");
1417
DEBUG << "STOP card encountered at line "
1420
continuereading = false; // break while loop
1423
// *******************************************************************
1425
// *******************************************************************
1426
else if (!strcmp(keyword,"M_IN_METHOD")) // ERS or ASAR ENVISAT
1428
//filename = word[1] ; // pass keyword
1433
if (!strcmp(keyword,"ERS"))
1434
m_readfilesinput.sensor_id=SLC_ERS; // default ers
1435
else if (!strcmp(keyword,"ERS-1")) // ers
1436
m_readfilesinput.sensor_id=SLC_ERS;
1437
else if (!strcmp(keyword,"ERS1")) // ers
1438
m_readfilesinput.sensor_id=SLC_ERS;
1439
else if (!strcmp(keyword,"ERS-2")) // ers
1440
m_readfilesinput.sensor_id=SLC_ERS;
1441
else if (!strcmp(keyword,"ERS2")) // ers
1442
m_readfilesinput.sensor_id=SLC_ERS;
1443
else if (!strcmp(keyword,"ERS_N1")) // ers in envisat file format [MA]; treat as ASAR
1444
//m_readfilesinput.sensor_id=SLC_ASAR;
1445
m_readfilesinput.sensor_id=SLC_ERS_N1;
1446
else if (!strcmp(keyword,"N1")) // envisat
1447
m_readfilesinput.sensor_id=SLC_ASAR;
1448
else if (!strcmp(keyword,"ASAR")) // envisat
1449
m_readfilesinput.sensor_id=SLC_ASAR;
1450
else if (!strcmp(keyword,"ENVISAT")) // envisat
1451
m_readfilesinput.sensor_id=SLC_ASAR;
1452
else if (!strcmp(keyword,"ASAR_AP_HH")) // envisat Alternating Pol. HH
1453
m_readfilesinput.sensor_id=SLC_ASAR_AP_HH;
1454
else if (!strcmp(keyword,"ASAR_AP_VV")) // envisat Alternating Pol. VV
1455
m_readfilesinput.sensor_id=SLC_ASAR_AP_VV;
1456
else if (!strcmp(keyword,"ATLANTIS")) // radarsat ceos reader
1457
m_readfilesinput.sensor_id=SLC_RSAT;
1458
else if (!strcmp(keyword,"RSAT")) // radarsat
1459
m_readfilesinput.sensor_id=SLC_RSAT;
1460
else if (!strcmp(keyword,"RADARSAT")) // radarsat
1461
m_readfilesinput.sensor_id=SLC_RSAT;
1462
else if (!strcmp(keyword,"RADARSAT-1")) // radarsat
1463
m_readfilesinput.sensor_id=SLC_RSAT;
1464
else if (!strcmp(keyword,"JERS")) // jers
1465
m_readfilesinput.sensor_id=SLC_JERS;
1466
else if (!strcmp(keyword,"J-ERS")) // jers
1467
m_readfilesinput.sensor_id=SLC_JERS;
1468
else if (!strcmp(keyword,"ALOS")) // alos FBS [DON]
1469
m_readfilesinput.sensor_id=SLC_ALOS;
1470
else if (!strcmp(keyword,"TSX")) // TSX [PM]
1471
m_readfilesinput.sensor_id=SLC_TSX;
1472
else if (!strcmp(keyword,"TERRASARX")) // TSX
1473
m_readfilesinput.sensor_id=SLC_TSX;
1474
else if (!strcmp(keyword,"TERRASAR-X")) // TSX
1475
m_readfilesinput.sensor_id=SLC_TSX;
1476
else if (!strcmp(keyword,"RS2")) // RS2 [MA]
1477
m_readfilesinput.sensor_id=SLC_RS2;
1478
else if (!strcmp(keyword,"RADARSAT-2")) // RS2
1479
m_readfilesinput.sensor_id=SLC_RS2;
1480
else if (!strcmp(keyword,"CSK")) // CSK [PD]
1481
m_readfilesinput.sensor_id=SLC_CSK;
1482
else if (!strcmp(keyword,"CSX")) // CSK [PD]
1483
m_readfilesinput.sensor_id=SLC_CSK;
1484
else if (!strcmp(keyword,"GAMMA")) // GAMMA [BO]
1485
m_readfilesinput.sensor_id=SLC_GAMMA;
1488
ERROR << "M_IN_METHOD: method " << keyword
1489
<< " not known for reading input files on line "
1491
PRINT_ERROR(ERROR.get_str())
1492
throw(keyword_error);
1496
// **********************************************************************
1497
else if (!strcmp(keyword,"M_IN_VOL")) // volumefile filename
1499
//m_readfilesinput.volfile = word[1] ; // pass keyword
1500
strcpy(m_readfilesinput.volfile, word[1]); // pass keyword
1501
writearg(m_readfilesinput.volfile);
1504
// **********************************************************************
1505
else if (!strcmp(keyword,"M_IN_LEA")) // leaderfile filename
1507
strcpy(m_readfilesinput.leaderfile, word[1]); // pass keyword
1508
writearg(m_readfilesinput.leaderfile);
1511
// **********************************************************************
1512
else if (!strcmp(keyword,"M_IN_NULL")) // nullfile filename
1514
strcpy(m_readfilesinput.nullfile, word[1]); // pass keyword
1515
writearg(m_readfilesinput.nullfile);
1518
// **********************************************************************
1519
else if (!strcmp(keyword,"M_IN_DAT")) // datafile filename
1521
strcpy(m_readfilesinput.datfile, word[1]); // pass keyword
1522
writearg(m_readfilesinput.datfile);
1525
// **********************************************************************
1526
else if (!strcmp(keyword,"M_RG_T_ERROR")) // master timing error
1530
m_readfilesinput.rg_timing_error= strtod( keyword, &pLast );
1531
if ( pLast == keyword ) // fail
1533
ERROR << "M_RG_T_ERROR argument: " << keyword << " is not valid.";
1534
PRINT_ERROR(ERROR.get_str())
1535
throw(keyword_error);
1537
writearg(m_readfilesinput.rg_timing_error);
1540
// **********************************************************************
1541
else if (!strcmp(keyword,"M_AZ_T_ERROR")) // master timing error
1545
m_readfilesinput.az_timing_error = strtod( keyword, &pLast );
1546
if ( pLast == keyword ) // fail
1548
ERROR << "M_AZ_T_ERROR argument: " << keyword << " is not valid.";
1549
PRINT_ERROR(ERROR.get_str())
1550
throw(keyword_error);
1552
writearg(m_readfilesinput.az_timing_error);
1555
// *******************************************************************
1556
else if (!strcmp(keyword,"S_IN_METHOD")) // ERS or ASAR ENVISAT
1562
if (!strcmp(keyword,"ERS"))
1563
s_readfilesinput.sensor_id=SLC_ERS; // default
1564
else if (!strcmp(keyword,"ERS-1")) // ers
1565
s_readfilesinput.sensor_id=SLC_ERS;
1566
else if (!strcmp(keyword,"ERS1")) // ers
1567
s_readfilesinput.sensor_id=SLC_ERS;
1568
else if (!strcmp(keyword,"ERS-2")) // ers
1569
s_readfilesinput.sensor_id=SLC_ERS;
1570
else if (!strcmp(keyword,"ERS2")) // ers
1571
s_readfilesinput.sensor_id=SLC_ERS;
1572
else if (!strcmp(keyword,"ERS_N1")) // ers in envisat file format [MA]; treat as ASAR
1573
s_readfilesinput.sensor_id=SLC_ERS_N1;
1574
else if (!strcmp(keyword,"N1")) // envisat
1575
s_readfilesinput.sensor_id=SLC_ASAR;
1576
else if (!strcmp(keyword,"ASAR")) // envisat
1577
s_readfilesinput.sensor_id=SLC_ASAR;
1578
else if (!strcmp(keyword,"ENVISAT")) // envisat
1579
s_readfilesinput.sensor_id=SLC_ASAR;
1580
else if (!strcmp(keyword,"ATLANTIS")) // radarsat ceos reader
1581
s_readfilesinput.sensor_id=SLC_RSAT;
1582
else if (!strcmp(keyword,"RSAT")) // radarsat
1583
s_readfilesinput.sensor_id=SLC_RSAT;
1584
else if (!strcmp(keyword,"RADARSAT")) // radarsat
1585
s_readfilesinput.sensor_id=SLC_RSAT;
1586
else if (!strcmp(keyword,"RADARSAT-1")) // radarsat
1587
s_readfilesinput.sensor_id=SLC_RSAT;
1588
else if (!strcmp(keyword,"JERS")) // jers
1589
s_readfilesinput.sensor_id=SLC_JERS;
1590
else if (!strcmp(keyword,"J-ERS")) // jers
1591
s_readfilesinput.sensor_id=SLC_JERS;
1592
else if (!strcmp(keyword,"ALOS")) // [DON]
1593
s_readfilesinput.sensor_id=SLC_ALOS;
1594
else if (!strcmp(keyword,"TSX")) // TSX [PM]
1595
s_readfilesinput.sensor_id=SLC_TSX;
1596
else if (!strcmp(keyword,"TERRASARX")) // TSX
1597
s_readfilesinput.sensor_id=SLC_TSX;
1598
else if (!strcmp(keyword,"TERRASAR-X")) // TSX
1599
s_readfilesinput.sensor_id=SLC_TSX;
1600
else if (!strcmp(keyword,"RS2")) // RS2 [MA]
1601
s_readfilesinput.sensor_id=SLC_RS2;
1602
else if (!strcmp(keyword,"RADARSAT-2")) // RS2
1603
s_readfilesinput.sensor_id=SLC_RS2;
1604
else if (!strcmp(keyword,"CSK")) // CSK [PD]
1605
s_readfilesinput.sensor_id=SLC_CSK;
1606
else if (!strcmp(keyword,"CSX")) // CSK [PD]
1607
s_readfilesinput.sensor_id=SLC_CSK;
1608
else if (!strcmp(keyword,"GAMMA")) // GAMMA [BO]
1609
s_readfilesinput.sensor_id=SLC_GAMMA;
1612
ERROR << "S_IN_METHOD: method " << keyword
1613
<< " not known for reading input files on line "
1615
PRINT_ERROR(ERROR.get_str())
1616
throw(keyword_error);
1620
// **********************************************************************
1621
else if (!strcmp(keyword,"S_IN_VOL")) // volumefile filename
1623
strcpy(s_readfilesinput.volfile, word[1]); // pass keyword
1624
writearg(s_readfilesinput.volfile);
1627
// **********************************************************************
1628
else if (!strcmp(keyword,"S_IN_LEA")) // leaderfile filename
1630
strcpy(s_readfilesinput.leaderfile, word[1]); // pass keyword
1631
writearg(s_readfilesinput.leaderfile);
1634
// **********************************************************************
1635
else if (!strcmp(keyword,"S_IN_NULL")) // nullfile filename
1637
strcpy(s_readfilesinput.nullfile, word[1]); // pass keyword
1638
writearg(s_readfilesinput.nullfile);
1641
// **********************************************************************
1642
else if (!strcmp(keyword,"S_IN_DAT")) // datfile filename
1644
strcpy(s_readfilesinput.datfile, word[1]); // pass keyword
1645
writearg(s_readfilesinput.datfile);
1648
// **********************************************************************
1649
else if (!strcmp(keyword,"S_RG_T_ERROR")) // slave timing error
1653
s_readfilesinput.rg_timing_error = strtod( keyword, &pLast );
1654
if ( pLast == keyword ) // fail
1656
ERROR << "S_RG_T_ERROR argument: " << keyword << " is not valid.";
1657
PRINT_ERROR(ERROR.get_str())
1658
throw(keyword_error);
1660
writearg(s_readfilesinput.rg_timing_error);
1663
// **********************************************************************
1664
else if (!strcmp(keyword,"S_AZ_T_ERROR")) // slave timing error
1668
s_readfilesinput.az_timing_error = strtod( keyword, &pLast );
1669
if ( pLast == keyword ) // fail
1671
ERROR << "S_AZ_T_ERROR argument: " << keyword << " is not valid.";
1672
PRINT_ERROR(ERROR.get_str())
1673
throw(keyword_error);
1675
writearg(s_readfilesinput.az_timing_error);
1679
// **********************************************************************
1681
// **********************************************************************
1682
else if (!strcmp(keyword,"M_ORBDIR")) // orbitfile filename
1684
if (specified(porbitsinput.m_orbdir))
1685
WARNING.print("Prior occurence of M_ORBDIR ignored.");
1686
strcpy(porbitsinput.m_orbdir, word[1] ); // pass keyword
1687
writearg(porbitsinput.m_orbdir);
1690
// **********************************************************************
1691
else if (!strcmp(keyword,"M_ORB_INTERVAL") || // time interval in sec
1692
!strcmp(keyword,"S_ORB_INTERVAL"))
1694
keyword = word[1]; // pass keyword
1696
porbitsinput.timeinterval = strtol( keyword, &pLast , BASE10); // int32
1697
if ( pLast == keyword ) // fail
1699
ERROR << "[M|S]_ORB_INTERVAL argument: " << keyword << " is not valid.";
1700
PRINT_ERROR(ERROR.get_str())
1701
throw(keyword_error);
1703
writearg(porbitsinput.timeinterval);
1706
// **********************************************************************
1707
else if (!strcmp(keyword,"M_ORB_EXTRATIME") || // time before 1st line in sec
1708
!strcmp(keyword,"S_ORB_EXTRATIME"))
1710
keyword = word[1]; // pass keyword
1712
porbitsinput.timebefore = strtol( keyword, &pLast , BASE10); // int32
1713
if ( pLast == keyword ) // fail
1715
ERROR << "[M|S]_ORB_EXTRATIME argument: " << keyword << " is not valid.";
1716
PRINT_ERROR(ERROR.get_str())
1717
throw(keyword_error);
1719
writearg(porbitsinput.timebefore);
1722
// **********************************************************************
1723
else if (!strcmp(keyword,"M_ORB_DUMP")) // dump orbit with dt
1725
keyword = word[1]; // pass keyword
1727
porbitsinput.dumpmasterorbit = strtod( keyword, &pLast );
1728
if ( pLast == keyword ) // fail
1730
ERROR << "M_ORB_DUMP argument: " << keyword << " is not valid.";
1731
PRINT_ERROR(ERROR.get_str())
1732
throw(keyword_error);
1734
writearg(porbitsinput.dumpmasterorbit);
1735
INFO.print("dumping master orbit to ascii file: masterorbit.dat");
1738
// **********************************************************************
1739
else if (!strcmp(keyword,"S_ORBDIR")) // orbitfile filename
1741
if (specified(porbitsinput.s_orbdir))
1742
WARNING.print("Prior occurence of S_ORBDIR ignored.");
1743
strcpy(porbitsinput.s_orbdir, word[1] ); // pass keyword
1744
writearg(porbitsinput.s_orbdir);
1747
// **********************************************************************
1748
else if (!strcmp(keyword,"S_ORB_DUMP")) // dump orbit with dt
1750
keyword = word[1]; // pass keyword
1752
porbitsinput.dumpslaveorbit = strtod( keyword, &pLast );
1753
if ( pLast == keyword ) // fail
1755
ERROR << "S_ORB_DUMP argument: " << keyword << " is not valid.";
1756
PRINT_ERROR(ERROR.get_str())
1757
throw(keyword_error);
1759
writearg(porbitsinput.dumpslaveorbit);
1760
INFO.print("dumping slave orbit to ascii file: slaveorbit.dat");
1764
// ____ start added by HB ____
1765
// *******************************************************************
1767
// *******************************************************************
1768
else if (!strncmp(keyword,"M_MO_D",6))
1770
char *keywordpart = &keyword[6];
1772
if (!strncmp(keywordpart,"BH",2)) component = 0;
1773
else if (!strncmp(keywordpart,"BV",2)) component = 1;
1776
ERROR << "Unknown keyword: \"" << keyword << "\" at line: " << linecnt << ".";
1777
PRINT_ERROR(ERROR.get_str()) throw(keyword_error);
1779
int16 degree = int(keywordpart[2])-48; // char2int
1780
morbitsinputmaster.coeff(degree,component) = atof(word[1]);
1781
writearg(morbitsinputmaster.coeff(degree,component));
1784
// *******************************************************************
1785
else if (!strcmp(keyword,"M_MO_REFORBIT"))
1787
strcpy(morbitsinputmaster.reforbitfile, word[1]);
1788
writearg(morbitsinputmaster.reforbitfile);
1791
// *******************************************************************
1792
else if (!strncmp(keyword,"S_MO_D",6))
1794
char *keywordpart = &keyword[6];
1796
if (!strncmp(keywordpart,"BH",2)) component = 0;
1797
else if (!strncmp(keywordpart,"BV",2)) component = 1;
1800
ERROR << "Unknown keyword: \"" << keyword << "\" at line: " << linecnt << ".";
1801
PRINT_ERROR(ERROR.get_str()) throw(keyword_error);
1803
int16 degree = int(keywordpart[2])-48; // char2int
1804
morbitsinputslave.coeff(degree,component) = atof(word[1]);
1805
writearg(morbitsinputslave.coeff(degree,component));
1808
// *******************************************************************
1809
else if (!strcmp(keyword,"S_MO_REFORBIT"))
1811
strcpy(morbitsinputslave.reforbitfile, word[1]);
1812
writearg(morbitsinputslave.reforbitfile);
1814
// ____ end added by HB ____
1817
// *******************************************************************
1819
// *******************************************************************
1820
else if (!strcmp(keyword,"M_CROP_ID")) // identifier of run
1822
strcpy(m_cropinput.idcrop, word[1] ); // pass keyword
1823
writearg(m_cropinput.idcrop);
1826
// ******************************************************************* CROP
1827
else if (!strcmp(keyword,"S_CROP_ID")) // identifier of run
1829
strcpy(s_cropinput.idcrop, word[1] ); // pass keyword
1830
writearg(s_cropinput.idcrop);
1833
// **********************************************************************
1834
else if (!strcmp(keyword,"M_CROP_IN")) // SLC input image filename
1836
strcpy(m_cropinput.filein1, word[1] ); // pass keyword
1837
writearg(m_cropinput.filein1);
1840
// **********************************************************************
1841
else if (!strcmp(keyword,"S_CROP_IN")) // SLC input image filename
1843
strcpy(s_cropinput.filein1, word[1] ); // pass keyword
1844
writearg(s_cropinput.filein1);
1847
// **********************************************************************
1848
else if (!strcmp(keyword,"M_CROP_OUT")) // SLC output image filename
1850
strcpy(m_cropinput.fileout1, word[1] ); // pass keyword
1851
writearg(m_cropinput.fileout1);
1854
// **********************************************************************
1855
else if (!strcmp(keyword,"S_CROP_OUT")) // SLC output image filename
1857
strcpy(s_cropinput.fileout1, word[1] ); // pass keyword
1858
writearg(s_cropinput.fileout1);
1861
// **********************************************************************
1862
else if (!strcmp(keyword,"M_DBOW")) // min. line coord.
1864
m_cropinput.dbow.linelo = atoi(word[1]); // pass keywords
1865
m_cropinput.dbow.linehi = atoi(word[2]);
1866
m_cropinput.dbow.pixlo = atoi(word[3]);
1867
m_cropinput.dbow.pixhi = atoi(word[4]);
1869
writearg(m_cropinput.dbow.linelo);
1870
writearg(m_cropinput.dbow.linehi);
1871
writearg(m_cropinput.dbow.pixlo);
1872
writearg(m_cropinput.dbow.pixhi);
1874
// ______initial check, later checked to #lines of image______
1875
if (m_cropinput.dbow.linelo <= 0 ||
1876
m_cropinput.dbow.pixlo <= 0 ||
1877
m_cropinput.dbow.linelo > m_cropinput.dbow.linehi ||
1878
m_cropinput.dbow.pixlo > m_cropinput.dbow.pixhi)
1880
ERROR << "code 300: Arguments of M_DBOW card on line " << linecnt
1881
<< " missing. [DBOW min_line max_line min_pixel max_pixel].";
1882
PRINT_ERROR(ERROR.get_str())
1883
throw(keyword_error);
1887
// **********************************************************************
1888
else if (!strcmp(keyword,"S_DBOW")) // min. line coord.
1890
s_cropinput.dbow.linelo = atoi(word[1]); // pass keywords
1891
s_cropinput.dbow.linehi = atoi(word[2]);
1892
s_cropinput.dbow.pixlo = atoi(word[3]);
1893
s_cropinput.dbow.pixhi = atoi(word[4]);
1895
writearg(s_cropinput.dbow.linelo);
1896
writearg(s_cropinput.dbow.linehi);
1897
writearg(s_cropinput.dbow.pixlo);
1898
writearg(s_cropinput.dbow.pixhi);
1899
// ______initial check, later checked to #lines of image______
1900
if (s_cropinput.dbow.linelo <= 0 ||
1901
s_cropinput.dbow.pixlo <= 0 ||
1902
s_cropinput.dbow.linelo > s_cropinput.dbow.linehi ||
1903
s_cropinput.dbow.pixlo > s_cropinput.dbow.pixhi)
1905
ERROR << "code 300: Arguments of S_DBOW card on line " << linecnt
1906
<< " missing. [DBOW min_line max_line min_pixel max_pixel].";
1907
PRINT_ERROR(ERROR.get_str())
1908
throw(keyword_error);
1912
// **********************************************************************
1914
else if (!strcmp(keyword,"M_DBOW_GEO")) // 1e6*lat_0 [deg], lon_0, height, width [pix]
1916
// use dbow to store tmp, compute later in crop if not zero
1917
real8 tmp_lat_0, tmp_lon_0, tmp_height, tmp_width;
1918
tmp_lat_0 = atof(word[1]) ; // pass keyword
1919
tmp_lon_0 = atof(word[2]) ; // pass keyword
1920
tmp_height = atof(word[3]) ; // pass keyword
1921
tmp_width = atof(word[4]) ; // pass keyword
1922
writearg(tmp_lat_0);
1923
writearg(tmp_lon_0);
1924
writearg(tmp_height);
1925
writearg(tmp_width);
1926
m_cropinput.dbow_geo.linelo = uint((360.0+tmp_lat_0)*1e6);
1927
m_cropinput.dbow_geo.linehi = uint((360.0+tmp_lon_0)*1e6);
1928
m_cropinput.dbow_geo.pixlo = uint(tmp_height);
1929
m_cropinput.dbow_geo.pixhi = uint(tmp_width);
1932
// **********************************************************************
1934
else if (!strcmp(keyword,"S_DBOW_GEO")) // 1e6*lat_0 [deg], lon_0, height, width [pix]
1936
// use dbow to store tmp, compute later in crop if not zero
1937
real8 tmp_lat_0, tmp_lon_0, tmp_height, tmp_width;
1938
tmp_lat_0 = atof(word[1]) ; // pass keyword
1939
tmp_lon_0 = atof(word[2]) ; // pass keyword
1940
tmp_height = atof(word[3]) ; // pass keyword
1941
tmp_width = atof(word[4]) ; // pass keyword
1942
writearg(tmp_lat_0);
1943
writearg(tmp_lon_0);
1944
writearg(tmp_height);
1945
writearg(tmp_width);
1946
s_cropinput.dbow_geo.linelo = uint((360.0+tmp_lat_0)*1e6);
1947
s_cropinput.dbow_geo.linehi = uint((360.0+tmp_lon_0)*1e6);
1948
s_cropinput.dbow_geo.pixlo = uint(tmp_height);
1949
s_cropinput.dbow_geo.pixhi = uint(tmp_width);
1952
//____RaffaeleNutricato START MODIFICATION SECTION 9
1953
// *******************************************************************
1955
// **********************************************************************
1956
else if (!strcmp(keyword,"M_OVS_OUT")) // oversampled SLC output image filename
1958
strcpy(m_oversample.fileoutovs, word[1] ); // pass keyword
1959
writearg(m_oversample.fileoutovs);
1962
// **********************************************************************
1963
else if (!strcmp(keyword,"S_OVS_OUT")) // oversampled SLC output image filename
1965
strcpy(s_oversample.fileoutovs, word[1] ); // pass keyword
1966
writearg(s_oversample.fileoutovs);
1969
// *******************************************************************
1970
else if (!strcmp(keyword,"M_OVS_FACT_RNG")) // Oversampling ratio in the master range direction.
1972
m_oversample.OsrRange = strtol(word[1],NULL, BASE10); // pass keyword
1973
writearg(m_oversample.OsrRange);
1974
if (m_oversample.OsrRange < 1)
1977
"(M_OVS_FACT_RNG < 1) Oversampling ratio must be at least 1.");
1978
throw(keyword_error);
1982
// **********************************************************************
1983
else if (!strcmp(keyword,"S_OVS_FACT_RNG")) // Oversampling ratio in the slave range direction.
1985
s_oversample.OsrRange = strtol(word[1],NULL, BASE10) ; // pass keyword
1986
writearg(s_oversample.OsrRange);
1987
if (s_oversample.OsrRange < 1)
1990
"(S_OVS_FACT_RNG < 1) Oversampling ratio must be at least 1.");
1991
throw(keyword_error);
1995
// *******************************************************************
1996
else if (!strcmp(keyword,"M_OVS_FACT_AZI")) // Oversampling ratio in the master azimuth direction.
1998
m_oversample.OsrAzimuth = strtol(word[1],NULL, BASE10) ; // pass keyword
1999
writearg(m_oversample.OsrAzimuth);
2000
if (m_oversample.OsrAzimuth < 1)
2003
"(M_OVS_FACT_AZI < 1) Oversampling ratio must be at least 1.");
2004
throw(keyword_error);
2006
if (m_oversample.OsrAzimuth > 2)
2009
"(M_OVS_FACT_AZI > 2) Not implemented!");
2010
throw(keyword_error);
2014
// **********************************************************************
2015
else if (!strcmp(keyword,"S_OVS_FACT_AZI")) // Oversampling ratio in the slave azimuth direction.
2017
s_oversample.OsrAzimuth = strtol(word[1],NULL, BASE10) ; // pass keyword
2018
writearg(s_oversample.OsrAzimuth);
2019
if (s_oversample.OsrAzimuth < 1)
2021
PRINT_ERROR("(S_OVS_FACT_AZI < 1) Oversampling ratio must be at least 1.");
2022
throw(keyword_error);
2024
if (s_oversample.OsrAzimuth > 2)
2027
"(S_OVS_FACT_AZI > 2) Not implemented!");
2028
throw(keyword_error);
2032
// **********************************************************************
2033
else if (!strcmp(keyword,"M_OVS_KERNELSIZE")) // Length of the interpolation kernel.
2035
m_oversample.FilterSize = strtol(word[1],NULL, BASE10) ; // pass keyword
2036
writearg(m_oversample.FilterSize);
2037
if (m_oversample.FilterSize < 2)
2039
PRINT_ERROR("(M_OVS_KERNELSIZE < 2) Interpolation kernel length must be > 1.");
2040
throw(keyword_error);
2042
if (m_oversample.FilterSize % 2)
2044
PRINT_ERROR("(M_OVS_KERNELSIZE not even) Range Interpolation kernel length must be an even number.");
2045
throw(keyword_error);
2049
// **********************************************************************
2050
else if (!strcmp(keyword,"S_OVS_KERNELSIZE")) // Length of the interpolation kernel.
2052
s_oversample.FilterSize = strtol(word[1],NULL, BASE10) ; // pass keyword
2053
writearg(s_oversample.FilterSize);
2054
if (s_oversample.FilterSize < 2)
2056
PRINT_ERROR("code ???: (S_OVS_KERNELSIZE < 2) Interpolation kernel length must be > 1.");
2057
throw(keyword_error);
2059
if (s_oversample.FilterSize % 2)
2062
"code ???: (S_OVS_KERNELSIZE not even) Interpolation kernel length must be an even number.");
2063
throw(keyword_error);
2067
// **********************************************************************
2068
else if (!strcmp(keyword,"M_OVS_OUT_FORMAT")) // Output format [cr4] ci16, I suggest [cr4].
2070
keyword = word[1] ; // pass keyword
2073
if (!strcmp(keyword,"CR4"))
2074
m_oversample.oformatflag = FORMATCR4; // default
2075
else if (!strcmp(keyword,"CI2"))
2076
m_oversample.oformatflag = FORMATCI2;
2079
ERROR << "M_OVS_OUT_FORMAT: output format "
2081
<< " not known for master range oversampling. line "
2083
PRINT_ERROR(ERROR.get_str())
2084
throw(keyword_error);
2088
// **********************************************************************
2089
else if (!strcmp(keyword,"S_OVS_OUT_FORMAT")) // Output format [cr4] ci16, I suggest [cr4].
2091
keyword = word[1] ; // pass keyword
2094
if (!strcmp(keyword,"CR4"))
2095
s_oversample.oformatflag = FORMATCR4; // default
2096
else if (!strcmp(keyword,"CI2"))
2097
s_oversample.oformatflag = FORMATCI2;
2100
ERROR << "S_OVS_OUT_FORMAT: output format "
2102
<< " not known for slave range oversampling. line "
2104
PRINT_ERROR(ERROR.get_str())
2105
throw(keyword_error);
2108
//____RaffaeleNutricato END MODIFICATION SECTION 9
2110
// ____ start added by MA ____
2113
// **********************************************************************
2114
// *** SIMULATE AMPLITUDE FOR MASTER
2115
// **********************************************************************
2117
else if (!strcmp(keyword,"SAM_IN_DEM") &&
2118
( generalinput.process[pr_m_simamp] || onlyprocess == pr_m_simamp ) ) // input file
2119
// [MA] read parm only if there is (ONLY)PROCESS flag
2120
// default onlyprocess is -1
2122
strcpy(simampinput.firefdem, word[1] ); // pass keyword
2123
writearg(simampinput.firefdem);
2126
// **********************************************************************
2127
else if (!strcmp(keyword,"SAM_IN_FORMAT") &&
2128
( generalinput.process[pr_m_simamp] || onlyprocess == pr_m_simamp ) ) // format input file
2130
keyword = word[1] ; // pass keyword
2133
if (!strcmp(keyword,"R4") || !strcmp(keyword,"REAL4"))
2134
simampinput.iformatflag = FORMATR4;
2135
else if (!strcmp(keyword,"I2") || !strcmp(keyword,"SHORT"))
2136
simampinput.iformatflag = FORMATI2; // default
2137
else if (!strcmp(keyword,"I2_BIGENDIAN") ||
2138
!strcmp(keyword,"SHORT_BIGENDIAN"))
2139
simampinput.iformatflag = FORMATI2_BIGENDIAN; // default
2140
else if (!strcmp(keyword,"R8") || !strcmp(keyword,"REAL8"))
2141
simampinput.iformatflag = FORMATR8;
2144
ERROR << "SAM_IN_FORMAT: input format "
2146
<< " not known (R4 R8 I2 (native) SHORT_BIGENDIAN); line "
2148
PRINT_ERROR(ERROR.get_str())
2149
throw(keyword_error);
2153
// **********************************************************************
2154
else if (!strcmp(keyword,"SAM_IN_SIZE") &&
2155
( generalinput.process[pr_m_simamp] || onlyprocess == pr_m_simamp ) ) // nrow ncols (lat lon)
2157
char *pLast1, *pLast2 = NULL;
2158
simampinput.demrows = strtoul(word[1], &pLast1, BASE10);
2159
simampinput.demcols = strtoul(word[2], &pLast2, BASE10);
2160
if ( pLast1 == word[1] || pLast2 == word[2] ) // fails to convert one of them to double.
2162
ERROR << "SAM_IN_SIZE: " << word[1] << " : "
2163
<< word[2] << " are not valid.";
2164
PRINT_ERROR(ERROR.get_str())
2165
throw(keyword_error);
2167
writearg(simampinput.demrows);
2168
writearg(simampinput.demcols);
2171
// **********************************************************************
2172
else if (!strcmp(keyword,"SAM_IN_DELTA") &&
2173
( generalinput.process[pr_m_simamp] || onlyprocess == pr_m_simamp ) ) // degrees delta lat lon
2175
simampinput.demdeltalat = atof(word[1]); // pass keyword
2176
keyword = word[2]; // pass keyword
2177
writearg(simampinput.demdeltalat);
2179
if (isdigit(keyword[0]) || keyword[0]=='.') // likely to be 2 numbers
2180
simampinput.demdeltalon = atof(keyword);
2181
else // default same gridsize
2182
simampinput.demdeltalon = simampinput.demdeltalat;
2184
// ______ Store as radians ______
2185
simampinput.demdeltalat = deg2rad(simampinput.demdeltalat);
2186
simampinput.demdeltalon = deg2rad(simampinput.demdeltalon);
2189
// **********************************************************************
2190
else if (!strcmp(keyword,"SAM_IN_UL") &&
2191
( generalinput.process[pr_m_simamp] || onlyprocess == pr_m_simamp ) ) // upperleft coordinates
2193
char *pLast1, *pLast2 = NULL;
2194
simampinput.demlatleftupper = strtod(word[1], &pLast1);
2195
simampinput.demlonleftupper = strtod(word[2], &pLast2);
2196
if ( pLast1 == word[1] || pLast2 == word[2] ) // fails to convert one of them to double.
2198
ERROR << "SAM_IN_UL: " << word[1] << " : "
2199
<< word[2] << " are not valid.";
2200
PRINT_ERROR(ERROR.get_str())
2201
throw(keyword_error);
2203
writearg(simampinput.demlatleftupper);
2204
writearg(simampinput.demlonleftupper);
2205
simampinput.demlatleftupper = deg2rad(simampinput.demlatleftupper);
2206
simampinput.demlonleftupper = deg2rad(simampinput.demlonleftupper);
2209
// **********************************************************************
2210
else if (!strcmp(keyword,"SAM_IN_NODATA") &&
2211
( generalinput.process[pr_m_simamp] || onlyprocess == pr_m_simamp ) ) // flag for no data
2214
simampinput.demnodata = strtod(word[1], &pLast);
2215
if ( pLast == word[1] ) // fails to convert to double.
2217
ERROR << "SAM_IN_NODATA: " << word[1] << " is not valid.";
2218
PRINT_ERROR(ERROR.get_str())
2219
throw(keyword_error);
2221
writearg(simampinput.demnodata);
2224
// **********************************************************************
2225
else if (!strcmp(keyword,"SAM_OUT_DEM") &&
2226
( generalinput.process[pr_m_simamp] || onlyprocess == pr_m_simamp ) ) // name of output file
2228
strcpy(simampinput.fodem, word[1] ); // pass keyword
2229
writearg(simampinput.fodem);
2232
// **********************************************************************
2233
else if (!strcmp(keyword,"SAM_OUT_FILE") &&
2234
( generalinput.process[pr_m_simamp] || onlyprocess == pr_m_simamp ) ) // name of output file
2236
strcpy(simampinput.fosimamp, word[1] ); // pass keyword
2237
writearg(simampinput.fosimamp);
2240
// // **********************************************************************
2241
// else if (!strcmp(keyword,"SAM_OUT_DEMI")) // name of output file
2243
// strcpy(demassistinput.fodemi, word[1] ); // pass keyword
2244
// writearg(demassistinput.fodemi);
2247
// // **********************************************************************
2248
else if (!strcmp(keyword,"SAM_OUT_DEM_LP") &&
2249
( generalinput.process[pr_m_simamp] || onlyprocess == pr_m_simamp ) ) // name of output file // MA enabled for SPT tracking.
2251
strcpy(simampinput.fodemlp, word[1] ); // pass keyword
2252
writearg(simampinput.fodemlp);
2254
else if (!strcmp(keyword,"SAM_OUT_THETA_LP") &&
2255
( generalinput.process[pr_m_simamp] || onlyprocess == pr_m_simamp ) ) // name of output file // MA enabled for SPT tracking.
2257
strcpy(simampinput.fothetalp, word[1] ); // pass keyword
2258
writearg(simampinput.fothetalp);
2262
// **********************************************************************
2263
// *** MASTER TIMING ERROR ESTIMATION using COREGISTRATION
2264
// **********************************************************************
2265
else if (!strcmp(keyword,"MTE_METHOD")) // method selector simamp coreg
2267
keyword = word[1] ; // pass keyword
2270
if (!strcmp(keyword,"MAGFFT"))
2272
mtiminginput.method=cc_magfft; // default MTE_magfft
2274
else if (!strcmp(keyword,"MAGSPACE"))
2276
mtiminginput.method=cc_magspace; // MTE_magspace
2280
ERROR << "MTE_METHOD: method " << keyword
2281
<< " not known for simamp correlation coregistration on line "
2283
PRINT_ERROR(ERROR.get_str())
2284
throw(keyword_error);
2288
// **********************************************************************
2289
else if (!strcmp(keyword,"MTE_NWIN")) // #windows for simamp correlation
2292
mtiminginput.Nwin = strtoul(word[1], &pLast, BASE10);
2293
if ( pLast == word[1] ) // fails to convert to double.
2295
ERROR << "MTE_NWIN: " << word[1] << " is not valid.";
2296
PRINT_ERROR(ERROR.get_str())
2297
throw(keyword_error);
2299
writearg(mtiminginput.Nwin);
2300
if (mtiminginput.Nwin > 10000)
2302
PRINT_ERROR("Too many windows requested (MTE_NWIN > 10000).")
2303
throw(keyword_error);
2307
// **********************************************************************
2308
else if (!strcmp(keyword,"MTE_IN_POS")) // file with #windows positions
2310
strcpy(mtiminginput.ifpositions, word[1] ); // pass keyword
2311
writearg(mtiminginput.ifpositions);
2314
// **********************************************************************
2315
else if (!strcmp(keyword,"MTE_WINSIZE")) // windowsize for simamp correlation
2317
char *pLast1, *pLast2 = NULL;
2318
mtiminginput.MasksizeL = strtoul(word[1], &pLast1, BASE10);
2319
mtiminginput.MasksizeP = strtoul(word[2], &pLast2, BASE10);
2320
if ( pLast1 == word[1] || pLast2 == word[2] ) // fails to convert one of them to double.
2322
ERROR << "MTE_WINSIZE: " << word[1] << " : "
2323
<< word[2] << " are not valid.";
2324
PRINT_ERROR(ERROR.get_str())
2325
throw(keyword_error);
2327
writearg(mtiminginput.MasksizeL);
2328
writearg(mtiminginput.MasksizeP);
2329
if (mtiminginput.MasksizeL > 4096 || mtiminginput.MasksizeP > 4096)
2331
PRINT_ERROR("Too large correlation window (MTE_WINSIZE > 4096).");
2332
throw(keyword_error);
2336
// **********************************************************************
2337
else if (!strcmp(keyword,"MTE_ACC")) // Searchdomain for correlation
2338
{ // simamp correlation
2339
char *pLast1, *pLast2 = NULL;
2340
mtiminginput.AccL = strtoul(word[1], &pLast1, BASE10);
2341
mtiminginput.AccP = strtoul(word[2], &pLast2, BASE10);
2342
if ( pLast1 == word[1] || pLast2 == word[2] ) // fails to convert one of them to double.
2344
ERROR << "MTE_ACC: " << word[1] << " : "
2345
<< word[2] << " are not valid.";
2346
PRINT_ERROR(ERROR.get_str())
2347
throw(keyword_error);
2349
writearg(mtiminginput.AccL);
2350
writearg(mtiminginput.AccP);
2351
if (mtiminginput.AccL > 1000 || mtiminginput.AccP > 1000)
2353
PRINT_ERROR("Too large searchwindow (MTE_ACC > 1000).");
2354
throw(keyword_error);
2356
if (mtiminginput.AccL == 0 || mtiminginput.AccP == 0)
2358
PRINT_ERROR("Acc = 0 ?(MTE_ACC).");
2359
throw(keyword_error);
2363
// **********************************************************************
2364
else if (!strcmp(keyword,"MTE_INITOFF")) // Initial offset
2366
keyword = word[1] ; // pass keyword
2367
char *keyword2 = word[2] ; // pass keyword
2370
if (isdigit(keyword2[0]) || keyword2[0]=='-') // likely to be 2 numbers
2371
// BK19/1/00 thanks to m.goos for '-'
2373
mtiminginput.initoffsetL = atoi(keyword);
2374
mtiminginput.initoffsetP = atoi(keyword2);
2378
ERROR << "MTE_INITOFF: unknown input: "
2379
<< keyword << ", " << keyword2
2382
PRINT_ERROR(ERROR.get_str())
2383
throw(keyword_error);
2388
// ____ end added by MA ____
2391
// **********************************************************************
2392
// *** AZIMUTH FILTERING
2393
// **********************************************************************
2394
else if (!strcmp(keyword,"AF_BLOCKSIZE"))
2397
filtaziinput.fftlength = strtol(word[1], &pLast, BASE10); // int32
2398
if ( pLast == word[1] ) // fails to convert to double.
2400
ERROR << "AF_BLOCKSIZE: " << word[1] << " is not valid.";
2401
PRINT_ERROR(ERROR.get_str())
2402
throw(keyword_error);
2404
writearg(filtaziinput.fftlength);
2407
// **********************************************************************
2408
else if (!strcmp(keyword,"AF_HAMMING"))
2411
filtaziinput.hammingalpha = strtod(word[1], &pLast);
2412
if ( pLast == word[1] ) // fails to convert to double.
2414
ERROR << "AF_HAMMING: " << word[1] << " is not valid.";
2415
PRINT_ERROR(ERROR.get_str())
2416
throw(keyword_error);
2418
writearg(filtaziinput.hammingalpha);
2421
// **********************************************************************
2422
else if (!strcmp(keyword,"AF_OVERLAP"))
2425
filtaziinput.overlap = strtol(word[1], &pLast, BASE10); // int32
2426
if ( pLast == word[1] ) // fails to convert to double.
2428
ERROR << "AF_OVERLAP: " << word[1] << " is not valid.";
2429
PRINT_ERROR(ERROR.get_str())
2430
throw(keyword_error);
2432
writearg(filtaziinput.overlap);
2435
// **********************************************************************
2436
else if (!strcmp(keyword,"AF_OUT_MASTER"))
2438
strcpy(filtaziinput.fomaster, word[1] ); // pass keyword
2439
writearg(filtaziinput.fomaster);
2442
// **********************************************************************
2443
else if (!strcmp(keyword,"AF_OUT_SLAVE"))
2445
strcpy(filtaziinput.foslave, word[1] ); // pass keyword
2446
writearg(filtaziinput.foslave);
2449
// **********************************************************************
2450
else if (!strcmp(keyword,"AF_OUT_FORMAT")) // output format
2452
keyword = word[1] ; // pass keyword
2455
if (!strcmp(keyword,"CR4"))
2456
filtaziinput.oformatflag = FORMATCR4; // default
2457
else if (!strcmp(keyword,"CI2"))
2458
filtaziinput.oformatflag = FORMATCI2;
2461
ERROR << "AF_OUT_FORMAT: output format "
2463
<< " not known for azimuth filtering. line "
2465
PRINT_ERROR(ERROR.get_str())
2466
throw(keyword_error);
2472
// **********************************************************************
2473
// *** COARSE CORR COREGISTRATION
2474
// **********************************************************************
2475
else if (!strcmp(keyword,"CC_METHOD")) // method selector coarse coreg
2477
keyword = word[1] ; // pass keyword
2480
if (!strcmp(keyword,"MAGFFT"))
2481
coarsecorrinput.method=cc_magfft; // default
2482
else if (!strcmp(keyword,"MAGSPACE"))
2483
coarsecorrinput.method=cc_magspace;
2486
ERROR << "CC_METHOD: method " << keyword
2487
<< " not known for coarse correlation coregistration on line "
2489
PRINT_ERROR(ERROR.get_str())
2490
throw(keyword_error);
2494
// **********************************************************************
2495
else if (!strcmp(keyword,"CC_NWIN")) // #windows for coarse correlation
2497
coarsecorrinput.Nwin = atoi(word[1]) ; // pass keyword
2498
writearg(coarsecorrinput.Nwin);
2499
if (coarsecorrinput.Nwin > 10000)
2501
PRINT_ERROR("Too many windows requested (CC_NWIN > 10000).")
2502
throw(keyword_error);
2506
// **********************************************************************
2507
else if (!strcmp(keyword,"CC_IN_POS")) // file with #windows positions
2509
strcpy(coarsecorrinput.ifpositions, word[1] ); // pass keyword
2510
writearg(coarsecorrinput.ifpositions);
2513
// **********************************************************************
2514
else if (!strcmp(keyword,"CC_WINSIZE")) // windowsize for coarse correlation
2516
coarsecorrinput.MasksizeL = atoi(word[1]) ; // pass keyword
2517
coarsecorrinput.MasksizeP = atoi(word[2]) ; // pass keyword
2518
writearg(coarsecorrinput.MasksizeL);
2519
writearg(coarsecorrinput.MasksizeP);
2520
if (coarsecorrinput.MasksizeL > 10240 || coarsecorrinput.MasksizeP > 4096) // [TODO] move MAX constant values to constant.hh
2522
PRINT_ERROR("Too large correlation window (CC_WINSIZE(l,p) > [10240,4096] ).");
2523
throw(keyword_error);
2527
// **********************************************************************
2528
else if (!strcmp(keyword,"CC_ACC")) // Searchdomain for correlation
2529
{ // coarse correlation
2530
coarsecorrinput.AccL = atoi(word[1]) ; // pass keyword
2531
coarsecorrinput.AccP = atoi(word[2]) ; // pass keyword
2532
writearg(coarsecorrinput.AccL);
2533
writearg(coarsecorrinput.AccP);
2534
if (coarsecorrinput.AccL > 1000 || coarsecorrinput.AccP > 1000)
2536
PRINT_ERROR("Too large searchwindow (CC_ACC > 1000).");
2537
throw(keyword_error);
2539
if (coarsecorrinput.AccL == 0 || coarsecorrinput.AccP == 0)
2541
PRINT_ERROR("Acc = 0 ?(CC_ACC).");
2542
throw(keyword_error);
2546
// **********************************************************************
2547
else if (!strcmp(keyword,"CC_INITOFF")) // Initial offset
2549
keyword = word[1] ; // pass keyword
2550
char *keyword2 = word[2] ; // pass keyword
2553
if (!strcmp(keyword,"ORBIT") || // use value of precise orbits
2554
!strcmp(keyword,"orbit"))
2556
coarsecorrinput.initoffsetL = NaN; // flag used in main, see processor.cc
2557
coarsecorrinput.initoffsetP = NaN; // flag used in main
2558
INFO << "CC_INITOFF: \tInitial offsets from COARSEORB: " << generalinput.i_resfile;
2561
else if (isdigit(keyword2[0]) || keyword2[0]=='-') // likely to be 2 numbers
2562
// BK19/1/00 thanks to m.goos for '-'
2564
//coarsecorrinput.initoffsetL = atof(keyword);
2565
//coarsecorrinput.initoffsetP = atof(keyword2);
2566
coarsecorrinput.initoffsetL = atoi(keyword);
2567
coarsecorrinput.initoffsetP = atoi(keyword2);
2571
ERROR << "CC_INITOFF: unknown input: "
2572
<< keyword << ", " << keyword2
2575
PRINT_ERROR(ERROR.get_str())
2576
throw(keyword_error);
2580
// **********************************************************************
2581
// *** FINE COREGISTRATION
2582
// **********************************************************************
2583
else if (!strcmp(keyword,"FC_NWIN")) // #windows for fine correlation
2585
fineinput.Nwin = atoi(word[1]) ; // pass keyword
2586
writearg(fineinput.Nwin);
2587
if (fineinput.Nwin > 100000) // [MA] change this to a higher value for SPT
2589
PRINT_ERROR("Too many windows requested (FC_NWIN).")
2590
throw(keyword_error);
2594
// **********************************************************************
2595
else if (!strcmp(keyword,"FC_IN_POS")) // file with #windows positions
2597
strcpy(fineinput.ifpositions, word[1] ); // pass keyword
2598
writearg(fineinput.ifpositions);
2601
// **********************************************************************
2602
else if (!strcmp(keyword,"FC_WINSIZE")) // windowsize for fine correlation
2604
fineinput.MasksizeL = atoi(word[1]) ; // pass keyword
2605
fineinput.MasksizeP = atoi(word[2]) ; // pass keyword
2606
writearg(fineinput.MasksizeL);
2607
writearg(fineinput.MasksizeP);
2608
if (fineinput.MasksizeL > 1024 || fineinput.MasksizeP > 1024)
2610
PRINT_ERROR("Too large correlation window (FC_WINSIZE).")
2611
throw(keyword_error);
2615
// **********************************************************************
2616
else if (!strcmp(keyword,"FC_ACC")) // Searchdomain for correlation
2617
{ // fine correlation
2618
fineinput.AccL = atoi(word[1]); // pass keyword
2619
fineinput.AccP = atoi(word[2]); // pass keyword
2620
writearg(fineinput.AccL);
2621
writearg(fineinput.AccP);
2622
if (fineinput.AccL > 1000 || fineinput.AccP > 1000)
2624
PRINT_ERROR("Too large searchwindow (FC_ACC).")
2625
throw(keyword_error);
2627
if (fineinput.AccL == 0 || fineinput.AccP == 0)
2629
PRINT_ERROR("Acc = 0 ?(FC_ACC).")
2630
throw(keyword_error);
2634
// **********************************************************************
2635
else if (!strcmp(keyword,"FC_INITOFF")) // Initial offset
2637
keyword = word[1] ; // pass keyword
2638
char *keyword2 = word[2] ; // pass keyword
2641
if (!strcmp(keyword,"COARSECORR")
2642
|| !strcmp(keyword,"coarsecorr")) // use value of coarse correlation
2644
fineinput.initoffsetL = NaN; // flag used in main
2645
fineinput.initoffsetP = NaN; // flag used in main
2646
INFO << "FC_INITOFF: \tInitial offset from COARSECORR: "
2647
<< generalinput.i_resfile;
2650
else if (isdigit(keyword2[0]) || keyword2[0]=='-') // likely to be 2 numbers
2651
// BK19/1/00 thanks to M.Goos for '-'
2653
fineinput.initoffsetL = atoi(keyword);
2654
fineinput.initoffsetP = atoi(keyword2);
2658
ERROR << "FC_INITOFF: unknown input: "
2659
<< keyword << ", " << keyword2
2662
PRINT_ERROR(ERROR.get_str())
2663
throw(keyword_error);
2667
// **********************************************************************
2668
else if (!strcmp(keyword,"FC_METHOD")) // method selector fine coreg
2670
keyword = word[1] ; // pass keyword
2673
if (!strcmp(keyword,"CMPLXFFT"))
2675
//fineinput.method=fc_cmplxfft; // default
2676
PRINT_ERROR("CMPLXFFT not implemented in v1.0 of Doris.")
2677
throw(keyword_error);
2679
else if (!strcmp(keyword,"CMPLXSPACE"))
2681
//fineinput.method=fc_cmplxspace;
2682
PRINT_ERROR("CMPLXSPACE not implemented in v1.0 of Doris.")
2683
throw(keyword_error);
2685
else if (!strcmp(keyword,"MAGFFT"))
2686
fineinput.method=fc_magfft;
2687
else if (!strcmp(keyword,"MAGSPACE"))
2688
fineinput.method=fc_magspace;
2689
else if (!strcmp(keyword,"OVERSAMPLE"))
2690
fineinput.method=fc_oversample;
2693
ERROR << "FC_METHOD: method " << keyword
2694
<< " not known for fine coregistration on line "
2696
PRINT_ERROR(ERROR.get_str())
2697
throw(keyword_error);
2701
// **********************************************************************
2702
else if (!strcmp(keyword,"FC_OSFACTOR")) // oversampling factor
2704
fineinput.osfactor = atoi(word[1]) ; // pass keyword
2705
writearg(fineinput.osfactor);
2708
// **********************************************************************
2709
else if (!strcmp(keyword,"FC_PLOT")) // plotting results
2711
fineinput.plotoffsets = true;
2712
fineinput.plotthreshold = atof(word[1]) ; // pass keyword
2713
keyword = word[2] ; // pass keyword
2714
writearg(fineinput.plotthreshold);
2717
if (!strcmp(keyword,"BG"))
2718
fineinput.plotmagbg = true;
2719
else if (!strcmp(keyword,"NOBG"))
2720
fineinput.plotmagbg = false;
2721
else if (!strcmp(keyword,"ON")) // actually not allowed...
2722
fineinput.plotoffsets = true;
2723
else if (!strcmp(keyword,"OFF")) // actually not allowed...
2724
fineinput.plotoffsets = false;
2726
WARNING.print("FC_PLOT: missing argument(s). (default: 0.4 NOBG)");
2729
// ____ start added by FvL ____
2731
// **********************************************************************
2732
// *** RELATIVE TIMING ERROR
2733
// **********************************************************************
2735
else if (!strcmp(keyword,"RTE_THRESHOLD")) // treshhold value
2737
reltiminginput.threshold = atof(word[1]) ; // pass keyword
2738
writearg(reltiminginput.threshold);
2739
if (reltiminginput.threshold > 1)
2741
PRINT_ERROR("RTE_THRESHOLD: threshold > 1.")
2742
throw(keyword_error);
2746
// **********************************************************************
2747
else if (!strcmp(keyword,"RTE_MAXITER")) // max number of offsets to reject
2749
reltiminginput.maxiter = atoi(word[1]) ; // pass keyword
2750
writearg(reltiminginput.maxiter);
2751
if (reltiminginput.maxiter < 0)
2753
WARNING.print("RTE_MAXITER: max. number of points to remove < 0? (using 0)");
2754
reltiminginput.maxiter = 0;
2758
// **********************************************************************
2759
else if (!strcmp(keyword,"RTE_K_ALPHA")) // critical value for outlier removal
2761
reltiminginput.k_alpha = atof(word[1]) ; // pass keyword
2762
writearg(reltiminginput.k_alpha);
2763
if (reltiminginput.k_alpha < 0)
2765
WARNING.print("RTE_K_ALPHA: critical value < 0.0?");
2766
reltiminginput.k_alpha = 1.97;
2771
// **********************************************************************
2772
// *** DEM ASSISTED COREGISTRATION
2773
// **********************************************************************
2775
else if (!strcmp(keyword,"DAC_IN_DEM")) // input file
2777
strcpy(demassistinput.firefdem, word[1] ); // pass keyword
2778
writearg(demassistinput.firefdem);
2781
// **********************************************************************
2782
else if (!strcmp(keyword,"DAC_IN_FORMAT")) // format input file
2784
keyword = word[1]; // pass keyword
2787
if (!strcmp(keyword,"R4") || !strcmp(keyword,"REAL4"))
2788
demassistinput.iformatflag = FORMATR4;
2789
else if (!strcmp(keyword,"I2") || !strcmp(keyword,"SHORT"))
2790
demassistinput.iformatflag = FORMATI2; // default
2791
else if (!strcmp(keyword,"I2_BIGENDIAN") ||
2792
!strcmp(keyword,"SHORT_BIGENDIAN"))
2793
demassistinput.iformatflag = FORMATI2_BIGENDIAN; // default
2794
else if (!strcmp(keyword,"R8") || !strcmp(keyword,"REAL8"))
2795
demassistinput.iformatflag = FORMATR8;
2798
ERROR << "DAC_IN_FORMAT: input format "
2800
<< " not known (R4 R8 I2 (native) SHORT_BIGENDIAN); line "
2802
PRINT_ERROR(ERROR.get_str())
2803
throw(keyword_error);
2807
// **********************************************************************
2808
else if (!strcmp(keyword,"DAC_IN_SIZE")) // nrow ncols (lat lon)
2810
char *pLast1, *pLast2 = NULL;
2811
demassistinput.demrows = strtoul(word[1], &pLast1, BASE10);
2812
demassistinput.demcols = strtoul(word[2], &pLast2, BASE10);
2813
if ( pLast1 == word[1] || pLast2 == word[2] ) // fails to convert one of them to double.
2815
ERROR << "DAC_IN_SIZE: " << word[1] << " : "
2816
<< word[2] << " are not valid.";
2817
PRINT_ERROR(ERROR.get_str())
2818
throw(keyword_error);
2820
writearg(demassistinput.demrows);
2821
writearg(demassistinput.demcols);
2824
// **********************************************************************
2825
else if (!strcmp(keyword,"DAC_IN_DELTA")) // degrees delta lat lon
2827
demassistinput.demdeltalat = atof(word[1]) ; // pass keyword
2828
keyword = word[2] ; // update keyword
2829
writearg(demassistinput.demdeltalat);
2830
writearg(keyword); // lon
2831
if (isdigit(keyword[0]) || keyword[0]=='.') // likely to be 2 numbers
2832
demassistinput.demdeltalon = atof(keyword);
2833
else // default same gridsize
2834
demassistinput.demdeltalon = demassistinput.demdeltalat;
2836
// ______ Store as radians ______
2837
demassistinput.demdeltalat = deg2rad(demassistinput.demdeltalat);
2838
demassistinput.demdeltalon = deg2rad(demassistinput.demdeltalon);
2841
// **********************************************************************
2842
else if (!strcmp(keyword,"DAC_IN_UL")) // upperleft coordinates
2844
char *pLast1, *pLast2 = NULL;
2845
demassistinput.demlatleftupper = strtod(word[1], &pLast1);
2846
demassistinput.demlonleftupper = strtod(word[2], &pLast2);
2847
if ( pLast1 == word[1] || pLast2 == word[2] ) // fails to convert
2849
ERROR << "DAC_IN_UL: " << word[1] << " : "
2850
<< word[2] << " are not valid.";
2851
PRINT_ERROR(ERROR.get_str())
2852
throw(keyword_error);
2855
writearg(demassistinput.demlatleftupper);
2856
writearg(demassistinput.demlonleftupper);
2857
demassistinput.demlatleftupper = deg2rad(demassistinput.demlatleftupper);
2858
demassistinput.demlonleftupper = deg2rad(demassistinput.demlonleftupper);
2861
// **********************************************************************
2862
else if (!strcmp(keyword,"DAC_IN_NODATA")) // flag for no data
2864
demassistinput.demnodata = atof(word[1]) ; // pass keyword
2865
writearg(demassistinput.demnodata);
2868
// **********************************************************************
2869
else if (!strcmp(keyword,"DAC_OUT_DEM")) // name of output file
2871
strcpy(demassistinput.fodem, word[1] ); // pass keyword
2872
writearg(demassistinput.fodem);
2875
// **********************************************************************
2876
else if (!strcmp(keyword,"DAC_OUT_DEMI")) // name of output file
2878
strcpy(demassistinput.fodemi, word[1] ); // pass keyword
2879
writearg(demassistinput.fodemi);
2882
// **********************************************************************
2883
else if (!strcmp(keyword,"DAC_OUT_DEM_LP")) // name of output file
2885
strcpy(demassistinput.forefdemhei, word[1] ); // pass keyword
2886
writearg(demassistinput.forefdemhei);
2889
// ____ end added by FvL ____
2892
// **********************************************************************
2893
// *** COMPUTATION OF COREGISTRATION PARAMETERS
2894
// **********************************************************************
2895
else if (!strcmp(keyword,"CPM_THRESHOLD")) // treshhold value
2897
coregpminput.threshold = atof(word[1]) ; // pass keyword
2898
writearg(coregpminput.threshold);
2899
if (coregpminput.threshold > 1)
2901
PRINT_ERROR("CPM_THRESHOLD: threshold > 1.")
2902
throw(keyword_error);
2906
// **********************************************************************
2907
else if (!strcmp(keyword,"CPM_DEGREE")) // degree of polynomial
2909
coregpminput.degree = atoi(word[1]) ; // pass keyword
2910
writearg(coregpminput.degree);
2911
if (coregpminput.degree > 4)
2912
WARNING.print("CPM_DEGREE: degree > 4 dangerous at edges?");
2915
// **********************************************************************
2916
else if (!strcmp(keyword,"CPM_WEIGHT")) // weightmatrix
2918
keyword = word[1] ; // pass keyword
2921
if (!strcmp(keyword,"NONE"))
2922
coregpminput.weightflag = 0; // default
2923
else if (!strcmp(keyword,"LINEAR"))
2924
coregpminput.weightflag = 1;
2925
else if (!strcmp(keyword,"QUADRATIC"))
2926
coregpminput.weightflag = 2;
2927
else if (!strcmp(keyword,"BAMLER"))
2928
coregpminput.weightflag = 3;
2931
ERROR << "CPM_WEIGHT: data weighting option: "
2933
<< " not known for computation of coregistration parameters on line "
2935
PRINT_ERROR(ERROR.get_str())
2936
throw(keyword_error);
2940
// **********************************************************************
2941
else if (!strcmp(keyword,"CPM_MAXITER")) // max number of offsets to reject
2943
coregpminput.maxiter = atoi(word[1]) ; // pass keyword
2944
writearg(coregpminput.maxiter);
2945
if (coregpminput.maxiter < 0)
2947
WARNING.print("CPM_MAXITER: max. number of points to remove < 0? (using 0)");
2948
coregpminput.maxiter = 0;
2952
// **********************************************************************
2953
else if (!strcmp(keyword,"CPM_K_ALPHA")) // critical value for outlier removal
2955
coregpminput.k_alpha = atof(word[1]) ; // pass keyword
2956
writearg(coregpminput.k_alpha);
2957
if (coregpminput.k_alpha < 0)
2959
WARNING.print("CPM_K_ALPHA: critical value < 0.0?");
2960
coregpminput.k_alpha = 1.97;
2964
// **********************************************************************
2965
else if (!strcmp(keyword,"CPM_DUMP")) // boolean
2967
keyword = word[1] ; // pass keyword
2970
if (!strcmp(keyword,"OFF"))
2971
coregpminput.dumpmodel = false;
2972
else if (!strcmp(keyword,"ON") ||
2973
!strncmp(keyword,"//",2) || // comment
2974
!strncmp(keyword,"#",1) || // comment
2975
!(keyword[0] == '\0')) // no keyword
2976
coregpminput.dumpmodel = true;
2979
WARNING << "CPM_DUMP: line " << linecnt
2980
<< ": argument: " << keyword
2981
<< " not recognized, no dumping to files.";
2986
// **********************************************************************
2987
else if (!strcmp(keyword,"CPM_PLOT")) // plotting results
2989
coregpminput.plot = true;
2990
keyword = word[1] ; // pass keyword
2993
if (!strcmp(keyword,"BG"))
2994
coregpminput.plotmagbg = true;
2995
else if (!strcmp(keyword,"NOBG"))
2996
coregpminput.plotmagbg = false;
2997
else if (!strcmp(keyword,"ON")) // actually not allowed...
2998
coregpminput.plot = true;
2999
else if (!strcmp(keyword,"OFF")) // actually not allowed...
3000
coregpminput.plot = false;
3002
WARNING.print("CPM_PLOT: missing argument. (default NOBG magnitude background)");
3006
// **********************************************************************
3007
// *** RANGE FILTERING
3008
// **********************************************************************
3009
else if (!strcmp(keyword,"RF_METHOD")) // method range filtering
3011
keyword = word[1] ; // pass keyword
3014
if (!strcmp(keyword,"ADAPTIVE"))
3015
filtrangeinput.method = rf_adaptive;
3016
else if (!strcmp(keyword,"PORBITS"))
3017
filtrangeinput.method = rf_porbits;
3020
ERROR << "RF_METHOD: method "
3022
<< " not known for range filtering. line "
3024
PRINT_ERROR(ERROR.get_str())
3025
throw(keyword_error);
3029
// **********************************************************************
3030
else if (!strcmp(keyword,"RF_SLOPE")) // terrain method porbits
3032
filtrangeinput.terrainslope = atof(word[1]) ; // pass keyword
3033
writearg(filtrangeinput.terrainslope);
3034
deg2rad(filtrangeinput.terrainslope);
3037
// **********************************************************************
3038
else if (!strcmp(keyword,"RF_THRESHOLD")) // threshhold value
3040
filtrangeinput.SNRthreshold = atof(word[1]) ; // pass keyword
3041
writearg(filtrangeinput.SNRthreshold);
3044
// **********************************************************************
3045
else if (!strcmp(keyword,"RF_HAMMING")) // alpha
3047
filtrangeinput.hammingalpha = atof(word[1]) ; // pass keyword
3048
writearg(filtrangeinput.hammingalpha);
3051
// **********************************************************************
3052
else if (!strcmp(keyword,"RF_WEIGHTCORR")) // boolean
3054
keyword = word[1] ; // pass keyword
3057
if (!strcmp(keyword,"OFF"))
3058
filtrangeinput.doweightcorrel = false;
3059
else if (!strcmp(keyword,"ON") ||
3060
!strncmp(keyword,"//",2) || // comment
3061
!strncmp(keyword,"#",1) || // comment
3062
!(keyword[0] == '\0')) // no keyword
3063
filtrangeinput.doweightcorrel = true;
3066
filtrangeinput.doweightcorrel = false; // default already...
3067
WARNING << "RF_WEIGHTCORREL: line " << linecnt
3068
<< ": argument: " << keyword
3069
<< " not recognized, weighting correlation set to OFF.";
3074
// **********************************************************************
3075
else if (!strcmp(keyword,"RF_OVERSAMPLE")) // int
3077
filtrangeinput.oversample = atoi(word[1]) ; // pass keyword
3078
writearg(filtrangeinput.oversample);
3081
// **********************************************************************
3082
else if (!strcmp(keyword,"RF_NLMEAN")) // take mean over nlmean lines
3084
filtrangeinput.nlmean = atoi(word[1]) ; // pass keyword
3085
if (!isodd(filtrangeinput.nlmean)) // check if ODD value [MA]
3087
PRINT_ERROR("RF_NLMEAN value has to be odd.")
3088
throw(argument_error);
3090
writearg(filtrangeinput.nlmean);
3093
// **********************************************************************
3094
else if (!strcmp(keyword,"RF_FFTLENGTH")) // adaptive length
3096
filtrangeinput.fftlength = atoi(word[1]) ; // pass keyword
3097
writearg(filtrangeinput.fftlength);
3100
// **********************************************************************
3101
else if (!strcmp(keyword,"RF_OVERLAP")) // overlap blocks
3103
filtrangeinput.overlap = atoi(word[1]) ; // pass keyword
3104
writearg(filtrangeinput.overlap);
3107
// **********************************************************************
3108
else if (!strcmp(keyword,"RF_OUT_MASTER")) // filename
3110
strcpy(filtrangeinput.fomaster, word[1] ); // pass keyword
3111
writearg(filtrangeinput.fomaster);
3114
// **********************************************************************
3115
else if (!strcmp(keyword,"RF_OUT_SLAVE")) // filename
3117
strcpy(filtrangeinput.foslave, word[1] ); // pass keyword
3118
writearg(filtrangeinput.foslave);
3121
// **********************************************************************
3122
else if (!strcmp(keyword,"RF_OUT_FORMAT")) // output format
3124
keyword = word[1] ; // pass keyword
3127
if (!strcmp(keyword,"CR4"))
3128
filtrangeinput.oformatflag = FORMATCR4; // default
3129
else if (!strcmp(keyword,"CI2"))
3130
filtrangeinput.oformatflag = FORMATCI2;
3133
ERROR << "RF_OUT_FORMAT: output format "
3135
<< " not known for range filtering. line "
3137
PRINT_ERROR(ERROR.get_str())
3138
throw(keyword_error);
3143
// **********************************************************************
3144
// *** FLAT EARTH CORRECTION == compute reference phase since Feb-2000
3145
// **********************************************************************
3146
else if (!strcmp(keyword,"FE_METHOD")) // method selector flatearth
3148
keyword = word[1] ; // pass keyword
3151
if (!strcmp(keyword,"PORBITS"))
3152
comprefphainput.method=fe_porbits;
3153
else if (!strcmp(keyword,"METHOD2"))
3154
comprefphainput.method=fe_method2;
3157
ERROR << "FE_METHOD: argument: " << keyword << " not recognized.";
3158
PRINT_ERROR(ERROR.get_str())
3159
throw(keyword_error);
3163
// **********************************************************************
3164
else if (!strcmp(keyword,"FE_DEGREE")) // degree for flat earth correction
3166
comprefphainput.degree = atoi(word[1]) ; // pass keyword
3167
writearg(comprefphainput.degree);
3170
// **********************************************************************
3171
else if (!strcmp(keyword,"FE_NPOINTS")) // number of points used
3172
{ // for estimation of polynomial
3173
comprefphainput.Npoints = atoi(word[1]) ; // pass keyword // flat earth correction.
3174
writearg(comprefphainput.Npoints);
3177
// **********************************************************************
3178
else if (!strcmp(keyword,"FE_IN_POS")) // file with #windows positions
3180
strcpy(comprefphainput.ifpositions, word[1] ); // pass keyword
3181
writearg(comprefphainput.ifpositions);
3185
// **********************************************************************
3186
// *** RESAMPLING (SLAVE)
3187
// **********************************************************************
3188
else if (!strcmp(keyword,"RS_METHOD")) // method selector resampling
3190
keyword = word[1] ; // pass keyword
3193
if (!strcmp(keyword,"CC4P"))
3194
resampleinput.method = rs_cc4p; // default
3195
else if (!strcmp(keyword,"CC6P"))
3196
resampleinput.method = rs_cc6p;
3197
else if (!strcmp(keyword,"TS6P"))
3198
resampleinput.method = rs_ts6p;
3199
else if (!strcmp(keyword,"TS8P"))
3200
resampleinput.method = rs_ts8p;
3201
else if (!strcmp(keyword,"TS16P"))
3202
resampleinput.method = rs_ts16p;
3203
else if (!strcmp(keyword,"KNAB4P"))
3204
resampleinput.method = rs_knab4p;
3205
else if (!strcmp(keyword,"KNAB6P"))
3206
resampleinput.method = rs_knab6p;
3207
else if (!strcmp(keyword,"KNAB8P"))
3208
resampleinput.method = rs_knab8p;
3209
else if (!strcmp(keyword,"KNAB10P"))
3210
resampleinput.method = rs_knab10p;
3211
else if (!strcmp(keyword,"KNAB16P"))
3212
resampleinput.method = rs_knab16p;
3213
else if (!strcmp(keyword,"RC6P"))
3214
resampleinput.method = rs_rc6p;
3215
else if (!strcmp(keyword,"RC12P"))
3216
resampleinput.method = rs_rc12p;
3217
else if (!strcmp(keyword,"RECT"))
3218
resampleinput.method = rs_rect;
3219
else if (!strcmp(keyword,"TRI"))
3220
resampleinput.method = rs_tri;
3223
ERROR << "RS_METHOD: method "
3225
<< " not known for resampling. line "
3227
PRINT_ERROR(ERROR.get_str())
3228
throw(keyword_error);
3232
// **********************************************************************
3233
else if (!strcmp(keyword,"RS_DBOW")) // database output window
3235
resampleinput.dbow.linelo = atoi(word[1]);
3236
resampleinput.dbow.linehi = atoi(word[2]);
3237
resampleinput.dbow.pixlo = atoi(word[3]);
3238
resampleinput.dbow.pixhi = atoi(word[4]);
3239
writearg(resampleinput.dbow.linelo);
3240
writearg(resampleinput.dbow.linehi);
3241
writearg(resampleinput.dbow.pixlo);
3242
writearg(resampleinput.dbow.pixhi);
3243
if (resampleinput.dbow.linelo <= 0 ||
3244
resampleinput.dbow.pixlo <= 0 ||
3245
resampleinput.dbow.linelo > resampleinput.dbow.linehi ||
3246
resampleinput.dbow.pixlo > resampleinput.dbow.pixhi)
3248
ERROR << "code 300: Arguments of RS_DBOW card on line " << linecnt
3249
<< " missing. [RS_DBOW min_line max_line min_pixel max_pixel].";
3250
PRINT_ERROR(ERROR.get_str())
3251
throw(keyword_error);
3255
// **********************************************************************
3256
else if (!strcmp(keyword,"RS_DBOW_GEO")) // database output
3257
// window on GEO.LOCATION
3259
// use dbow to store temp, compute later
3262
real8 tmp_height; // total height, not half.window
3263
real8 tmp_width; // total width, not half.windo
3265
char *pLast1, *pLast2, *pLast3, *pLast4 = NULL;
3266
tmp_lat_0 = strtod(word[1], &pLast1);
3267
tmp_lon_0 = strtod(word[2], &pLast2);
3268
tmp_height = strtod(word[3], &pLast2);
3269
tmp_width = strtod(word[4], &pLast2);
3270
if ( pLast1 == word[1] || pLast2 == word[2] ||
3271
pLast3 == word[3] || pLast4 == word[4] ) // fails to convert one of them to double.
3273
ERROR << "RS_DBOW_GEO: " << word[1] << " : "
3274
<< word[2] << " : " << word[3] << " : " << word[4] << " are not valid.";
3275
PRINT_ERROR(ERROR.get_str())
3276
throw(keyword_error);
3278
writearg(tmp_lat_0);
3279
writearg(tmp_lon_0);
3280
writearg(tmp_height);
3281
writearg(tmp_width);
3283
resampleinput.dbow_geo.linelo = uint((360.0+tmp_lat_0)*1e6);
3284
resampleinput.dbow_geo.linehi = uint((360.0+tmp_lon_0)*1e6);
3285
resampleinput.dbow_geo.pixlo = uint(tmp_height);
3286
resampleinput.dbow_geo.pixhi = uint(tmp_width);
3290
// **********************************************************************
3291
else if (!strcmp(keyword,"RS_OUT_FILE")) // name of output file
3293
switch (priorrs_fileout)
3296
WARNING << "RS_OUT_FILE: line: " << linecnt << ": "
3297
<< "ignored due to prior occurence.";
3301
priorrs_fileout = true;
3302
strcpy(resampleinput.fileout, word[1] ); // pass keyword (filename)
3303
writearg(resampleinput.fileout);
3307
// **********************************************************************
3308
else if (!strcmp(keyword,"RS_OUT_FORMAT")) // output format
3310
keyword = word[1] ; // pass keyword
3313
if (!strcmp(keyword,"CR4"))
3314
resampleinput.oformatflag = FORMATCR4; // default
3315
else if (!strcmp(keyword,"CI2"))
3316
resampleinput.oformatflag = FORMATCI2;
3319
ERROR << "RS_OUT_FORMAT: output format "
3321
<< " not known for resampling. line "
3323
PRINT_ERROR(ERROR.get_str())
3324
throw(keyword_error);
3328
// **********************************************************************
3329
else if (!strcmp(keyword,"RS_SHIFTAZI")) // true: shift before rs.
3331
keyword = word[1] ; // pass keyword
3334
if (!strcmp(keyword,"ON"))
3335
resampleinput.shiftazi = true;
3336
else if (!strcmp(keyword,"OFF") ||
3337
!strncmp(keyword,"//",2) || // comment
3338
!strncmp(keyword,"#",1) || // comment
3339
!(keyword[0] == '\0')) // no keyword
3340
resampleinput.shiftazi = false;
3343
resampleinput.shiftazi = true;
3344
WARNING << "RS_SHIFTAZI: line: " << linecnt << ": unknown argument: "
3345
<< keyword << "; Set to ON (do shift azimuth spectrum).";
3351
// **********************************************************************
3352
// *** COMPUTATION OF INTERFEROGRAM
3353
// **********************************************************************
3354
else if (!strcmp(keyword,"INT_METHOD")) // method selector interfero
3356
keyword = word[1] ; // pass keyword
3359
if (!strcmp(keyword,"OLD"))
3360
interferoinput.method = int_oldmethod;
3361
else if (!strcmp(keyword,"OVERSAMPLE"))
3362
interferoinput.method = int_oversample;
3365
ERROR << "INT_METHOD: method "
3367
<< " not known for interfero. line "
3369
PRINT_ERROR(ERROR.get_str())
3370
throw(keyword_error);
3374
// **********************************************************************
3375
else if (!strcmp(keyword,"INT_OUT_INT")) // name of output file
3377
strcpy(interferoinput.foint, word[1] ); // pass keyword
3378
writearg(interferoinput.foint);
3381
// **********************************************************************
3382
else if (!strcmp(keyword,"INT_OUT_CINT")) // name of output file
3384
strcpy(interferoinput.focint, word[1] ); // pass keyword
3385
writearg(interferoinput.focint);
3388
// **********************************************************************
3389
// else if (!strcmp(keyword,"INT_OUT_FE")) // name of output file
3390
// interferoinput.foflatearth = word[1] ; // pass keyword
3392
// **********************************************************************
3393
else if (!strcmp(keyword,"INT_MULTILOOK")) // multilookfactors
3395
interferoinput.multilookL = atoi(word[1]); // pass keyword
3396
interferoinput.multilookP = atoi(word[2]); // pass keyword
3397
writearg(interferoinput.multilookL);
3398
writearg(interferoinput.multilookP);
3401
// **********************************************************************
3402
// *** COMPUTATION OF COHERENCE
3403
// **********************************************************************
3404
else if (!strcmp(keyword,"COH_METHOD")) // method selector coherence
3406
keyword = word[1] ; // pass keyword
3409
if (!strcmp(keyword,"REFPHASE_ONLY")) // OLD
3410
coherenceinput.method = coh_oldmethod;
3411
else if (!strcmp(keyword,"INCLUDE_REFDEM")) // NEW
3412
coherenceinput.method = coh_newmethod;
3415
ERROR << "COH_METHOD: method "
3417
<< " not known for coherence. line "
3419
PRINT_ERROR(ERROR.get_str())
3420
throw(keyword_error);
3424
// **********************************************************************
3425
else if (!strcmp(keyword,"COH_OUT_COH")) // name of output file
3427
strcpy(coherenceinput.focoh, word[1] ); // pass keyword
3428
writearg(coherenceinput.focoh);
3431
// **********************************************************************
3432
else if (!strcmp(keyword,"COH_OUT_CCOH")) // name of output file
3434
strcpy(coherenceinput.foccoh, word[1] ); // pass keyword
3435
writearg(coherenceinput.foccoh);
3438
// **********************************************************************
3439
else if (!strcmp(keyword,"COH_MULTILOOK")) // multilookfactors
3441
coherenceinput.multilookL = atoi(word[1]); // pass keyword
3442
coherenceinput.multilookP = atoi(word[2]); // pass keyword
3443
writearg(coherenceinput.multilookL);
3444
writearg(coherenceinput.multilookP);
3447
// **********************************************************************
3448
else if (!strcmp(keyword,"COH_WINSIZE")) // estimator winsize
3450
coherenceinput.cohsizeL = atoi(word[1]); // pass keyword
3451
coherenceinput.cohsizeP = atoi(word[2]); // pass keyword
3452
writearg(coherenceinput.cohsizeL);
3453
writearg(coherenceinput.cohsizeP);
3456
// **********************************************************************
3457
// *** SUBTRACTION OF REFERENCE PHASE
3458
// **********************************************************************
3459
else if (!strcmp(keyword,"SRP_METHOD")) // method selector ref. phase
3461
keyword = word[1] ; // pass keyword
3464
if (!strcmp(keyword,"POLYNOMIAL"))
3465
subtrrefphainput.method = srp_polynomial;
3466
else if (!strcmp(keyword,"EXACT"))
3467
subtrrefphainput.method = srp_exact;
3470
ERROR << "SRP_METHOD: method "
3472
<< " not known for subtraction of ref. phase. line "
3474
PRINT_ERROR(ERROR.get_str())
3475
throw(keyword_error);
3479
// **********************************************************************
3480
else if (!strcmp(keyword,"SRP_OUT_CINT")) // name of output file
3482
strcpy(subtrrefphainput.focint, word[1] ); // pass keyword
3483
writearg(subtrrefphainput.focint);
3486
// **********************************************************************
3487
else if (!strcmp(keyword,"SRP_OUT_REFPHA")) // name of output file
3489
strcpy(subtrrefphainput.forefpha, word[1] ); // pass keyword
3490
writearg(subtrrefphainput.forefpha);
3493
// **********************************************************************
3494
else if (!strcmp(keyword,"SRP_DUMPREFPHA")) // true: dump ref.pha
3496
keyword = word[1] ; // pass keyword
3499
if (!strcmp(keyword,"ON"))
3500
subtrrefphainput.dumponlyrefpha = true;
3501
else if (!strcmp(keyword,"OFF") ||
3502
!strncmp(keyword,"//",2) || // comment
3503
!strncmp(keyword,"#",1) || // comment
3504
!(keyword[0] == '\0')) // no keyword
3505
subtrrefphainput.dumponlyrefpha = false;
3508
subtrrefphainput.dumponlyrefpha = false;
3509
WARNING << "SRP_DUMPREFPHA: line: " << linecnt << ": unknown argument: "
3510
<< keyword << "; Set to OFF (no dump).";
3515
// **********************************************************************
3517
// ___________ added by FvL
3518
else if (!strcmp(keyword,"SRP_OUT_H2PH")) // name of output file
3520
strcpy(subtrrefphainput.foh2ph, word[1] ); // pass keyword
3521
writearg(subtrrefphainput.foh2ph);
3523
// ___________ end added by FvL
3526
// **********************************************************************
3527
else if (!strcmp(keyword,"SRP_MULTILOOK")) // multilookfactors
3529
subtrrefphainput.multilookL = atoi(word[1]) ; // pass keyword
3530
keyword = word[2] ; // pass keyword
3531
writearg(subtrrefphainput.multilookL);
3533
if (isdigit(keyword[0]))
3534
subtrrefphainput.multilookP = atoi(keyword);
3535
else // default same factor
3536
subtrrefphainput.multilookP = subtrrefphainput.multilookL;
3539
// **********************************************************************
3541
// **********************************************************************
3542
else if (!strcmp(keyword,"PF_METHOD")) // method selector phase filtering
3544
keyword = word[1] ; // pass keyword
3547
if (!strcmp(keyword,"GOLDSTEIN"))
3548
filtphaseinput.method = fp_goldstein;
3549
else if (!strcmp(keyword,"MODGOLDSTEIN"))
3550
filtphaseinput.method = fp_modgoldstein;
3551
else if (!strcmp(keyword,"SPATIALCONV"))
3552
filtphaseinput.method = fp_spatialconv;
3553
else if (!strcmp(keyword,"SPECTRAL"))
3554
filtphaseinput.method = fp_spectral;
3557
ERROR << "PF_METHOD: method "
3559
<< " not known for phase filtering. line "
3561
PRINT_ERROR(ERROR.get_str())
3562
throw(keyword_error);
3566
// **********************************************************************
3567
else if (!strcmp(keyword,"PF_OUT_FILE")) // filename
3569
strcpy(filtphaseinput.fofiltphase, word[1] ); // pass keyword
3570
writearg(filtphaseinput.fofiltphase);
3573
// **********************************************************************
3574
else if (!strcmp(keyword,"PF_IN_FILE")) // filename
3576
strcpy(filtphaseinput.fifiltphase , word[1] ); // pass keyword
3578
filtphaseinput.finumlines = strtoul(word[1], &pLast, BASE10); // pass numoflines
3579
if ( pLast == word[2] ) // fails to convert one of them to double.
3581
ERROR << "PF_IN_FILE (numoflines): " << word[2] << " are not valid.";
3582
PRINT_ERROR(ERROR.get_str())
3583
throw(keyword_error);
3585
writearg(filtphaseinput.fifiltphase);
3586
writearg(filtphaseinput.finumlines);
3589
// **********************************************************************
3590
else if (!strcmp(keyword,"PF_BLOCKSIZE")) // buffersize
3592
filtphaseinput.blocksize = atoi(word[1]) ; // pass keyword
3593
writearg(filtphaseinput.blocksize);
3596
// **********************************************************************
3597
else if (!strcmp(keyword,"PF_ALPHA")) // alpha
3599
filtphaseinput.alpha = atof(word[1]) ; // pass keyword
3600
writearg(filtphaseinput.alpha);
3603
// **********************************************************************
3604
else if (!strcmp(keyword,"PF_OVERLAP")) // overlap
3606
filtphaseinput.overlap = atoi(word[1]) ; // pass keyword
3607
writearg(filtphaseinput.overlap);
3610
// **********************************************************************
3611
else if (!strcmp(keyword,"PF_KERNEL")) // conv. kernel e.g. 3 1 1 1
3613
keyword = word[1] ; // pass keyword
3614
const int32 sizekernel = atoi(keyword);
3615
writearg(sizekernel);
3616
if (!(isodd(sizekernel)))
3618
PRINT_ERROR("PF_KERNEL: size must be odd! (add 0, center around midpix)")
3619
throw(keyword_error);
3621
filtphaseinput.kernel.resize(1,sizekernel);
3623
for (int32 argnum=0; argnum<sizekernel; ++argnum)
3625
keyword = word[1] ; // pass keyword
3626
if (!(isdigit(keyword[0])))
3627
WARNING.print("kernel seems to be wrong?");
3628
const real4 in = atof(keyword);
3630
filtphaseinput.kernel(0,argnum) = in;
3631
sum += abs(in); // kernel -1 1
3634
filtphaseinput.kernel /= sum; // normalize
3635
INFO << "PF_KERNEL: Input kernel normalized by: " << sum;
3639
// **********************************************************************
3640
else if (!strcmp(keyword,"PF_IN_KERNEL2D")) // filename for ascii 2d kernel
3642
strcpy(filtphaseinput.fikernel2d, word[1] ); // pass keyword
3643
writearg(filtphaseinput.fikernel2d);
3646
// *******************************************************************
3648
// *******************************************************************
3649
else if (!strcmp(keyword,"DI_OUT_FILE")) // output filename
3651
strcpy(dinsarinput.fodinsar, word[1] ); // pass keyword
3652
writearg(dinsarinput.fodinsar);
3655
else if (!strcmp(keyword,"DI_OUT_SCALED")) // output filename
3657
strcpy(dinsarinput.foscaleduint, word[1] ); // pass keyword
3658
writearg(dinsarinput.foscaleduint);
3661
else if (!strcmp(keyword,"DI_IN_TOPOMASTER")) // input resultfilename
3663
strcpy(dinsarinput.topomasterresfile, word[1] ); // pass keyword
3664
writearg(dinsarinput.fodinsar);
3667
else if (!strcmp(keyword,"DI_IN_TOPOSLAVE")) // input resultfilename
3669
strcpy(dinsarinput.toposlaveresfile, word[1] ); // pass keyword
3670
writearg(dinsarinput.fodinsar);
3673
else if (!strcmp(keyword,"DI_IN_TOPOINT")) // input resultfilename
3675
strcpy(dinsarinput.topointresfile, word[1] ); // pass keyword
3676
writearg(dinsarinput.fodinsar);
3680
// **********************************************************************
3681
// *** COMPUTATION OF REFERENCE DEM (phase)
3682
// **********************************************************************
3683
// else if (!strcmp(keyword,"CRD_METHOD")) // name of output file
3685
// filename = word[1] ; // pass keyword
3686
// writearg(keyword2);
3687
// toupper(keyword2);
3688
// if (!strcmp(keyword2,"TRILINEAR") || !strcmp(keyword2,"TRI_LINEAR") ||
3689
// !strcmp(keyword2,"TRILIN") || !strcmp(keyword2,"TRI_LIN"))
3690
// comprefdeminput.method = crd_trilinear;
3691
// else if (!strcmp(keyword2,"NN") || !strcmp(keyword2,"NEAREST") ||
3692
// !strcmp(keyword2,"NEAREST_NEIGHBOR" ))
3693
// comprefdeminput.method = crd_nearest;
3696
// ERROR << "CRD_METHOD: "
3698
// << " not known (use TRILINEAR or NEAREST); line "
3699
// << linecnt << ".";
3700
// PRINT_ERROR(ERROR.get_str())
3701
// throw(keyword_error);
3705
// **********************************************************************
3706
else if (!strcmp(keyword,"CRD_IN_DEM")) // input file
3708
strcpy(comprefdeminput.firefdem, word[1] ); // pass keyword
3709
writearg(comprefdeminput.firefdem);
3712
// **********************************************************************
3713
else if (!strcmp(keyword,"CRD_IN_FORMAT")) // format input file
3715
keyword = word[1] ; // pass keyword
3718
if (!strcmp(keyword,"R4") || !strcmp(keyword,"REAL4"))
3719
comprefdeminput.iformatflag = FORMATR4;
3720
else if (!strcmp(keyword,"I2") || !strcmp(keyword,"SHORT"))
3721
comprefdeminput.iformatflag = FORMATI2; // default
3722
else if (!strcmp(keyword,"I2_BIGENDIAN") ||
3723
!strcmp(keyword,"SHORT_BIGENDIAN"))
3724
comprefdeminput.iformatflag = FORMATI2_BIGENDIAN; // default
3725
else if (!strcmp(keyword,"R8") || !strcmp(keyword,"REAL8"))
3726
comprefdeminput.iformatflag = FORMATR8;
3729
ERROR << "CRD_IN_FORMAT: input format "
3731
<< " not known (R4 R8 I2 (native) SHORT_BIGENDIAN); line "
3733
PRINT_ERROR(ERROR.get_str())
3734
throw(keyword_error);
3738
// **********************************************************************
3739
else if (!strcmp(keyword,"CRD_IN_SIZE")) // nrow ncols (lat lon)
3741
comprefdeminput.demrows = strtoul(word[1], NULL, BASE10); // pass keyword [MA] atoi instead strtoul
3742
comprefdeminput.demcols = strtoul(word[2], NULL, BASE10); // pass keyword
3743
writearg(comprefdeminput.demrows);
3744
writearg(comprefdeminput.demcols);
3747
// **********************************************************************
3748
else if (!strcmp(keyword,"CRD_IN_DELTA")) // degrees delta lat lon
3750
comprefdeminput.demdeltalat = atof(word[1]) ; // pass keyword
3751
keyword = word[2] ; // update keyword
3752
writearg(comprefdeminput.demdeltalat);
3754
if (isdigit(keyword[0]) || keyword[0]=='.') // likely to be 2 numbers
3755
comprefdeminput.demdeltalon = atof(keyword);
3756
else // default same gridsize
3757
comprefdeminput.demdeltalon = comprefdeminput.demdeltalat;
3759
// ______ Store as radians ______
3760
comprefdeminput.demdeltalat = deg2rad(comprefdeminput.demdeltalat);
3761
comprefdeminput.demdeltalon = deg2rad(comprefdeminput.demdeltalon);
3764
// **********************************************************************
3765
else if (!strcmp(keyword,"CRD_IN_UL")) // upperleft coordinates
3767
char *pLast1, *pLast2 = NULL;
3768
comprefdeminput.demlatleftupper = strtod(word[1], &pLast1);
3769
comprefdeminput.demlonleftupper = strtod(word[2], &pLast2);
3770
if ( pLast1 == word[1] || pLast2 == word[2] ) // fails to convert one of them to double.
3772
ERROR << "CRD_IN_UL: " << word[1] << " : " << word[2] << " are not valid.";
3773
PRINT_ERROR(ERROR.get_str())
3774
throw(keyword_error);
3776
writearg(comprefdeminput.demlatleftupper);
3777
writearg(comprefdeminput.demlonleftupper);
3778
comprefdeminput.demlatleftupper = deg2rad(comprefdeminput.demlatleftupper);
3779
comprefdeminput.demlonleftupper = deg2rad(comprefdeminput.demlonleftupper);
3782
// **********************************************************************
3783
else if (!strcmp(keyword,"CRD_IN_NODATA")) // flag for no data
3785
comprefdeminput.demnodata = atof(word[1]) ; // pass keyword
3786
writearg(comprefdeminput.demnodata);
3789
// **********************************************************************
3790
else if (!strcmp(keyword,"CRD_INCLUDE_FE")) // true: ref.pha incl. flat earth
3792
keyword = word[1] ; // pass keyword
3795
if (!strcmp(keyword,"OFF"))
3796
comprefdeminput.includerefpha = false;
3797
else if (!strcmp(keyword,"ON") ||
3798
!strncmp(keyword,"//",2) || // comment
3799
!strncmp(keyword,"#",1) || // comment
3800
!(keyword[0] == '\0')) // no keyword
3801
comprefdeminput.includerefpha = true;
3804
comprefdeminput.includerefpha = false;
3805
WARNING << "CRD_INCLUDE_FE: line: " << linecnt << ": unknown argument: "
3807
<< "; Set to OFF (computing pure topo phase w.r.t. flat earth).";
3812
// **********************************************************************
3813
// else if (!strcmp(keyword,"CRD_DENSE")) // factor
3815
// comprefdeminput.extradense = word[1] ; // pass keyword
3816
// writearg(comprefdeminput.extradense);
3819
// **********************************************************************
3820
else if (!strcmp(keyword,"CRD_OUT_DEM")) // name of output file
3822
strcpy(comprefdeminput.fodem, word[1] ); // pass keyword
3823
writearg(comprefdeminput.fodem);
3826
// **********************************************************************
3827
else if (!strcmp(keyword,"CRD_OUT_DEMI")) // name of output file
3829
strcpy(comprefdeminput.fodemi, word[1] ); // pass keyword
3830
writearg(comprefdeminput.fodemi);
3833
// **********************************************************************
3834
else if (!strcmp(keyword,"CRD_OUT_FILE")) // name of output file
3836
strcpy(comprefdeminput.forefdem, word[1] ); // pass keyword
3837
writearg(comprefdeminput.forefdem);
3840
// ___________ added by FvL
3841
// **********************************************************************
3842
else if (!strcmp(keyword,"CRD_OUT_H2PH")) // name of output file
3844
strcpy(comprefdeminput.foh2ph, word[1] ); // pass keyword
3845
writearg(comprefdeminput.foh2ph);
3847
// ___________ end added by FvL
3849
// **********************************************************************
3850
else if (!strcmp(keyword,"CRD_OUT_DEM_LP")) // name of output file
3852
strcpy(comprefdeminput.forefdemhei, word[1] ); // pass keyword
3853
writearg(comprefdeminput.forefdemhei);
3857
// **********************************************************************
3858
// *** SUBTRACTION OF REFERENCE DEM (phase)
3859
// **********************************************************************
3860
else if (!strcmp(keyword,"SRD_OUT_CINT")) // name of output file
3862
strcpy(subtrrefdeminput.focint, word[1] ); // pass keyword
3863
writearg(subtrrefdeminput.focint);
3866
// **********************************************************************
3867
else if (!strcmp(keyword,"SRD_OFFSET")) // Line Pixel
3869
subtrrefdeminput.offsetL = atoi(word[1]); // pass keyword
3870
subtrrefdeminput.offsetP = atoi(word[2]); // pass keyword
3871
writearg(subtrrefdeminput.offsetL);
3872
writearg(subtrrefdeminput.offsetP);
3875
// // **********************************************************************
3876
// // *** ADDITION OF REFERENCE DEM (phase)
3877
// // **********************************************************************
3878
// else if (!strcmp(keyword,"ARD_OUT_CINT")) // name of output file
3880
// addrefdeminput.focint = word[1] ; // pass keyword
3883
// **********************************************************************
3885
// **********************************************************************
3886
else if (!strcmp(keyword,"UW_METHOD")) // method selector unwrapping
3888
keyword = word[1] ; // pass keyword
3891
if (!strcmp(keyword,"RAMON"))
3892
unwrapinput.method = uw_method1;
3893
else if (!strcmp(keyword,"SNAPHU"))
3894
unwrapinput.method = uw_method2;// default
3895
else if (!strcmp(keyword,"MCF_DLR"))
3896
unwrapinput.method = uw_method3;
3899
ERROR << "UW_METHOD: method "
3901
<< " not known for unwrapping on line "
3903
PRINT_ERROR(ERROR.get_str())
3904
throw(keyword_error);
3908
// **********************************************************************
3909
else if (!strcmp(keyword,"UW_SEEDS")) // position of seeds
3911
keyword = word[1] ; // pass keyword
3913
if (isdigit(keyword[0]))
3915
unwrapinput.deltaLseed = atoi(keyword);
3916
keyword = word[2] ; // update keyword
3918
if (isdigit(keyword[0]))
3919
unwrapinput.deltaPseed = atoi(keyword);
3921
unwrapinput.deltaPseed = unwrapinput.deltaLseed;
3923
else // assume no numbers but filename with seeds
3925
strcpy(unwrapinput.seedfile,keyword);
3929
// **********************************************************************
3930
else if (!strcmp(keyword,"UW_OUT_FILE")) // filename output unwrapped int.
3932
strcpy(unwrapinput.fouint, word[1] ); // pass keyword
3933
writearg(unwrapinput.fouint);
3936
// **********************************************************************
3937
else if (!strcmp(keyword,"UW_OUT_FORMAT")) // output format
3939
keyword = word[1] ; // pass keyword
3942
if (!strcmp(keyword,"R4") || !strcmp(keyword,"REAL4"))
3943
unwrapinput.oformatflag = FORMATR4;
3944
else if (!strcmp(keyword,"CR4") || !strcmp(keyword,"COMPLEXR4"))
3946
WARNING.print("UW_OUT_FORMAT = CR4 --> Using hgt format");
3947
unwrapinput.oformatflag = FORMATHGT;// default
3949
else if (!strcmp(keyword,"HGT"))
3950
unwrapinput.oformatflag = FORMATHGT;// default
3953
unwrapinput.oformatflag = FORMATHGT;// default
3954
WARNING << "UW_OUT_FORMAT: output format "
3956
<< " not known (R4 or HGT, using HGT); line "
3962
// **********************************************************************
3963
else if (!strcmp(keyword,"UW_OUT_REGIONS")) // filename output regions
3965
strcpy(unwrapinput.foregions, word[1] ); // pass keyword
3966
writearg(unwrapinput.foregions);
3969
// **********************************************************************
3970
else if (!strcmp(keyword,"UW_SNAPHU_MODE")) // filename output regions
3972
keyword = word[1] ; // pass keyword
3975
if (!strcmp(keyword,"TOPO"))
3976
strcpy(unwrapinput.snaphu_mode,"TOPO"); // default TOPO
3977
else if (!strcmp(keyword,"DEFO"))
3978
strcpy(unwrapinput.snaphu_mode,"DEFO");
3979
else if (!strcmp(keyword,"SMOOTH"))
3980
strcpy(unwrapinput.snaphu_mode,"SMOOTH");
3981
else if (!strcmp(keyword,"NOSTATCOSTS"))
3982
strcpy(unwrapinput.snaphu_mode,"NOSTATCOSTS");
3985
ERROR << "UW_SNAPHU_MODE: "
3987
<< " not known for unwrapping on line "
3989
PRINT_ERROR(ERROR.get_str())
3990
throw(keyword_error);
3994
// **********************************************************************
3995
else if (!strcmp(keyword,"UW_SNAPHU_INIT"))
3997
keyword = word[1] ; // pass keyword
4000
if (!strcmp(keyword,"MST"))
4001
strcpy(unwrapinput.snaphu_init,"MST"); // default mst
4002
else if (!strcmp(keyword,"MCF"))
4003
strcpy(unwrapinput.snaphu_init,"MCF");
4006
WARNING << "UW_SNAPHU_INIT: "
4008
<< " not known for unwrapping on line "
4009
<< linecnt << " (using MST).";
4014
// **********************************************************************
4015
else if (!strcmp(keyword,"UW_SNAPHU_LOG"))
4017
strcpy(unwrapinput.snaphu_log, word[1] ); // pass keyword
4018
writearg(unwrapinput.snaphu_log);
4019
//strcpy(unwrapinput.snaphu_log,"-l ");
4020
//strcat(unwrapinput.snaphu_log,keyword);
4023
// **********************************************************************
4024
else if (!strcmp(keyword,"UW_SNAPHU_COH"))
4026
strcpy(unwrapinput.snaphu_coh, word[1] ); // pass keyword
4027
writearg(unwrapinput.snaphu_coh);
4030
// **********************************************************************
4031
else if (!strcmp(keyword,"UW_SNAPHU_VERBOSE"))
4033
keyword = word[1] ; // pass keyword
4036
if (!strcmp(keyword,"OFF"))
4037
strcpy(unwrapinput.snaphu_verbose,"FALSE");
4038
else if (!strcmp(keyword,"ON") ||
4039
!strncmp(keyword,"//",2) || // comment
4040
!strncmp(keyword,"#",1) || // comment
4041
!(keyword[0] == '\0')) // no keyword
4042
strcpy(unwrapinput.snaphu_verbose,"TRUE");
4045
strcpy(unwrapinput.snaphu_verbose,"TRUE");
4046
WARNING << "UW_SNAPHU_VERBOSE: line: "
4047
<< linecnt << ": unknown argument: " << keyword
4053
else if (!strcmp(keyword,"UW_SNAPHU_NTILEROW"))
4055
unwrapinput.ntilerow = atoi(word[1]) ; // pass keyword
4056
writearg(unwrapinput.ntilerow);
4057
if (unwrapinput.ntilerow > 50)
4059
WARNING.print("UW_SNAPHU_NTILEROW > 100 tiles, is this okay? ");
4061
INFO << "UW_SNAPHU_NTILEROW: \t "
4062
<< unwrapinput.ntilerow;
4066
else if (!strcmp(keyword,"UW_SNAPHU_NTILECOL"))
4068
unwrapinput.ntilecol = atoi(word[1]) ; // pass keyword
4069
writearg(unwrapinput.ntilecol);
4070
if (unwrapinput.ntilecol > 50)
4072
WARNING.print("UW_SNAPHU_NTILECOL > 100 tiles, is this okay? ");
4075
INFO << "UW_SNAPHU_NTILECOL: \t "
4076
<< unwrapinput.ntilecol;
4080
else if (!strcmp(keyword,"UW_SNAPHU_ROWOVRLP"))
4082
unwrapinput.rowovrlp = atoi(word[1]) ; // pass keyword
4083
writearg(unwrapinput.rowovrlp);
4084
INFO << "UW_SNAPHU_ROWOVRLP: \t "
4085
<< unwrapinput.rowovrlp;
4089
else if (!strcmp(keyword,"UW_SNAPHU_COLOVRLP"))
4091
unwrapinput.colovrlp = atoi(word[1]) ; // pass keyword
4092
writearg(unwrapinput.colovrlp);
4093
INFO << "UW_SNAPHU_COLOVRLP: \t "
4094
<< unwrapinput.colovrlp;
4098
else if (!strcmp(keyword,"UW_SNAPHU_NPROC"))
4100
unwrapinput.nproc = atoi(word[1]) ; // pass keyword
4101
writearg(unwrapinput.nproc);
4102
if (unwrapinput.ntilecol > 2)
4104
WARNING.print("UW_SNAPHU_NPROC > 2CPUs, do you have a cluster?");
4107
INFO << "UW_SNAPHU_NPROC: \t "
4108
<< unwrapinput.ntilecol;
4112
else if (!strcmp(keyword,"UW_SNAPHU_TILECOSTTHRESH"))
4114
unwrapinput.tilecostthresh = atoi(word[1]) ; // pass keyword
4115
writearg(unwrapinput.tilecostthresh);
4116
if (unwrapinput.ntilecol > 500)
4118
WARNING.print("UW_SNAPHU_TILECOSTTHRESH > 500, do you have a cluster?");
4121
INFO << "UW_SNAPHU_TILECOSTTHRESH: \t "
4122
<< unwrapinput.tilecostthresh;
4125
else if (!strcmp(keyword,"UW_SNAPHU_DUMPONLYCONF")) //
4127
keyword = word[1] ; // pass keyword
4130
if (!strcmp(keyword,"OFF"))
4131
unwrapinput.snaphu_dumponlyconf=false;
4132
else if (!strcmp(keyword,"ON") ||
4133
!strncmp(keyword,"//",2) || // comment
4134
!strncmp(keyword,"#",1) || // comment
4135
!(keyword[0] == '\0')) // no keyword
4136
unwrapinput.snaphu_dumponlyconf=true;
4139
unwrapinput.snaphu_dumponlyconf=true;
4140
WARNING << "UW_SNAPHU_DUMPONLYCONF: line: "
4141
<< linecnt << ": unknown argument: " << keyword
4147
// **********************************************************************
4148
// *** SLANT to HEIGHT CONVERSION
4149
// **********************************************************************
4150
else if (!strcmp(keyword,"S2H_METHOD")) // method selector slant2height
4152
keyword = word[1] ; // pass keyword
4155
if (!strcmp(keyword,"SCHWABISCH"))
4156
slant2hinput.method = s2h_schwabisch;
4157
else if (!strcmp(keyword,"AMBIGUITY"))
4158
slant2hinput.method = s2h_ambiguity;
4159
else if (!strcmp(keyword,"RODRIGUEZ"))
4160
slant2hinput.method = s2h_rodriguez;
4163
ERROR << "S2H_METHOD: method "
4165
<< " not known for slant to height conversion, line "
4167
PRINT_ERROR(ERROR.get_str())
4168
throw(keyword_error);
4172
// **********************************************************************
4173
else if (!strcmp(keyword,"S2H_NPOINTS")) // number of points to use
4175
slant2hinput.Npoints = atoi(word[1]) ; // pass keyword
4176
writearg(slant2hinput.Npoints);
4179
// **********************************************************************
4180
else if (!strcmp(keyword,"S2H_DEGREE1D")) // degree of 1d polynomial
4182
slant2hinput.degree1d = atoi(word[1]) ; // pass keyword
4183
writearg(slant2hinput.degree1d);
4186
// **********************************************************************
4187
else if (!strcmp(keyword,"S2H_DEGREE2D")) // degree of 2d polynomial
4189
slant2hinput.degree2d = atoi(word[1]) ; // pass keyword
4190
writearg(slant2hinput.degree2d);
4193
// **********************************************************************
4194
else if (!strcmp(keyword,"S2H_NHEIGHTS")) // #heights to evaluate ref.pha
4196
slant2hinput.Nheights = atoi(word[1]) ; // pass keyword
4197
writearg(slant2hinput.Nheights);
4200
// **********************************************************************
4201
else if (!strcmp(keyword,"S2H_OUT_HEI")) // filename output height
4203
strcpy(slant2hinput.fohei, word[1] ); // pass keyword
4204
writearg(slant2hinput.fohei);
4207
// **********************************************************************
4208
else if (!strcmp(keyword,"S2H_OUT_PHI")) // filename output latitude
4210
strcpy(slant2hinput.fophi, word[1] ); // pass keyword
4211
writearg(slant2hinput.fophi);
4214
// **********************************************************************
4215
else if (!strcmp(keyword,"S2H_OUT_LAM")) // filename output longitude
4217
strcpy(slant2hinput.folam, word[1] ); // pass keyword
4218
writearg(slant2hinput.folam);
4221
// **********************************************************************
4223
// **********************************************************************
4224
// else if (!strcmp(keyword,"GEO_METHOD"))
4226
// geocodeinput.method = word[1] ; // pass keyword
4229
// **********************************************************************
4230
else if (!strcmp(keyword,"GEO_OUT_PHI")) // output file latitude
4232
strcpy(geocodeinput.fophi, word[1] ); // pass keyword
4233
writearg(geocodeinput.fophi);
4236
// **********************************************************************
4237
else if (!strcmp(keyword,"GEO_OUT_LAM")) // output file longitude
4239
strcpy(geocodeinput.folam, word[1] ); // pass keyword
4240
writearg(geocodeinput.folam);
4244
// ____ start added by HB ____
4245
// **********************************************************************
4247
// **********************************************************************
4248
else if (!strcmp(keyword,"EO_METHOD"))
4253
if (!strcmp(keyword,"LSQ"))
4254
estorbitsinput.method = eo_lsq;
4255
else if (!strcmp(keyword,"GRIDSEARCH"))
4256
estorbitsinput.method = eo_gridsearch;
4259
ERROR << "EO_METHOD: unknown method " << keyword
4260
<< ", line " << linecnt << ".";
4261
PRINT_ERROR(ERROR.get_str())
4262
throw(keyword_error);
4266
// **********************************************************************
4267
else if (!strcmp(keyword,"EO_IN_DEM_LP"))
4269
strcpy(estorbitsinput.fiheightmap, word[1]);
4270
writearg(estorbitsinput.fiheightmap);
4273
// **********************************************************************
4274
else if (!strcmp(keyword,"EO_OUT_RES"))
4276
strcpy(estorbitsinput.foresiduals, word[1]);
4277
writearg(estorbitsinput.foresiduals);
4280
// **********************************************************************
4281
else if (!strcmp(keyword,"EO_WEIGHTING"))
4286
if (!strcmp(keyword,"NONE"))
4287
estorbitsinput.weighting = eo_noweighting;
4288
else if (!strcmp(keyword,"COH"))
4289
estorbitsinput.weighting = eo_coh;
4290
else if (!strcmp(keyword,"COH2"))
4291
estorbitsinput.weighting = eo_coh2;
4292
else if (!strcmp(keyword,"PDF"))
4293
estorbitsinput.weighting = eo_pdf;
4296
ERROR << "EO_WEIGHTING: unknown weighting scheme " << keyword
4297
<< ", line " << linecnt << ".";
4298
PRINT_ERROR(ERROR.get_str())
4299
throw(keyword_error);
4303
// **********************************************************************
4304
else if (!strcmp(keyword,"EO_NPOINTS"))
4306
estorbitsinput.nobs = atoi(word[1]);
4307
writearg(estorbitsinput.nobs);
4310
// **********************************************************************
4311
else if (!strcmp(keyword,"EO_IN_POS"))
4313
strcpy(estorbitsinput.ifpositions,word[1] );
4314
writearg(estorbitsinput.ifpositions);
4317
// **********************************************************************
4318
else if (!strcmp(keyword,"EO_THRESHOLD"))
4320
estorbitsinput.threshold = atof(word[1]);
4321
writearg(estorbitsinput.threshold);
4322
if (estorbitsinput.threshold > 1)
4324
ERROR << "EO_THRESHOLD: threshold > 1, line " << linecnt << ".";
4325
PRINT_ERROR(ERROR.get_str())
4326
throw(keyword_error);
4330
// **********************************************************************
4331
else if (!strcmp(keyword,"EO_MAXITER"))
4333
estorbitsinput.maxiter = atoi(word[1]);
4334
writearg(estorbitsinput.maxiter);
4337
// **********************************************************************
4338
else if (!strcmp(keyword,"EO_K_ALPHA"))
4340
estorbitsinput.k_alpha = atof(word[1]);
4341
writearg(estorbitsinput.k_alpha);
4342
if (estorbitsinput.k_alpha < 0)
4344
ERROR << "EO_K_ALPHA: critical value < 0, line " << linecnt << ".";
4345
PRINT_ERROR(ERROR.get_str())
4346
throw(keyword_error);
4350
// **********************************************************************
4351
else if (!strcmp(keyword,"EO_SEARCHSPACE"))
4353
char *pLast1, *pLast2 = NULL;
4354
estorbitsinput.maxfringesaz = strtoul(word[1], &pLast1, BASE10);
4355
estorbitsinput.maxfringesrg = strtoul(word[2], &pLast2, BASE10);
4356
if ( pLast1 == word[1] || pLast2 == word[2] ) // fails to convert one of them to double.
4358
ERROR << "EO_SEARCHSPACE: " << word[1] << " : "
4359
<< word[2] << " are not valid.";
4360
PRINT_ERROR(ERROR.get_str())
4361
throw(keyword_error);
4363
writearg(estorbitsinput.maxfringesaz);
4364
writearg(estorbitsinput.maxfringesrg);
4365
if (estorbitsinput.maxfringesaz > 500 || estorbitsinput.maxfringesrg > 500)
4367
WARNING << "EO_SEARCHSPACE: Parameters (" << estorbitsinput.maxfringesaz
4368
<< "," << estorbitsinput.maxfringesrg << ") appear to be very high.";
4373
// **********************************************************************
4374
else if (!strcmp(keyword,"EO_REFORBIT"))
4376
strcpy(estorbitsinput.reforbitfile, word[1]);
4377
writearg(estorbitsinput.reforbitfile);
4380
// **********************************************************************
4381
else if (!strcmp(keyword,"EO_OUT_DATA"))
4383
strcpy(estorbitsinput.foobsdata, word[1]);
4384
writearg(estorbitsinput.foobsdata);
4387
// **********************************************************************
4388
else if (!strcmp(keyword,"EO_DEGREE"))
4390
estorbitsinput.poldegree = atoi(word[1]);
4391
writearg(estorbitsinput.poldegree);
4394
// **********************************************************************
4395
else if (!strcmp(keyword,"EO_CONSTRAIN"))
4397
int16 npar = atoi(word[1]);
4400
estorbitsinput.constrained = false;
4403
estorbitsinput.constraints = matrix<int16>(npar,2);
4404
for (uint i=0; i<npar; i++)
4406
keyword = word[2+i];
4410
if (!strncmp(keyword, "BPAR", 4))
4413
deriv = int(keyword[4])-48; // char2int
4415
else if (!strncmp(keyword, "BPERP", 5))
4418
deriv = int(keyword[5])-48; // char2int
4422
ERROR << "EO_CONSTRAIN: parameter "
4424
<< " not interpretable for orbit estimation, line "
4426
PRINT_ERROR(ERROR.get_str())
4427
throw(keyword_error);
4431
ERROR << "EO_CONSTRAIN: degree of parameter "
4433
<< " is too high, line "
4435
PRINT_ERROR(ERROR.get_str())
4436
throw(keyword_error);
4440
estorbitsinput.constraints(i,0) = component;
4441
estorbitsinput.constraints(i,1) = deriv;
4446
// ____ end added by HB ____
4449
// **********************************************************************
4450
// Assume wrong keyword, but if it starts with //, a c, or comment
4451
// then continue with a warning, no blank between key and arg
4452
// **********************************************************************
4453
else if (!strncmp(keyword,"COMMENT",7) || // assume user wanted to comment out
4454
!strncmp(keyword,"C",1)) // but forgot a space
4456
WARNING << "Obsolete or unknown keyword: \"" << keyword
4457
<< "\" at line: " << linecnt
4458
<< ". (Interpreted as comment, ignored)";
4461
// ______ Really cannot make anything from your input ______
4464
//ERROR << "Unknown keyword: \"" << keyword
4465
// << "\" at line: " << linecnt << ".";
4466
//PRINT_ERROR(ERROR.get_str())
4467
//throw(keyword_error);
4468
WARNING << "Unknown keyword: \"" << keyword
4469
<< "\" at line: " << linecnt << ".";
4472
//optionsfile.getline(eachline,4*ONE27,'\n'); // goto next line. [MA] needs debug if the line is long loops forever.
4473
} // end while (file)
4480
// ====== Check input/ info to screen ======
4481
checkgeneral(generalinput, onlyprocess); // also repair onlyprocess
4482
INFO << "LISTINPUT: \tAppend input to logfile: \t" << listinput;
4486
// ______ info ELLIPSOID card, compute and fill e2, e2b ______
4487
ellipsinput.showdata();
4490
// ====== Check input of step reading info from files ======
4491
if (generalinput.process[pr_m_readfiles])
4492
checkreadfiles(m_readfilesinput, MASTERID); // check mandatory cards
4494
if (generalinput.process[pr_s_readfiles])
4495
checkreadfiles(s_readfilesinput, SLAVEID); // check mandatory cards
4498
// ====== Check input of step conversion slc to raw ======
4499
if (generalinput.process[pr_m_crop])
4501
checkcrop(m_cropinput, MASTERID);
4502
if (!strcmp(s_cropinput.fileout1,m_cropinput.fileout1))
4505
"code 301: same name outputfile CROP_OUT for master and slave not allowed.")
4506
throw(keyword_error);
4508
if (generalinput.overwrit)
4509
if (existed(m_cropinput.fileout1))
4511
INFO << "OVERWRIT: file " << m_cropinput.fileout1
4512
<< " will be overwritten.";
4517
if (generalinput.process[pr_s_crop])
4519
checkcrop(s_cropinput, SLAVEID);
4520
if (!strcmp(s_cropinput.fileout1,m_cropinput.fileout1))
4523
"code 301: same name outputfile CROP_OUT for master and slave not allowed.")
4524
throw(keyword_error);
4526
if (generalinput.overwrit)
4527
if (existed(s_cropinput.fileout1))
4529
INFO << "OVERWRIT: file " << s_cropinput.fileout1
4530
<< " will be overwritten.";
4535
//____RaffaeleNutricato START MODIFICATION SECTION 10
4536
// ====== Check input of step oversample master======
4537
if (generalinput.process[pr_m_oversample])
4539
checkoversample(m_oversample, MASTERID);
4541
// ====== Check input of step oversampling slave ======
4542
if (generalinput.process[pr_s_oversample])
4544
checkoversample(s_oversample, SLAVEID);
4546
//____RaffaeleNutricato END MODIFICATION SECTION 10
4549
// ====== Check input of step porbits ======
4550
if (generalinput.process[pr_m_porbits])
4551
checkporbits(porbitsinput, MASTERID);
4552
if (generalinput.process[pr_s_porbits])
4553
checkporbits(porbitsinput, SLAVEID);
4556
// ____ start added by HB ____
4557
// ====== Check input of steps m_modorb and s_modorb ======
4558
if (generalinput.process[pr_m_morbits])
4560
// ______ determine polynomial degree => number of parameters ______
4562
for (int16 i=9; i>=0; i--)
4564
if (morbitsinputmaster.coeff(i,0)!=0 || morbitsinputmaster.coeff(i,1)!=0)
4571
// ______ resize coefficient matrices ______
4572
morbitsinputmaster.coeff.setdata(npar/2,0,morbitsinputmaster.coeff.getdata(window(0,npar/2-1,1,1)));
4573
matrix<real8> temp = morbitsinputmaster.coeff.getdata(window(0,npar-1,0,0));
4574
morbitsinputmaster.coeff.resize(npar,1);
4575
morbitsinputmaster.coeff = temp;
4576
for (int p=0; p<npar; p++)
4578
INFO << "MODORB master coefficient (" << p << "): " << morbitsinputmaster.coeff(p,0);
4582
if (generalinput.process[pr_s_morbits])
4584
// ______ determine polynomial degree => number of parameters ______
4586
for (int16 i=9; i>=0; i--)
4587
if (morbitsinputslave.coeff(i,0)!=0 || morbitsinputslave.coeff(i,1)!=0)
4593
// ______ resize coefficient matrices ______
4594
morbitsinputslave.coeff.setdata(npar/2,0,morbitsinputslave.coeff.getdata(window(0,npar/2-1,1,1)));
4595
matrix<real8> temp = morbitsinputslave.coeff.getdata(window(0,npar-1,0,0));
4596
morbitsinputslave.coeff.resize(npar,1);
4597
morbitsinputslave.coeff = temp;
4598
for (int p=0; p<npar; p++)
4600
INFO << "MODORB slave coefficient (" << p << "): " << morbitsinputslave.coeff(p,0);
4604
// ____ end added by HB ____
4607
// ====== Check input of SIMAMP step master====== [MA]
4608
if (generalinput.process[pr_m_simamp])
4610
checksimamp(simampinput);
4613
// ====== Check input of MTIMING step master====== [MA] rev.2
4614
if (generalinput.process[pr_m_mtiming])
4616
if (mtiminginput.method == def_mte_method-999) // see at defaults, no method card used
4618
mtiminginput.method = def_mte_method; // default method
4619
INFO.print("Default method will be used for MASTER TIMING ERROR estimation.");
4621
if (specified(mtiminginput.ifpositions)) // filename specified
4623
if (mtiminginput.Nwin != def_mte_nwin+999) // something is specified
4625
WARNING << "MTE_NWIN: \t" << mtiminginput.Nwin
4626
<< " ignored due to existence of input file (MTE_IN_POS) "
4627
<< mtiminginput.ifpositions;
4630
mtiminginput.Nwin = filelines(mtiminginput.ifpositions);
4632
else if (mtiminginput.Nwin == def_mte_nwin+999) // no inputfile, default
4634
mtiminginput.Nwin = def_mte_nwin;
4635
INFO.print("Default number of windows will be used for MASTER TIMING ERROR estimation.");
4637
checkmtiming(mtiminginput);
4640
// ====== Check input of step azimuth filtering ======
4641
if (generalinput.process[pr_m_filtazi] ||
4642
generalinput.process[pr_s_filtazi])
4644
// ______ Set defaults ______
4645
if (filtaziinput.overlap == -1)
4646
filtaziinput.overlap = filtaziinput.fftlength/8; // default
4647
// ______ Check input ______
4648
if (generalinput.process[pr_m_filtazi] &&
4649
generalinput.process[pr_s_filtazi])
4650
checkfiltazi(filtaziinput,MASTERID+SLAVEID);
4651
else if (generalinput.process[pr_m_filtazi])
4652
checkfiltazi(filtaziinput,MASTERID);
4653
else if (generalinput.process[pr_s_filtazi])
4654
checkfiltazi(filtaziinput,SLAVEID);
4657
PRINT_ERROR("PANIC, this cannot be")
4658
throw(keyword_error);
4662
// ====== Check input of step range filtering ======
4663
if (generalinput.process[pr_m_filtrange])
4665
// ______ Check defaults ______
4666
if (filtrangeinput.fftlength==-999) // not specified
4668
if (filtrangeinput.method==rf_adaptive)
4669
filtrangeinput.fftlength=64; // default
4670
else if (filtrangeinput.method==rf_porbits)
4671
filtrangeinput.fftlength=1024; // default
4673
checkfiltrange(filtrangeinput);
4676
// ====== Check input of reserved EXTRA step master/slave ======
4677
if (generalinput.process[pr_m_EXTRA])
4679
PRINT_ERROR("extra step master not implemented.")
4680
throw(keyword_error);
4682
if (generalinput.process[pr_s_EXTRA])
4684
PRINT_ERROR("extra step slave not implemented.")
4685
throw(keyword_error);
4689
// ====== Check input of step coarse (orbits) ======
4690
// ______ no checks required. (no cards as well)
4691
if (generalinput.process[pr_i_coarse])
4697
// ====== Check coarse coregistration based on correlation ======
4698
// ______ Check + repair method selector coarse correlation ______
4699
if (generalinput.process[pr_i_coarse2]) // correlation
4701
if (coarsecorrinput.method == def_cc_method-999) // see at defaults, no method card used
4703
coarsecorrinput.method = def_cc_method; // default method
4704
INFO.print("Default method will be used for coarse coregistration.");
4706
if (specified(coarsecorrinput.ifpositions)) // filename specified
4708
if (coarsecorrinput.Nwin != def_cc_nwin+999) // something is specified
4710
WARNING << "CC_NWIN: \t" << coarsecorrinput.Nwin
4711
<< " ignored due to existence of input file (CC_IN_POS) "
4712
<< coarsecorrinput.ifpositions;
4715
coarsecorrinput.Nwin = filelines(coarsecorrinput.ifpositions);
4717
else if (coarsecorrinput.Nwin == def_cc_nwin+999) // no inputfile, default
4719
coarsecorrinput.Nwin = def_cc_nwin;
4720
INFO.print("Default number of windows will be used for coarse coregistration.");
4722
checkcoarsecorr(coarsecorrinput);
4726
// ====== Check input of step fine ======
4727
if (generalinput.process[pr_i_fine])
4729
if (fineinput.method == def_fc_method-999) // see at defaults, no method card used
4731
fineinput.method = def_fc_method; // default method
4732
INFO.print("Default method will be used for fine coregistration.");
4734
if (specified(fineinput.ifpositions)) // filename specified
4736
if (fineinput.Nwin != def_fc_nwin+999) // something is specified
4738
WARNING << "FC_NWIN: \t" << fineinput.Nwin
4739
<< " ignored due to existence of input file (FC_IN_POS) "
4740
<< fineinput.ifpositions;
4743
fineinput.Nwin = filelines(fineinput.ifpositions);
4745
else if (fineinput.Nwin == def_fc_nwin+999) // no inputfile, default
4747
fineinput.Nwin = def_fc_nwin;
4748
INFO.print("Default number of windows will be used for fine coregistration.");
4750
checkfine(fineinput);
4753
// ====== Check input of TIMING step interferogram ====== [FvL]
4754
if (generalinput.process[pr_i_timing])
4756
checkreltiming(reltiminginput);
4759
// ====== Check input of DEMASSIST step interferogram ====== [FvL]
4760
if (generalinput.process[pr_i_demassist])
4762
checkdemassist(demassistinput);
4765
// ====== Check input step coregpm ======
4766
if (generalinput.process[pr_i_coregpm])
4768
checkcoregpm(coregpminput);
4771
// ====== Check + repair method selector resampling ======
4772
if (generalinput.process[pr_s_resample]) // request for process resample
4774
if (resampleinput.method == def_rs_method-999) // see at defaults, no method card used
4776
resampleinput.method = def_rs_method; // default method
4777
INFO.print("RS_METHOD: Using default.");
4779
if (!priorrs_fileout)
4780
INFO.print("RS_OUT_FILE: Using default.");
4781
checkresample(resampleinput);
4784
// ====== Check + repair method selector flatearth correction ======
4785
if (generalinput.process[pr_i_comprefpha])
4787
if (comprefphainput.method == def_fe_method-999) // see at defaults, no method card used
4789
comprefphainput.method = def_fe_method; // default method
4790
INFO.print("FE_METHOD: Using default.");
4792
if (comprefphainput.Npoints == def_fe_Npoints-999) // default applies
4794
comprefphainput.Npoints = def_fe_Npoints; // default value
4795
// INFO.print("FE_NPOINTS: Using default.");
4797
// ______ if read from file, count number of points ______
4798
if (specified(comprefphainput.ifpositions)) // filename specified
4800
INFO.print("FE_IN_POS: Using file to read positions.");
4801
comprefphainput.Npoints = filelines(comprefphainput.ifpositions);
4803
if (comprefphainput.degree == def_fe_degree-999) // default
4805
comprefphainput.degree = def_fe_degree; // default
4806
INFO.print("FE_DEGREE: Using default.");
4808
checkcomprefpha(comprefphainput);
4811
// ====== Check input of step interfero ======
4812
if (generalinput.process[pr_i_interfero])
4814
checkinterfero(interferoinput);
4817
// ====== Check input of SUBTRREFPHA step interferogram ======
4818
if (generalinput.process[pr_i_subtrrefpha])
4819
checksubtrrefpha(subtrrefphainput);
4821
// ====== Check input of COMPREFDEM step interferogram ======
4822
if (generalinput.process[pr_i_comprefdem])
4824
checkcomprefdem(comprefdeminput);
4827
// ====== Check input of SUBTRDEM step interferogram ======
4828
if (generalinput.process[pr_i_subtrrefdem])
4830
checksubtrrefdem(subtrrefdeminput);
4833
// ====== Check input of step coherence ======
4834
if (generalinput.process[pr_i_coherence])
4836
checkcoherence(coherenceinput);
4839
// ====== Check input of step phase filtering ======
4840
if (generalinput.process[pr_i_filtphase])
4842
if (!specified(filtphaseinput.fofiltphase)) // not specified, use default
4844
if (filtphaseinput.method==fp_goldstein || filtphaseinput.method==fp_modgoldstein)
4846
char dummy127[ONE27];
4847
ostrstream omemfo(dummy127,ONE27);
4848
omemfo << "cint." << filtphaseinput.alpha << "filtered" << ends;
4849
strcpy(filtphaseinput.fofiltphase,dummy127);
4850
if (filtphaseinput.kernel.size()==0)
4852
INFO.print("PF_KERNEL: Using default kernel [1 2 3 2 1].");
4853
filtphaseinput.kernel.resize(1,5);
4854
filtphaseinput.kernel(0,0) = 1./9.;
4855
filtphaseinput.kernel(0,1) = 2./9.;
4856
filtphaseinput.kernel(0,2) = 3./9.;
4857
filtphaseinput.kernel(0,3) = 2./9.;
4858
filtphaseinput.kernel(0,4) = 1./9.;
4861
else if (filtphaseinput.method==fp_spatialconv)
4863
strcpy(filtphaseinput.fofiltphase,"cint.filtered");
4864
// ______ Set default kernel ______
4865
if (!specified(filtphaseinput.fikernel2d)) // no input file
4867
if (filtphaseinput.kernel.size()==0)
4869
INFO.print("PF_KERNEL: Using default kernel [1 1 1].");
4870
filtphaseinput.kernel.resize(1,3);
4871
filtphaseinput.kernel(0,0) = 1./3.;
4872
filtphaseinput.kernel(0,1) = 1./3.;
4873
filtphaseinput.kernel(0,2) = 1./3.;
4877
else if (filtphaseinput.method==fp_spectral)
4879
strcpy(filtphaseinput.fofiltphase,"cint.filtered");
4883
PRINT_ERROR("Method filtphase not known")
4884
throw(keyword_error);
4887
checkfiltphase(filtphaseinput);
4891
// ====== Check input of step unwrapping ======
4892
if (generalinput.process[pr_i_unwrap]) // request for process unwrapping
4894
if (unwrapinput.method == def_uw_method-999) // see at defaults, no method card used
4896
unwrapinput.method = def_uw_method; // default method
4897
INFO.print("Default method will be used for unwrapping.");
4899
checkunwrap(unwrapinput);
4903
// ____ start added by HB ____
4904
// ====== Check input of step estorbits ======
4905
if (generalinput.process[pr_i_estorbits])
4907
// ______ check constraints______
4908
bool setDefaultConstraints = false;
4909
if(estorbitsinput.method==eo_gridsearch)
4911
if (estorbitsinput.poldegree != 1)
4913
estorbitsinput.poldegree = 1;
4914
WARNING.print("Degree of orbit error polynomial changed to 1 for method GRIDSEARCH");
4916
setDefaultConstraints = true;
4917
INFO.print("Using constraints for method GRIDSEARCH: BPAR0 BPERP1");
4919
else if (estorbitsinput.constrained==true && estorbitsinput.constraints.lines()==0)
4921
setDefaultConstraints = true;
4922
INFO.print("Using default orbit constraints: BPAR0 BPERP1");
4924
if (setDefaultConstraints)
4926
estorbitsinput.constraints = matrix<int16>(2,2);
4927
estorbitsinput.constraints(0,0) = 0;
4928
estorbitsinput.constraints(0,1) = 0;
4929
estorbitsinput.constraints(1,0) = 1;
4930
estorbitsinput.constraints(1,1) = 1;
4933
// ______ check selection method of observation points ______
4934
if (specified(estorbitsinput.ifpositions)) // filename specified
4936
if (estorbitsinput.nobs != 0) // something is specified
4938
WARNING << "EO_NOBS: \t" << estorbitsinput.nobs
4939
<< " ignored due to existence of input file (EO_IN_POS) "
4940
<< estorbitsinput.ifpositions;
4943
estorbitsinput.nobs = filelines(estorbitsinput.ifpositions);
4945
else if (estorbitsinput.nobs == 0) // no inputfile, default
4947
estorbitsinput.nobs = def_eo_nobs;
4948
INFO << "Default number of " << def_eo_nobs
4949
<< " observations will be used for orbit error estimation.";
4955
// ====== Check input of step slant2height ======
4956
if (generalinput.process[pr_i_slant2h])
4958
if (slant2hinput.method == def_s2h_method-999)
4960
slant2hinput.method = def_s2h_method; // default method
4961
INFO.print("Default method will be used for slant2h.");
4963
if (slant2hinput.Nheights <= slant2hinput.degree1d)
4965
WARNING << "S2H_NHEIGHTS: \t" << slant2hinput.Nheights
4966
<< " is too large because S2H_DEGREE1D="
4967
<< slant2hinput.degree1d
4968
<< "; set S2H_NHEIGHTS = " << slant2hinput.degree1d+1
4971
slant2hinput.Nheights = slant2hinput.degree1d + 1;
4973
checkslant2h(slant2hinput);
4977
// ====== Check input of step geocoding ======
4978
if (generalinput.process[pr_i_geocoding])
4980
checkgeocode(geocodeinput);
4983
// ====== Check input of dinsar step interferogram ======
4984
if (generalinput.process[pr_i_dinsar])
4986
if (!strcmp(dinsarinput.topomasterresfile,generalinput.m_resfile))
4987
setunspecified(dinsarinput.topomasterresfile); // used in check...
4988
checkdinsar(dinsarinput);
4989
if (!specified(dinsarinput.topomasterresfile))
4990
strcpy(dinsarinput.topomasterresfile,generalinput.m_resfile);
4993
// ====== Check input of reserved EXTRA step interferogram ======
4994
if (generalinput.process[pr_i_EXTRA2])
4996
PRINT_ERROR("extra step2 interferogram not implemented.")
4997
throw(keyword_error);
5002
// ====== Copy input to logfile (via scratchfile, update in main) ======
5003
// to avoid problems with not existing file it is always opened here
5004
ofstream scratchreadinput("scratchreadinput", ios::out | ios::trunc);
5005
bk_assert(scratchreadinput,"readinput: scratchreadinput",__FILE__,__LINE__);
5009
// ______Start writing______
5011
scratchreadinput << "\n----------------------------------------------------\n"
5012
<< " BEGIN: copy of input (non-interpretive).\n"
5013
<< "-line---keyword----argument-------------comment-----\n";
5014
optionsfile.seekg(0,ios::beg);
5015
optionsfile.clear(); // clear eofbit
5016
optionsfile.getline(eachline,4*ONE27,'\n');
5020
scratchreadinput << setw(3) << linecnt << ": " << eachline << endl;
5021
optionsfile.getline(eachline,4*ONE27,'\n');
5023
scratchreadinput << "\n----------------------------------------------------\n"
5024
<< " END: copy of input.\n"
5025
<< "----------------------------------------------------\n\n";
5026
DEBUG.print("Finished writing to scratchreadinput.");
5029
// ______Tidy up______
5030
PROGRESS.print("Interpretation inputoptionsfile finished.");
5031
scratchreadinput.close();
5032
optionsfile.close();
5037
/****************************************************************
5040
* Checks general cards. *
5041
* Repair process card *
5043
* Bert Kampes, 06-Sep-1999 *
5044
****************************************************************/
5046
input_gen &generalinput,
5047
const int16 onlyprocess)
5049
TRACE_FUNCTION("checkgeneral (BK 06-Sep-1999)")
5051
int32 cs_processcard = 0;
5053
// ______ Repair process control if ONLYPROCESS card was present ______
5054
for (i=0; i<NUMPROCESSES; i++)
5055
cs_processcard += generalinput.process[i];
5056
if (onlyprocess != -1) // initialized to -1;
5058
generalinput.interactive=false;
5059
INFO.print("ONLYPROCESS card present, batch processing.");
5060
if (cs_processcard == 1)
5061
WARNING.print("PROCESS card ignored due to presence ONLYPROCESS card.");
5062
if (cs_processcard > 1)
5063
WARNING.print("PROCESS cards ignored due to presence ONLYPROCESS card.");
5064
for (i=0; i<NUMPROCESSES; i++) // do not process anything...
5065
generalinput.process[i]=0;
5066
generalinput.process[onlyprocess]=1; // exept this one.
5069
else // check process card presence
5071
if (cs_processcard == 0) // no cards
5073
PRINT_ERROR("code 303: No (ONLY)PROCESS card present, exiting.")
5074
throw(keyword_error);
5078
INFO.print("\n\t*** General input cards ***");
5079
INFO << "MEMORY: \tAvailable to Doris [MB]: \t"
5080
<< generalinput.memory/1e6;
5083
INFO << "M_RESFILE: \tResultfile for master: \t\t"
5084
<< generalinput.m_resfile;
5086
INFO << "S_RESFILE: \tResultfile for slave: \t\t"
5087
<< generalinput.s_resfile;
5089
INFO << "I_RESFILE: \tResultfile for products: \t"
5090
<< generalinput.i_resfile;
5092
INFO << "LOGFILE: \tOut file for logging: \t\t"
5093
<< generalinput.logfile;
5095
INFO << "ORB_INTERP: \tmethod selector value:\t\t"
5096
<< generalinput.orb_interp;
5098
INFO << "ORB_PRM: \torbit parameters selection value:\t\t"
5099
<< generalinput.orb_prm;
5101
INFO << "DUMPBASELINE: evaluation grid for baseline: \t"
5102
<< generalinput.dumpbaselineL << " lines x "
5103
<< generalinput.dumpbaselineP << " pixels: ";
5105
INFO << "HEIGHT: \taverage terrain height:\t\t"
5106
<< generalinput.terrain_height;
5108
INFO << "TIEPOINT: \tlat/lon/hei: "
5109
<< generalinput.tiepoint.x << " "
5110
<< generalinput.tiepoint.y << " "
5111
<< generalinput.tiepoint.z;
5114
if (!strcmp(generalinput.m_resfile,generalinput.s_resfile))
5116
PRINT_ERROR("same name master and slave resultfile not allowed.")
5117
throw(keyword_error);
5119
if (!strcmp(generalinput.m_resfile,generalinput.i_resfile))
5121
PRINT_ERROR("same name master and interferogram resultfile not allowed.");
5122
throw(keyword_error);
5124
if (!strcmp(generalinput.m_resfile,generalinput.logfile))
5126
PRINT_ERROR("same name master resultfile and logfile not allowed.");
5127
throw(keyword_error);
5129
if (!strcmp(generalinput.i_resfile,generalinput.logfile))
5131
PRINT_ERROR("same name interferogram resultfile and logfile not allowed.");
5132
throw(keyword_error);
5134
} // END checkgeneral
5137
/****************************************************************
5140
* Checks cards for step readfiles. *
5142
* Bert Kampes, 06-Sep-1999 *
5143
****************************************************************/
5144
void checkreadfiles(
5145
const input_readfiles &readfilesinput,
5148
TRACE_FUNCTION("checkreadfiles (BK 06-Sep-1999)")
5152
INFO.print("\n\t*** Input for step M_READFILES (master) ***");
5153
INFO << "M_IN_METHOD: \tmethod selected for master: \t\t"
5154
<< readfilesinput.sensor_id;
5156
INFO << "M_IN_VOL: \tVolumefile of master: \t\t"
5157
<< readfilesinput.volfile;
5159
INFO << "M_IN_LEA: \tLeaderfile of master: \t\t"
5160
<< readfilesinput.leaderfile;
5162
INFO << "M_IN_NULL: \tNullfile of master: \t\t"
5163
<< readfilesinput.nullfile;
5165
INFO << "M_IN_DAT: \tDatfile of master: \t\t"
5166
<< readfilesinput.datfile;
5168
if (readfilesinput.sensor_id == SLC_ERS)
5170
if (!specified(readfilesinput.volfile))
5172
PRINT_ERROR("M_IN_VOL not defined");
5173
throw(keyword_error);
5175
if (!specified(readfilesinput.leaderfile))
5177
PRINT_ERROR("M_IN_LEA not defined");
5178
throw(keyword_error);
5180
if (!specified(readfilesinput.nullfile))
5181
WARNING.print("M_IN_NULL not defined");
5183
// ___ use datfile for asar input file ___
5184
if (!specified(readfilesinput.datfile))
5186
PRINT_ERROR("M_IN_DAT not defined");
5187
throw(keyword_error);
5189
if (readfilesinput.sensor_id == SLC_TSX) // [MA] TSX
5191
if (!specified(readfilesinput.leaderfile)) // if changed, update also processor for leaderfile
5193
PRINT_ERROR("M_IN_LEA not defined");
5194
throw(keyword_error);
5197
if (readfilesinput.sensor_id == SLC_RS2 || readfilesinput.sensor_id == SLC_RS2_QUAD ) // [MA] RS2
5199
if (!specified(readfilesinput.leaderfile)) // if changed, update also processor for leaderfile
5201
PRINT_ERROR("M_IN_LEA not defined");
5202
throw(keyword_error);
5205
if (readfilesinput.sensor_id == SLC_CSK || readfilesinput.sensor_id == SLC_CSK_POL ) // [MA] CSK
5207
//if (!specified(readfilesinput.leaderfile)) // if changed, update also processor for leaderfile
5208
if (!specified(readfilesinput.datfile)) // if changed, update also processor for leaderfile
5210
//PRINT_ERROR("M_IN_LEA not defined");
5211
PRINT_ERROR("M_IN_DAT not defined");
5212
throw(keyword_error);
5218
INFO.print("\n\t*** Input for step S_READFILES (slave) ***");
5219
INFO << "S_IN_METHOD: \tmethod selected for slave: \t\t"
5220
<< readfilesinput.sensor_id;
5222
INFO << "S_IN_VOL: \tvolumefile of slave: \t\t"
5223
<< readfilesinput.volfile;
5225
INFO << "S_IN_LEA: \tleaderfile of slave: \t\t"
5226
<< readfilesinput.leaderfile;
5228
INFO << "S_IN_NULL: \tnullfile of slave: \t\t"
5229
<< readfilesinput.nullfile;
5231
INFO << "S_IN_DAT: \tdatfile of slave: \t\t"
5232
<< readfilesinput.datfile;
5234
if (readfilesinput.sensor_id == SLC_ERS)
5236
if (!specified(readfilesinput.volfile))
5238
PRINT_ERROR("S_IN_VOL not defined");
5239
throw(keyword_error);
5241
if (!specified(readfilesinput.leaderfile))
5243
PRINT_ERROR("S_IN_LEA not defined");
5244
throw(keyword_error);
5246
if (!specified(readfilesinput.nullfile))
5247
WARNING.print("S_IN_NULL not defined");
5249
// ___ use datfile for asar input file ___
5250
if (!specified(readfilesinput.datfile))
5252
PRINT_ERROR("S_IN_DAT not defined");
5253
throw(keyword_error);
5255
if (readfilesinput.sensor_id == SLC_TSX) // [MA] TSX
5257
if (!specified(readfilesinput.leaderfile)) // if changed, update also processor.cc for the [leader]file
5259
PRINT_ERROR("S_IN_LEA not defined");
5260
throw(keyword_error);
5263
if (readfilesinput.sensor_id == SLC_RS2 || readfilesinput.sensor_id == SLC_RS2_QUAD ) // [MA] RS2
5265
if (!specified(readfilesinput.leaderfile)) // if changed, update also processor for leaderfile
5267
PRINT_ERROR("S_IN_LEA not defined");
5268
throw(keyword_error);
5271
if (readfilesinput.sensor_id == SLC_CSK || readfilesinput.sensor_id == SLC_CSK_POL ) // [MA] CSK
5273
//if (!specified(readfilesinput.leaderfile)) // if changed, update also processor for leaderfile
5274
if (!specified(readfilesinput.datfile)) // if changed, update also processor for leaderfile
5276
PRINT_ERROR("S_IN_DAT not defined");
5277
throw(keyword_error);
5283
PRINT_ERROR("panic: impossible");
5284
throw(keyword_error);
5286
if (readfilesinput.sensor_id == SLC_ERS)
5288
if (!strcmp(readfilesinput.volfile,readfilesinput.leaderfile))
5290
PRINT_ERROR("same file name volume and leader file not allowed.");
5291
throw(keyword_error);
5293
if (!strcmp(readfilesinput.volfile,readfilesinput.nullfile))
5295
PRINT_ERROR("same file name volume and null file not allowed.");
5296
throw(keyword_error);
5298
if (!strcmp(readfilesinput.volfile,readfilesinput.datfile))
5300
PRINT_ERROR("same file name volume and data file not allowed.");
5301
throw(keyword_error);
5303
if (!strcmp(readfilesinput.leaderfile,readfilesinput.nullfile))
5305
PRINT_ERROR("same file name leader and null file not allowed.");
5306
throw(keyword_error);
5308
if (!strcmp(readfilesinput.leaderfile,readfilesinput.datfile))
5310
PRINT_ERROR("same file name leader and data file not allowed.");
5311
throw(keyword_error);
5313
if (!strcmp(readfilesinput.nullfile,readfilesinput.datfile))
5315
PRINT_ERROR("same file name null and data file not allowed.");
5316
throw(keyword_error);
5319
} // END checkreadfiles
5322
/****************************************************************
5325
* Checks cards for step crop. *
5327
* Bert Kampes, 06-Sep-1999 *
5328
****************************************************************/
5330
const input_crop &cropinput,
5333
TRACE_FUNCTION("checkcrop (BK 06-Sep-1999)")
5337
INFO.print("\n\t*** Input for step M_CROP (master) ***");
5338
INFO << "M_IDCROP: \tidentifier master write slc data to raster format: \t"
5339
<< cropinput.idcrop;
5341
INFO << "M_CROP_IN: \tslc data inputfile for master: \t"
5342
<< cropinput.filein1;
5344
INFO << "M_CROP_OUT: \traw data outputfile for master: \t"
5345
<< cropinput.fileout1;
5347
INFO << "M_DBOW: \tProcessing master line "
5348
<< cropinput.dbow.linelo << " to "
5349
<< cropinput.dbow.linehi << ". pixel "
5350
<< cropinput.dbow.pixlo << " to "
5351
<< cropinput.dbow.pixhi << ".";
5353
if (cropinput.dbow_geo.pixhi != 0)
5355
INFO.print("M_DBOW_GEO: overrides M_DBOW! processing: ");
5356
INFO << "center latitude " << cropinput.dbow_geo.linelo/1e6-360.0 <<
5357
"; center longitude " << cropinput.dbow_geo.linehi/1e6-360.0 <<
5358
"; height, width: " << cropinput.dbow_geo.pixlo << ", " <<
5359
cropinput.dbow_geo.pixhi;
5365
INFO.print("\n\t*** Input for step S_CROP (slave) ***");
5366
INFO << "S_IDCROP: \tidentifier slave write slc data to raster format: \t"
5367
<< cropinput.idcrop;
5369
INFO << "S_CROP_IN: \tslc data inputfile for slave: \t"
5370
<< cropinput.filein1;
5372
INFO << "S_CROP_OUT: \traw data outputfile for slave: \t"
5373
<< cropinput.fileout1;
5375
INFO << "S_DBOW: \tProcessing slave line "
5376
<< cropinput.dbow.linelo << " to "
5377
<< cropinput.dbow.linehi << ". pixel "
5378
<< cropinput.dbow.pixlo << " to "
5379
<< cropinput.dbow.pixhi << ".";
5381
if (cropinput.dbow_geo.pixhi != 0)
5383
INFO.print("S_DBOW_GEO: overrides S_DBOW! processing: ");
5384
INFO << "center latitude " << cropinput.dbow_geo.linelo/1e6-360.0 <<
5385
"; center longitude " << cropinput.dbow_geo.linehi/1e6-360.0 <<
5386
"; height, width: " << cropinput.dbow_geo.pixlo << ", " <<
5387
cropinput.dbow_geo.pixhi;
5393
PRINT_ERROR("panic: impossible");
5394
throw(keyword_error);
5399
//____RaffaeleNutricato START MODIFICATION SECTION 11
5400
/****************************************************************
5403
* Checks cards for step oversample. *
5405
* Raffaele Nutricato, 12-Jan-2004 *
5406
****************************************************************/
5407
void checkoversample(
5408
const input_oversample &oversampleinput,
5411
TRACE_FUNCTION("checkoversample (Raffaele Nutricato 12-Jan-2004)")
5415
INFO.print("\n\t*** Input for step M_OVS (master) ***");
5416
INFO << "M_OVS_OUT: \t\tData output file for ovs master: "
5417
<< oversampleinput.fileoutovs; // Output file for the oversampled master
5419
INFO << "M_OVS_FACT_RNG: \tOversampling ratio in the master range direction: "
5420
<< oversampleinput.OsrRange; // Oversampling ratio in the range direction.
5422
INFO << "M_OVS_FACT_AZI: \tOversampling ratio in the master azimuth direction: "
5423
<< oversampleinput.OsrAzimuth; // Oversampling ratio in the azimuth direction.
5425
INFO << "M_OVS_KERNELSIZE: \tKernel length for the master oversampling: "
5426
<< oversampleinput.FilterSize; // Length of the interpolation kernel in range.
5428
INFO << "M_OVS_OUT_FORMAT: \tOutput data format for the oversampled master: " ;
5429
if (oversampleinput.oformatflag==FORMATCR4)
5430
INFO << "complex_real4";
5431
if (oversampleinput.oformatflag==FORMATCI2)
5432
INFO << "complex_short";
5437
INFO.print("\n\t*** Input for step S_OVS (slave) ***");
5438
INFO << "S_OVS_OUT: \t\tData output file for ovs slave: "
5439
<< oversampleinput.fileoutovs; // Output file for the oversampled slave
5441
INFO << "S_OVS_FACT_RNG: \tOversampling ratio in the slave range direction: "
5442
<< oversampleinput.OsrRange; // Oversampling ratio in the range direction.
5444
INFO << "S_OVS_FACT_AZI: \tOversampling ratio in the slave azimuth direction: "
5445
<< oversampleinput.OsrAzimuth; // Oversampling ratio in the azimuth direction.
5447
INFO << "S_OVS_KERNELSIZE: \tKernel length for the slave oversampling: "
5448
<< oversampleinput.FilterSize; // Length of the interpolation kernel in range.
5450
INFO << "S_OVS_OUT_FORMAT: \tOutput data format for the oversampled slave: " ;
5451
if (oversampleinput.oformatflag==FORMATCR4)
5452
INFO << "complex_real4";
5453
if (oversampleinput.oformatflag==FORMATCI2)
5454
INFO << "complex_short";
5459
PRINT_ERROR("panic: impossible");
5460
throw(keyword_error);
5462
} // END checkoversample
5464
//____RaffaeleNutricato END MODIFICATION SECTION 11
5467
/****************************************************************
5470
* Checks cards for step porbits. *
5472
* Bert Kampes, 06-Sep-1999 *
5473
****************************************************************/
5475
const input_pr_orbits &porbitsinput,
5478
TRACE_FUNCTION("checkporbits (BK 06-Sep-1999)")
5482
INFO.print("\n\t*** Input for step M_PORBITS (master) ***");
5483
INFO << "M_ORBDIR: \tPrecise orbits master in: "
5484
<< porbitsinput.m_orbdir;
5486
if (!specified(porbitsinput.m_orbdir))
5488
PRINT_ERROR("M_ORBDIR: no directory specified.");
5489
throw(keyword_error);
5494
INFO.print("\n\t*** Input for step S_PORBITS (slave) ***");
5495
INFO << "S_ORBDIR: \tPrecise orbits slave in: "
5496
<< porbitsinput.s_orbdir;
5498
if (!specified(porbitsinput.s_orbdir))
5500
PRINT_ERROR("S_ORBDIR: no directory specified.");
5501
throw(keyword_error);
5506
PRINT_ERROR("panic: impossible");
5507
throw(keyword_error);
5509
INFO << "ORB_INTERVAL: \ttime between ephemerides: \t"
5510
<< porbitsinput.timeinterval;
5512
INFO << "ORB_EXTRATIME: \ttime before first, after last line: \t"
5513
<< porbitsinput.timebefore;
5515
if (!porbitsinput.dumpmasterorbit<0)
5516
INFO.print("dumping masterorbit to file.");
5517
if (!porbitsinput.dumpslaveorbit<0)
5518
INFO.print("dumping slaveorbit to file.");
5519
} // END checkporbits
5522
/****************************************************************
5525
* Checks cards for step slant2h. *
5527
* Bert Kampes, 29-Sep-1999 *
5528
****************************************************************/
5530
const input_slant2h &slant2hinput)
5532
TRACE_FUNCTION("checkslant2h (BK 29-Sep-1999)")
5533
INFO.print("\n\t*** Input for step SLANT2H ***");
5534
switch (slant2hinput.method)
5536
case s2h_schwabisch:
5537
INFO.print("Method schwabisch is used for slant2height conversion.");
5539
INFO << "S2H_NPOINTS: \tNumber of points used in computation: "
5540
<< slant2hinput.Npoints;
5542
INFO << "S2H_DEGREE1D: \tDegree of 1d polynomial at each point: "
5543
<< slant2hinput.degree1d;
5545
INFO << "S2H_DEGREE2D: \tDegree of 2d polynomial to compute "
5546
<< "coefficients of 1D polynomial: "
5547
<< slant2hinput.degree2d;
5549
INFO << "S2H_NHEIGHTS: \t#heights evaluation ref. phase for 1d polynomial: "
5550
<< slant2hinput.Nheights;
5555
INFO.print("Method exact is used for slant2height conversion.");
5556
INFO << "S2H_OUT_LAM: \tData output file for lambda: "
5557
<< slant2hinput.folam;
5559
INFO << "S2H_OUT_PHI: \tData output file for phi: "
5560
<< slant2hinput.fophi;
5562
if (!strcmp(slant2hinput.folam,slant2hinput.fophi))
5564
PRINT_ERROR("Same filename S2H_OUT_LAM and S2H_OUT_PHI not allowed.");
5565
throw(keyword_error);
5567
if (!strcmp(slant2hinput.fohei,slant2hinput.fophi))
5569
PRINT_ERROR("Same filename S2H_OUT_HEI and S2H_OUT_PHI not allowed.");
5570
throw(keyword_error);
5572
if (!strcmp(slant2hinput.folam,slant2hinput.fohei))
5574
PRINT_ERROR("Same filename S2H_OUT_LAM and S2H_OUT_HEI not allowed.");
5575
throw(keyword_error);
5580
DEBUG.print("do some checks here as well.");
5584
PRINT_ERROR("impossible, unknown method s2h");
5585
throw(keyword_error);
5588
INFO << "S2H_OUT_HEI: Data output file for height: "
5589
<< slant2hinput.fohei;
5591
} // END checkslant2h
5594
/****************************************************************
5597
* Checks cards for step unwrap. *
5599
* Bert Kampes, 29-Sep-1999 *
5600
****************************************************************/
5602
const input_unwrap &unwrapinput)
5604
TRACE_FUNCTION("checkunwrap (BK 29-Sep-1999)")
5605
INFO.print("\n\t*** Input for step UNWRAP ***");
5606
INFO << "UW_OUT_FILE: \tOutput data file for unwrapped interferogram: "
5607
<< unwrapinput.fouint;
5609
INFO << "UW_OUT_FORMAT: \tOutput data format for unwrapped interferogram: "
5610
<< unwrapinput.oformatflag;
5612
switch (unwrapinput.method)
5615
INFO.print("Method 1 is used for unwrapping (treef_ramon unix calls).");
5616
INFO << "UW_SEEDS: ";
5617
if (isspace(unwrapinput.seedfile[0])) // no file specified
5618
INFO << "Delta seed in line/pixel direction: "
5619
<< unwrapinput.deltaLseed << " " << unwrapinput.deltaPseed;
5621
INFO << " Input file with seeds for unwrapping: "
5622
<< unwrapinput.seedfile;
5624
INFO << "UW_OUT_REGIONS: \tOutput data file with region numbers: "
5625
<< unwrapinput.foregions;
5630
INFO.print("Method 2: SNAPHU is used for unwrapping.");
5631
INFO.print("Please make sure snaphu is installed. check results carefuly.");
5632
INFO << "UW_SNAPHU_LOG: \tOutput log file of snaphu: "
5633
<< unwrapinput.snaphu_log;
5635
INFO << "UW_SNAPHU_INIT: \tinitialization method of snaphu: "
5636
<< unwrapinput.snaphu_init;
5638
INFO << "UW_SNAPHU_COH: \tinput coherence file for snaphu: "
5639
<< unwrapinput.snaphu_coh;
5641
INFO << "UW_SNAPHU_MODE: \tsnaphu mode: "
5642
<< unwrapinput.snaphu_mode;
5647
INFO.print("Method 3 is used for unwrapping (?).");
5648
PRINT_ERROR("only for delft, standalone application.");
5649
throw(keyword_error);
5653
PRINT_ERROR("probably forgot to update this, should not be possible.");
5654
throw(keyword_error);
5656
} // END checkunwrap
5659
/****************************************************************
5662
* Checks cards for step geocode. *
5664
* Bert Kampes, 29-Sep-1999 *
5665
****************************************************************/
5667
const input_geocode &geocodeinput)
5669
TRACE_FUNCTION("checkgeocode (BK 29-Sep-1999)")
5670
INFO.print("\n\t*** Input for step GEOCODE ***");
5671
INFO << "GEO_OUT_PHI: \tOutput file for latitude: \t"
5672
<< geocodeinput.fophi;
5674
INFO << "GEO_OUT_PHI: \tOutput file for longitude: \t"
5675
<< geocodeinput.folam;
5677
if (!strcmp(geocodeinput.fophi,geocodeinput.folam))
5679
ERROR << "Same file name GEO_OUT_PHI and GEO_OUT_LAM not allowed.";
5680
PRINT_ERROR(ERROR.get_str())
5681
throw(keyword_error);
5683
} // END checkgeocode
5687
/****************************************************************
5690
* Checks cards for step coarsecorr. *
5692
* Bert Kampes, 29-Sep-1999 *
5693
****************************************************************/
5694
void checkcoarsecorr(
5695
const input_coarsecorr &coarsecorrinput)
5697
TRACE_FUNCTION("checkcoarsecorr (BK 29-Sep-1999)")
5698
INFO.print("\n\t*** Input for step COARSE_CORR ***");
5699
switch (coarsecorrinput.method)
5702
INFO.print("CC_METHOD: \tMAGFFT is used for coarse correlation."); break;
5704
INFO.print("CC_METHOD: \tMAGSPACE is used for coarse correlation."); break;
5706
PRINT_ERROR("panic.");
5707
throw(keyword_error);
5709
if (specified(coarsecorrinput.ifpositions))
5711
INFO << "CC_IN_POS: \tFile: " << coarsecorrinput.ifpositions
5712
<< " containing " << coarsecorrinput.Nwin
5713
<< " positions is used.";
5716
else // no input file
5718
INFO << "CC_NWIN: \tDistributing "
5719
<< coarsecorrinput.Nwin
5720
<< " windows for coarse coregistration based on correlation.";
5723
} // END checkcoarsecorr
5726
/****************************************************************
5729
* Checks cards for step fine. *
5731
* Bert Kampes, 29-Sep-1999 *
5732
****************************************************************/
5734
const input_fine &fineinput)
5736
TRACE_FUNCTION("checkfine (BK 29-Sep-1999)")
5737
INFO.print("\n\t*** Input for step FINE ***");
5738
switch (fineinput.method)
5740
// case fc_cmplxfft:
5741
// INFO.print("FC_METHOD: \tCMPLXFFT is used for fine correlation.");
5743
// case fc_cmplxspace:
5744
// INFO.print("FC_METHOD: \tCMPLXSPACE is used for fine correlation.");
5747
INFO.print("FC_METHOD: \tMAGFFT is used for fine correlation.");
5750
INFO.print("FC_METHOD: \tMAGSPACE is used for fine correlation.");
5753
INFO.print("FC_METHOD: \tOVERSAMPLE is used for fine correlation.");
5756
PRINT_ERROR("panic.");
5757
throw(keyword_error);
5760
if (specified(fineinput.ifpositions))
5762
INFO << "FC_IN_POS: File: "
5763
<< fineinput.ifpositions
5765
<< fineinput.Nwin << " positions is used.";
5768
else // no input file
5770
INFO << "FC_NWIN: \tDistributing "
5772
<< " windows for fine coregistration.";
5775
if (fineinput.plotoffsets)
5777
INFO << "FC_PLOT " << fineinput.plotthreshold
5778
<< ": Plotting estimated offsets with correlation > "
5779
<< fineinput.plotthreshold;
5784
WARNING.print("It is highly recommended to use FC_PLOT to plot the computed FINE offset vectors.");
5786
if (fineinput.plotmagbg)
5787
INFO.print("FC_PLOT: magnitude will be in background of plot.");
5789
INFO << "FC_WINSIZE for correlation: (l,p) = ("
5790
<< fineinput.MasksizeL << ", "
5791
<< fineinput.MasksizeP << ").";
5793
INFO.print("Max. estimable offset is half the window size");
5794
INFO.print("If the offset varies a lot over the image, use larger winsize");
5795
INFO << "FC_WINSIZE for oversampling (2*Acc): (l,p) = ("
5796
<< 2*fineinput.AccL << ", "
5797
<< 2*fineinput.AccP << ").";
5799
INFO << "FC_OSFACTOR: "
5800
<< fineinput.osfactor
5801
<< ". Oversampling factor for fine coregistration.";
5803
if (!ispower2(fineinput.osfactor))
5805
ERROR << " no power of 2.";
5806
PRINT_ERROR(ERROR.get_str())
5807
throw(keyword_error);
5812
/****************************************************************
5815
* Checks cards for step simamp. *
5817
* Mahmut Arikan, 30-Oct-2008 *
5818
****************************************************************/
5820
const input_simamp &simampinput)
5822
TRACE_FUNCTION("checksimamp (MA 30-oct-2008)")
5823
INFO.print("\n\t*** Input for step SIMAMP ***");
5824
INFO << "SAM_IN_DEM: \t" << simampinput.firefdem;
5826
if (specified(simampinput.fothetalp)) // MA SPT
5828
INFO << "SAM_OUT_THETA_LP: \t" << simampinput.fothetalp
5829
<< "; output requested of incidence angle THETA [rad] in radar coordinates.";
5832
if (specified(simampinput.fodemlp)) // MA SPT
5834
INFO << "SAM_OUT_DEM_LP: \t" << simampinput.fodemlp
5835
<< "; output requested of DEM [m] in radar coordinates.";
5838
if (specified(simampinput.fodem))
5840
INFO << "SAM_OUT_DEM: \t" << simampinput.fodem
5841
<< "; output requested of input DEM.";
5843
if (!strcmp(simampinput.fosimamp,simampinput.fodem))
5845
PRINT_ERROR("OUT_DEM, OUT_FILE: Same output file name.");
5846
throw(keyword_error);
5849
if (specified(simampinput.fosimamp))
5851
INFO << "SAM_OUT_FILE: \t" << simampinput.fosimamp
5852
<< "; output requested of simulated amplitude.";
5854
if (!strcmp(simampinput.fosimamp,simampinput.fodem))
5856
PRINT_ERROR("OUT_DEM, OUT_FILE: Same output file name.");
5857
throw(keyword_error);
5860
INFO << "SAM_IN_SIZE: \t" << simampinput.demrows
5861
<< " " << simampinput.demcols
5862
<< "; number of rows (latitude), columns (lon) in DEM.";
5864
INFO << "SAM_IN_UL: \t"
5865
<< rad2deg(simampinput.demlatleftupper) << " "
5866
<< rad2deg(simampinput.demlonleftupper)
5867
<< "; coordinates of upper left corner (first row/col).";
5869
INFO << "SAM_IN_DELTA: \t"
5870
<< rad2deg(simampinput.demdeltalat) << " "
5871
<< rad2deg(simampinput.demdeltalon);
5873
INFO << "SAM_IN_NODATA: \t" << simampinput.demnodata
5874
<< "; this number in DEM will be set to 0 reference phase.";
5877
INFO << "SAM_IN_FORMAT: \tinput format DEM: \t";
5878
switch (simampinput.iformatflag)
5887
INFO << "signed short.";
5889
case FORMATI2_BIGENDIAN:
5890
INFO << "signed short big endian.";
5893
PRINT_ERROR("totally impossible, checked input.");
5894
throw(keyword_error);
5900
// ______ Check some things ______
5901
if (!existed(simampinput.firefdem))
5903
ERROR << "SAM_IN_DEM: \t" << simampinput.firefdem
5904
<< " can not be opened.";
5905
PRINT_ERROR(ERROR.get_str())
5906
throw(keyword_error);
5908
if (rad2deg(simampinput.demdeltalat)<.0002) // [MA] 1 arc secs = 1/3600=0.00027 : allow finer resolutions
5910
WARNING << "SAM_IN_DELTA: \t" << rad2deg(simampinput.demdeltalat)
5911
<< " [deg] seems very small (input in decimal degrees).";
5914
if (simampinput.demrows<1 || simampinput.demrows>100000)
5916
WARNING << "SAM_DEM_SIZE: numrows: \t" << simampinput.demrows
5917
<< " seems to be wrong.";
5920
if (simampinput.demcols<1 || simampinput.demcols>100000)
5922
WARNING << "SAM_DEM_SIZE: numcols: \t" << simampinput.demcols
5923
<< " seems to be wrong.";
5926
if (rad2deg(simampinput.demdeltalon)<.0002)
5928
WARNING << "SAM_IN_DELTA: \t" << simampinput.demdeltalon
5929
<< " seems very small (it should be in decimal degrees).";
5932
if (rad2deg(simampinput.demlatleftupper) < -90. ||
5933
rad2deg(simampinput.demlatleftupper) > 90. )
5935
ERROR << "SAM_IN_LU: \t" << rad2deg(simampinput.demlatleftupper)
5936
<< " out of range (-90:90).";
5937
PRINT_ERROR(ERROR.get_str())
5938
throw(keyword_error);
5940
if (rad2deg(simampinput.demlonleftupper) < -180. ||
5941
rad2deg(simampinput.demlonleftupper) > 180. )
5943
WARNING << "SAM_IN_LU: \t" << rad2deg(simampinput.demlonleftupper)
5944
<< " out of range (-180:180).";
5947
} // END simamp [MA]
5951
/****************************************************************
5954
* Checks cards for step simamp corr. *
5956
* Mahmut Arikan, 11-Nov-2008 *
5957
****************************************************************/
5959
const input_mtiming &mtiminginput)
5961
TRACE_FUNCTION("checkmtiming (MA, BO 11-Nov-2008)")
5962
INFO.print("\n\t*** Input for step MASTER TIMING ***");
5963
switch (mtiminginput.method)
5966
INFO.print("MTE_METHOD: \tMAGFFT is used for MASTER TIMING ERROR estimation."); break;
5968
INFO.print("MTE_METHOD: \tMAGSPACE is used for MASTER TIMING ERROR estimation."); break;
5970
PRINT_ERROR("panic.");
5971
throw(keyword_error);
5973
if (specified(mtiminginput.ifpositions))
5975
INFO << "MTE_IN_POS: \tFile: " << mtiminginput.ifpositions
5976
<< " containing " << mtiminginput.Nwin
5977
<< " positions is used.";
5980
else // no input file
5982
INFO << "MTE_NWIN: \tDistributing "
5983
<< mtiminginput.Nwin
5984
<< " windows for master timing error estimation (correlation).";
5987
} // END checkmtiming
5990
// ____end added by MA ____
5993
// ____start added by FvL ____
5995
/****************************************************************
5998
* Checks cards for step timing *
6000
* Freek van Leijen, 22-Aug-2007 *
6001
****************************************************************/
6002
void checkreltiming(
6003
const input_reltiming &timinginput)
6005
TRACE_FUNCTION("checkreltiming (FvL 22-aug-2007)")
6006
INFO.print("\n\t*** Input for step REL_TIMING ***");
6007
INFO << "RTE_THRESHOLD: \tThreshold correlation for model: \t"
6008
<< timinginput.threshold;
6010
INFO << "RTE_MAXITER: \tNumber of points to remove (max): \t"
6011
<< timinginput.maxiter;
6013
INFO << "RTE_K_ALPHA: \tCritical value for outlier test: \t"
6014
<< timinginput.k_alpha;
6016
} // END checkreltiming
6019
/****************************************************************
6022
* Checks cards for step demassist. *
6024
* Freek van Leijen, 22-Aug-2007 *
6025
****************************************************************/
6026
void checkdemassist(
6027
const input_demassist &demassistinput)
6029
TRACE_FUNCTION("checkdemassist (FvL 22-aug-2007)")
6030
INFO.print("\n\t*** Input for step DEMASSIST ***");
6031
INFO << "DAC_IN_DEM: \t" << demassistinput.firefdem;
6033
if (specified(demassistinput.forefdemhei))
6035
INFO << "DAC_OUT_DEM_LP: \t" << demassistinput.forefdemhei
6036
<< "; output requested of DEM [m] in radar coordinates.";
6039
if (specified(demassistinput.fodem))
6041
INFO << "DAC_OUT_DEM: \t" << demassistinput.fodem
6042
<< "; output requested of input DEM.";
6044
if (!strcmp(demassistinput.fodemi,demassistinput.fodem))
6046
PRINT_ERROR("OUT_DEM, OUT_DEMI: Same output file name.");
6047
throw(keyword_error);
6050
if (specified(demassistinput.fodemi))
6052
INFO << "DAC_OUT_DEMI: \t" << demassistinput.fodemi
6053
<< "; output requested of interpolated DEM.";
6055
if (!strcmp(demassistinput.fodemi,demassistinput.fodem))
6057
PRINT_ERROR("OUT_DEM, OUT_DEMI: Same output file name.");
6058
throw(keyword_error);
6061
INFO << "DAC_IN_SIZE: \t" << demassistinput.demrows
6062
<< " " << demassistinput.demcols
6063
<< "; number of rows (latitude), columns (lon) in DEM.";
6065
INFO << "DAC_IN_UL: \t"
6066
<< rad2deg(demassistinput.demlatleftupper) << " "
6067
<< rad2deg(demassistinput.demlonleftupper)
6068
<< "; coordinates of upper left corner (first row/col).";
6070
INFO << "DAC_IN_DELTA: \t"
6071
<< rad2deg(demassistinput.demdeltalat) << " "
6072
<< rad2deg(demassistinput.demdeltalon);
6074
INFO << "DAC_IN_NODATA: \t" << demassistinput.demnodata
6075
<< "; this number in DEM will be set to 0 reference phase.";
6078
INFO << "DAC_IN_FORMAT: \tinput format DEM: \t";
6079
switch (demassistinput.iformatflag)
6088
INFO << "signed short.";
6090
case FORMATI2_BIGENDIAN:
6091
INFO << "signed short big endian.";
6094
PRINT_ERROR("totally impossible, checked input.");
6095
throw(keyword_error);
6101
// ______ Check some things ______
6102
if (!existed(demassistinput.firefdem))
6104
ERROR << "DAC_IN_DEM: \t" << demassistinput.firefdem
6105
<< " can not be opened.";
6106
PRINT_ERROR(ERROR.get_str())
6107
throw(keyword_error);
6109
if (rad2deg(demassistinput.demdeltalat)<.0002) //[MA] 1 arc secs = 1/3600=0.00027 : allow finer resolutions
6111
WARNING << "DAC_IN_DELTA: \t" << rad2deg(demassistinput.demdeltalat)
6112
<< " [deg] seems very small (input in decimal degrees).";
6115
if (demassistinput.demrows<1 || demassistinput.demrows>100000)
6117
WARNING << "DAC_DEM_SIZE: numrows: \t" << demassistinput.demrows
6118
<< " seems to be wrong.";
6121
if (demassistinput.demcols<1 || demassistinput.demcols>100000)
6123
WARNING << "DAC_DEM_SIZE: numcols: \t" << demassistinput.demcols
6124
<< " seems to be wrong.";
6127
if (rad2deg(demassistinput.demdeltalon)<.0002)
6129
WARNING << "DAC_IN_DELTA: \t" << demassistinput.demdeltalon
6130
<< " seems very small (it should be in decimal degrees).";
6133
if (rad2deg(demassistinput.demlatleftupper) < -90. ||
6134
rad2deg(demassistinput.demlatleftupper) > 90. )
6136
ERROR << "DAC_IN_LU: \t" << rad2deg(demassistinput.demlatleftupper)
6137
<< " out of range (-90:90).";
6138
PRINT_ERROR(ERROR.get_str())
6139
throw(keyword_error);
6141
if (rad2deg(demassistinput.demlonleftupper) < -180. ||
6142
rad2deg(demassistinput.demlonleftupper) > 180. )
6144
WARNING << "DAC_IN_LU: \t" << rad2deg(demassistinput.demlonleftupper)
6145
<< " out of range (-180:180).";
6150
// ____end added by FvL ____
6153
/****************************************************************
6156
* Checks cards for step coregpm. *
6158
* Bert Kampes, 29-Sep-1999 *
6159
****************************************************************/
6161
const input_coregpm &coregpminput)
6163
TRACE_FUNCTION("checkcoregpm (BK 29-Sep-1999)")
6164
INFO.print("\n\t*** Input for step COREGPM ***");
6165
INFO << "CPM_THRESHOLD: \tThreshold correlation for model: \t"
6166
<< coregpminput.threshold;
6168
INFO << "CPM_DEGREE: \tPolynomial for coregistration: \t"
6169
<< coregpminput.degree;
6171
INFO << "CPM_WEIGHT: \tData weighting option: \t"
6172
<< coregpminput.weightflag
6173
<< " (0 none, 1 linear, 2 quadratic, 3 bamler paper) is used.";
6175
INFO << "CPM_MAXITER: \tNumber of points to remove (max): \t"
6176
<< coregpminput.maxiter;
6178
INFO << "CPM_K_ALPHA: \tCritical value for outlier test: \t"
6179
<< coregpminput.k_alpha;
6181
if (coregpminput.dumpmodel)
6182
INFO.print("CPM_DUMP: dumping model to files (see INFO).");
6183
if (coregpminput.plot)
6184
INFO.print("CPM_PLOT: error vectors etc. will be plotted.");
6186
WARNING.print("It is higly recommended to use CPM_PLOT to review the estimated model.");
6187
if (coregpminput.plotmagbg)
6188
INFO.print("CPM_PLOT: magnitude will be in background.");
6189
} // END checkcoregpm
6192
/****************************************************************
6195
* Checks cards for step comprefpha. *
6197
* Bert Kampes, 29-Sep-1999 *
6198
****************************************************************/
6199
void checkcomprefpha(
6200
const input_comprefpha &comprefphainput)
6202
TRACE_FUNCTION("checkcomprefpha (BK 29-Sep-1999)")
6203
INFO.print("\n\t*** Input for step COMPREFPHA ***");
6204
switch (comprefphainput.method)
6207
INFO.print("FE_METHOD: method for flatearth correction: PORBITS");
6208
// ______ Check points from file or random distributed ______
6209
if (specified(comprefphainput.ifpositions))
6211
INFO << "FE_IN_POS: file: "
6212
<< comprefphainput.ifpositions
6214
<< comprefphainput.Npoints << " positions used for ref. phase estimation.";
6217
else // no input file
6219
INFO << "FE_NPOINTS: Using " << comprefphainput.Npoints
6220
<< " (random like) distributed points for estimation of refpha polynomial.";
6223
if (comprefphainput.Npoints > 5000)
6224
WARNING.print("FE_NPOINTS: Too many points requested?");
6225
INFO << "FE_DEGREE: Using " << comprefphainput.degree
6226
<< " order polynomial for flat Earth correction.";
6228
if (comprefphainput.degree > 10)
6229
WARNING.print("FE_DEGREE: degree > 10?");
6232
INFO.print("FE_METHOD: method for flatearth correction: method2 :NOT IMPLEMENTED");
6235
PRINT_ERROR("impossible, method name is checked while reading cards.");
6236
throw(keyword_error);
6238
} // END checkcomprefpha
6241
/****************************************************************
6242
* checksubtrrefpha *
6244
* Checks cards for step subtrrefpha. *
6246
* Bert Kampes, 09-Feb-2000 *
6247
****************************************************************/
6248
void checksubtrrefpha(
6249
const input_subtrrefpha &subtrrefphainput)
6251
TRACE_FUNCTION("checksubtrrefpha (BK 09-Feb-2000)")
6252
INFO.print("\n\t*** Input for step SUBTRREFPHA ***");
6253
// ______ Print info ______
6254
switch (subtrrefphainput.method)
6256
case srp_polynomial:
6257
INFO.print("SRP_METHOD: \tpolynomial: \tPolynomial from COMPREFPHA used.");
6260
INFO.print("SRP_METHOD: \texact: \treference phase computed foreach pixel.");
6263
PRINT_ERROR("impossible, checked above.");
6264
throw(keyword_error);
6266
if (subtrrefphainput.dumponlyrefpha==false)
6268
INFO << "SRP_OUT_CINT: \toutputfile complex interferogram: \t"
6269
<< subtrrefphainput.focint;
6272
INFO << "SRP_MULTILOOK: \tFactors (line pixel): \t"
6273
<< subtrrefphainput.multilookL << " "
6274
<< subtrrefphainput.multilookP;
6276
if (subtrrefphainput.dumponlyrefpha==true)
6278
WARNING.print("SRP_DUMPREFPHA: Only dumping reference phase, no subtraction.");
6279
INFO << "SRP_DUMPREFPHA: only dump refphase: "
6280
<< subtrrefphainput.dumponlyrefpha;
6282
INFO << "SRP_OUT_REFPHA: Output file reference phase: "
6283
<< subtrrefphainput.forefpha;
6286
// __________ added by FvL
6287
if (specified(subtrrefphainput.foh2ph))
6289
INFO << "SRP_OUT_H2PH: \t" << subtrrefphainput.foh2ph
6290
<< "; output requested of height-to-phase constant per resolution cell.";
6293
// ____________ end added by FvL
6295
// ______ Check ______ // [MA] increased from 100 to 1000
6296
if (subtrrefphainput.multilookL > 1000 || subtrrefphainput.multilookP > 1000 ||
6297
subtrrefphainput.multilookL < 1 || subtrrefphainput.multilookP < 1 )
6298
WARNING.print("SRP_MULTILOOK: multilookfactor seems very high.");
6299
} // END checksubtrrefpha
6302
/****************************************************************
6305
* Checks cards for step resample. *
6307
* Bert Kampes, 29-Sep-1999 *
6308
****************************************************************/
6310
const input_resample &resampleinput)
6312
TRACE_FUNCTION("checkresample (BK 29-Sep-1999)")
6313
INFO.print("\n\t*** Input for step RESAMPLE ***");
6314
INFO << "RS_OUT_FILE: \toutput filename: \t\t"
6315
<< resampleinput.fileout;
6317
INFO << "RS_OUT_FORMAT: output format: \t\t";
6318
switch (resampleinput.oformatflag)
6321
INFO << "complex_real4.";
6324
INFO << "complex_short.";
6327
PRINT_ERROR("totally impossible, checked input.");
6328
throw(keyword_error);
6331
if (resampleinput.dbow.linehi != 0 || resampleinput.dbow.pixhi != 0)
6333
INFO << "RS_DBOW: \tOutput window: \t\t\t"
6334
<< resampleinput.dbow.linelo << " "
6335
<< resampleinput.dbow.linehi << " "
6336
<< resampleinput.dbow.pixlo << " "
6337
<< resampleinput.dbow.pixhi ;
6340
INFO << "RS_SHIFTAZI: \tshift azimuth spectrum: \t"
6341
<< resampleinput.shiftazi ;
6343
} // END checkresample
6346
/****************************************************************
6349
* Checks cards for step interfero. *
6351
* Bert Kampes, 29-Sep-1999 *
6352
****************************************************************/
6353
void checkinterfero(
6354
const input_interfero &interferoinput)
6356
TRACE_FUNCTION("checkinterfero (BK 29-Sep-1999)")
6357
INFO.print("\n\t*** Input for step INTERFERO ***");
6358
bool filespecified = false;
6359
bool samefilename = false;
6360
if (specified(interferoinput.foint))
6362
filespecified = true;
6363
INFO << "INT_OUT_INT: \tOutputfile interferogram: \t"
6364
<< interferoinput.foint;
6366
if (!(strcmp(interferoinput.foint,interferoinput.focint)))
6367
samefilename = true;
6369
if (specified(interferoinput.focint))
6371
filespecified = true;
6372
INFO << "INT_OUT_CINT: Outfile complex interferogram: \t"
6373
<< interferoinput.focint;
6375
if (!(strcmp(interferoinput.focint,interferoinput.foint)))
6376
samefilename = true;
6378
// if (strcmp(interferoinput.foflatearth," ")) // something is specified
6380
// filespecified = true;
6381
// INFO << "INT_OUT_FE: data outputfile reference phase: \t"
6382
// << interferoinput.foflatearth;
6384
// if (!(strcmp(interferoinput.foflatearth,interferoinput.foint)) ||
6385
// !(strcmp(interferoinput.foflatearth,interferoinput.focint)))
6386
// samefilename = true;
6389
INFO << "INT_MULTILOOK: \tFactor (line pixel): \t"
6390
<< interferoinput.multilookL << " "
6391
<< interferoinput.multilookP;
6393
// [MA] increased from 100 to 1000
6394
if (interferoinput.multilookL > 1000 || interferoinput.multilookP > 1000)
6396
PRINT_ERROR("code ???: INT_MULTILOOK: > 1000.");
6397
throw(keyword_error);
6399
if (interferoinput.multilookL < 1 || interferoinput.multilookP < 1)
6401
PRINT_ERROR("code ???: INT_MULTILOOK: < 1.");
6402
throw(keyword_error);
6407
PRINT_ERROR("code ???: INT_OUT_*: at least one output file must be specified.");
6408
throw(keyword_error);
6412
PRINT_ERROR("code ???: INT_OUT_*: same name output files.");
6413
throw(keyword_error);
6415
} // END checkinterfero
6418
/****************************************************************
6421
* Checks cards for step coherence. *
6423
* Bert Kampes, 29-Sep-1999 *
6424
****************************************************************/
6425
void checkcoherence(
6426
const input_coherence &coherenceinput)
6428
TRACE_FUNCTION("checkcoherence (BK 29-Sep-1999)")
6429
INFO.print("\n\t*** Input for step COHERENCE ***");
6430
bool filespecified = false;
6431
bool samefilename = false;
6432
if (specified(coherenceinput.foccoh))
6434
filespecified = true;
6435
INFO << "COH_OUT_CCOH: \tOutfile complex coherence: \t"
6436
<< coherenceinput.foccoh;
6438
if (!(strcmp(coherenceinput.foccoh,coherenceinput.focoh)))
6439
samefilename = true;
6442
if (specified(coherenceinput.focoh))
6444
filespecified = true;
6445
INFO << "COH_OUT_COH: \tOutputfile coherence image: "
6446
<< coherenceinput.focoh;
6448
if (!(strcmp(coherenceinput.focoh,coherenceinput.foccoh)))
6449
samefilename = true;
6452
INFO << "COH_MULTILOOK: \tFactor (line pixel): \t"
6453
<< coherenceinput.multilookL << " "
6454
<< coherenceinput.multilookP;
6456
INFO << "COH_WINSIZE: \t window size coh. estimation (l/p): \t"
6457
<< coherenceinput.cohsizeL << " " << coherenceinput.cohsizeP;
6459
// [MA] increased from 100 to 1000
6460
if (coherenceinput.multilookL > 1000 || coherenceinput.multilookP > 1000)
6462
PRINT_ERROR("code ???: COH_MULTILOOK: > 1000.");
6463
throw(keyword_error);
6465
if (coherenceinput.multilookL < 1 || coherenceinput.multilookP < 1)
6467
PRINT_ERROR("code ???: COH_MULTILOOK: < 1.");
6468
throw(keyword_error);
6470
if (coherenceinput.cohsizeL > 500 || coherenceinput.cohsizeP > 500)
6472
PRINT_ERROR("code ???: COH_WINSIZE: > 500.");
6473
throw(keyword_error);
6475
if (coherenceinput.cohsizeL < 1 || coherenceinput.cohsizeP < 1)
6477
PRINT_ERROR("code ???: COH_WINSIZE: < 1.");
6478
throw(keyword_error);
6483
PRINT_ERROR("code ???: COH_OUT_*: at least one output file must be specified.");
6484
throw(keyword_error);
6488
PRINT_ERROR("code ???: COH_OUT_*: same name output files.");
6489
throw(keyword_error);
6491
} // END checkcoherence
6495
/****************************************************************
6498
* Checks cards for step comprefdem. *
6500
* Bert Kampes, 14-Feb-2000 *
6501
****************************************************************/
6502
void checkcomprefdem(
6503
const input_comprefdem &comprefdeminput)
6505
TRACE_FUNCTION("checkcomprefdem (BK 14-Feb-2000)")
6506
INFO.print("\n\t*** Input for step COMPREFDEM ***");
6507
// switch (comprefdeminput.method)
6509
// case crd_nearest:
6510
// INFO.print("NEAREST_NEIGHBOR, use DENSE=2 or so.");
6512
// case crd_trilinear:
6513
// INFO.print("TRI_LINEAR; use DENSE=0.2 for speed.");
6516
// PRINT_ERROR("totally impossible, checked input.");
6517
// throw(keyword_error);
6519
INFO << "CRD_IN_DEM: \t" << comprefdeminput.firefdem;
6521
INFO << "CRD_OUT_FILE: \t" << comprefdeminput.forefdem;
6523
if (specified(comprefdeminput.forefdemhei))
6525
INFO << "CRD_OUT_DEM_LP: \t" << comprefdeminput.forefdemhei
6526
<< "; output requested of DEM [m] in radar coordinates.";
6528
if (!strcmp(comprefdeminput.forefdem,comprefdeminput.forefdemhei))
6530
PRINT_ERROR("CRD_OUT_FILE, CRD_OUT_DEM_LP: Same output file name.");
6531
throw(keyword_error);
6534
if (specified(comprefdeminput.fodem))
6536
INFO << "CRD_OUT_DEM: \t" << comprefdeminput.fodem
6537
<< "; output requested of input DEM.";
6539
if (!strcmp(comprefdeminput.fodemi,comprefdeminput.fodem))
6541
PRINT_ERROR("OUT_DEM, OUT_DEMI: Same output file name.");
6542
throw(keyword_error);
6545
if (specified(comprefdeminput.fodemi))
6547
INFO << "CRD_OUT_DEMI: \t" << comprefdeminput.fodemi
6548
<< "; output requested of interpolated DEM.";
6550
if (!strcmp(comprefdeminput.fodemi,comprefdeminput.fodem))
6552
PRINT_ERROR("OUT_DEM, OUT_DEMI: Same output file name.");
6553
throw(keyword_error);
6556
// __________ added by FvL
6557
if (specified(comprefdeminput.foh2ph))
6559
INFO << "CRD_OUT_H2PH: \t" << comprefdeminput.foh2ph
6560
<< "; output requested of height-to-phase constant per resolution cell.";
6563
// ____________ end added by FvL
6564
INFO << "CRD_IN_SIZE: \t" << comprefdeminput.demrows
6565
<< " " << comprefdeminput.demcols
6566
<< "; number of rows (latitude), columns (lon) in DEM.";
6568
INFO << "CRD_IN_UL: \t"
6569
<< rad2deg(comprefdeminput.demlatleftupper) << " "
6570
<< rad2deg(comprefdeminput.demlonleftupper)
6571
<< "; coordinates of upper left corner (first row/col).";
6573
INFO << "CRD_IN_DELTA: \t"
6574
<< rad2deg(comprefdeminput.demdeltalat) << " "
6575
<< rad2deg(comprefdeminput.demdeltalon);
6577
INFO << "CRD_IN_NODATA: \t" << comprefdeminput.demnodata
6578
<< "; this number in DEM will be set to 0 reference phase.";
6580
// INFO << "CRD_DENSE: \t" << comprefdeminput.extradense
6581
// << "; this is the factor for oversampling DEM more than minimum.";
6583
if (comprefdeminput.includerefpha)
6584
INFO << "CRD_INCLUDE_FE: \tref. dem is computed including flat earth.";
6586
INFO << "CRD_INCLUDE_FE: \tref. dem is computed w.r.t. ellipsoid (topo only).";
6589
INFO << "CRD_IN_FORMAT: \tinput format DEM: \t";
6590
switch (comprefdeminput.iformatflag)
6599
INFO << "signed short.";
6601
case FORMATI2_BIGENDIAN:
6602
INFO << "signed short big endian.";
6605
PRINT_ERROR("totally impossible, checked input.");
6606
throw(keyword_error);
6612
// ______ Check some things ______
6613
if (!existed(comprefdeminput.firefdem))
6615
ERROR << "CRD_IN_DEM: \t" << comprefdeminput.firefdem
6616
<< " can not be opened.";
6617
PRINT_ERROR(ERROR.get_str())
6618
throw(keyword_error);
6620
if (rad2deg(comprefdeminput.demdeltalat)<.0002) //[MA] 1 arc secs = 1/3600=0.00027 : allow finer resolutions
6622
WARNING << "CRD_IN_DELTA: \t" << rad2deg(comprefdeminput.demdeltalat)
6623
<< " [deg] seems very small (input in decimal degrees).";
6626
if (comprefdeminput.demrows<1 || comprefdeminput.demrows>100000)
6628
WARNING << "CRD_DEM_SIZE: numrows: \t" << comprefdeminput.demrows
6629
<< " seems to be wrong.";
6632
if (comprefdeminput.demcols<1 || comprefdeminput.demcols>100000)
6634
WARNING << "CRD_DEM_SIZE: numcols: \t" << comprefdeminput.demcols
6635
<< " seems to be wrong.";
6638
// if (comprefdeminput.extradense>5.0)
6640
// WARNING << "CRD_DENSE: \t" << comprefdeminput.extradense
6641
// << " seems to be quite large.";
6644
// if (comprefdeminput.extradense<0.2)
6646
// WARNING << "CRD_DENSE: \t" << comprefdeminput.extradense
6647
// << " seems too small.";
6650
if (rad2deg(comprefdeminput.demdeltalon)<.0002)
6652
WARNING << "CRD_IN_DELTA: \t" << comprefdeminput.demdeltalon
6653
<< " seems very small (it should be in decimal degrees).";
6656
if (rad2deg(comprefdeminput.demlatleftupper) < -90. ||
6657
rad2deg(comprefdeminput.demlatleftupper) > 90. )
6659
ERROR << "CRD_IN_LU: \t" << rad2deg(comprefdeminput.demlatleftupper)
6660
<< " out of range (-90:90).";
6661
PRINT_ERROR(ERROR.get_str())
6662
throw(keyword_error);
6664
if (rad2deg(comprefdeminput.demlonleftupper) < -180. ||
6665
rad2deg(comprefdeminput.demlonleftupper) > 180. )
6667
WARNING << "CRD_IN_LU: \t" << rad2deg(comprefdeminput.demlonleftupper)
6668
<< " out of range (-180:180).";
6671
if (!strcmp(comprefdeminput.fodem,comprefdeminput.forefdem))
6673
PRINT_ERROR("OUT_DEM, OUT_FILE: Same output file name.");
6674
throw(keyword_error);
6676
if (!strcmp(comprefdeminput.firefdem,comprefdeminput.forefdem))
6678
PRINT_ERROR("OUT_FILE, IN_DEM: Same file name.");
6679
throw(keyword_error);
6685
/****************************************************************
6686
* checksubtrrefdem *
6688
* Checks cards for step subtrrefdem. *
6690
* Bert Kampes, 14-Feb-2000 *
6691
****************************************************************/
6692
void checksubtrrefdem(
6693
const input_subtrrefdem &subtrrefdeminput)
6695
TRACE_FUNCTION("checksubtrrefdem (BK 14-Feb-2000)")
6696
INFO.print("\n\t*** Input for step SUBTRREFDEM ***");
6697
INFO << "SRD_OUT_CINT: \t" << subtrrefdeminput.focint;
6699
INFO << "SRD_OFFSET: \t" << subtrrefdeminput.offsetL
6700
<< " " << subtrrefdeminput.offsetP;
6702
if (abs(subtrrefdeminput.offsetL)>5)
6703
WARNING.print("Apply offset in azimuth larger than 5 pixels?");
6704
if (abs(subtrrefdeminput.offsetP)>5)
6705
WARNING.print("Apply offset in range larger than 5 pixels?");
6706
} // END checksubtrrefdem
6709
/****************************************************************
6711
* Checks cards for step filtrange. *
6712
* Bert Kampes, 14-Feb-2000 *
6713
****************************************************************/
6714
void checkfiltrange(
6715
const input_filtrange &filtrangeinput)
6717
TRACE_FUNCTION("checkfiltrange (BK 14-Feb-2000)")
6718
INFO.print("\n\t*** Input for step FILTRANGE ***");
6719
// ______ Give info ______
6720
switch (filtrangeinput.method)
6723
INFO.print("RF_METHOD: ADAPTIVE \t(estimate fringe freq.)");
6724
INFO << "RF_NLMEAN: " << filtrangeinput.nlmean;
6726
INFO << "RF_THRESHOLD: " << filtrangeinput.SNRthreshold;
6728
INFO << "RF_OVERSAMPLE: " << filtrangeinput.oversample;
6730
INFO << "RF_WEIGHTCORR: " << filtrangeinput.doweightcorrel;
6732
INFO << "RF_OVERLAP: " << filtrangeinput.overlap;
6734
if (filtrangeinput.nlmean > 51)
6735
WARNING.print("RF_NLMEAN: mean over more than 51 lines (?)");
6736
if (filtrangeinput.SNRthreshold<1.99)
6737
WARNING.print("RF_THRESHOLD: < 2");
6738
if (filtrangeinput.SNRthreshold>10.01)
6739
WARNING.print("RF_THRESHOLD: > 10 ?");
6740
if (filtrangeinput.oversample<=1)
6741
WARNING.print("RF_OVERSAMPLE: no oversampling.");
6742
if (filtrangeinput.oversample>8)
6743
WARNING.print("RF_OVERSAMPLE: >8 ?");
6744
if (!ispower2(filtrangeinput.oversample))
6745
WARNING.print("RF_OVERSAMPLE: not power of two.");
6746
if (filtrangeinput.doweightcorrel==true)
6747
WARNING.print("RF_WEIGHTCORR: weighting, not sure it has effect.");
6748
if (filtrangeinput.fftlength > 1024)
6749
WARNING.print("RF_FFTLENGTH: adaptive filterlength > 1024 ?");
6750
if (filtrangeinput.SNRthreshold<0.)
6752
PRINT_ERROR( "RF_THRESHOLD: < 0.");
6753
throw(keyword_error);
6757
INFO.print("RF_METHOD: PORBITS \t(based on orbits.)");
6758
INFO << "RF_SLOPE: " << rad2deg(filtrangeinput.terrainslope)
6759
<< "\t[deg] terrainslope.";
6761
if (filtrangeinput.fftlength < 256)
6762
WARNING.print("RF_FFTLENGTH: porbits filterlength < 256 (?)");
6765
PRINT_ERROR("totally impossible, checked input.");
6766
throw(keyword_error);
6768
// ______ Both methods cards ______
6769
INFO << "RF_FFTLENGTH: " << filtrangeinput.fftlength;
6771
INFO << "RF_HAMMING: " << filtrangeinput.hammingalpha;
6773
INFO << "RF_OUT_MASTER: " << filtrangeinput.fomaster;
6775
INFO << "RF_OUT_SLAVE: " << filtrangeinput.foslave;
6777
INFO << "RF_OUT_FORMAT: output format: ";
6778
switch (filtrangeinput.oformatflag)
6781
INFO << "complex_real4.";
6784
INFO << "complex_short.";
6787
PRINT_ERROR("totally impossible, checked input.");
6788
throw(keyword_error);
6792
// ______ Check input ______
6793
if (filtrangeinput.hammingalpha>0.999)
6794
WARNING.print("RF_HAMMING: no hamming filtering.");
6795
if (existed(filtrangeinput.fomaster))
6796
WARNING.print("RF_OUT_MASTER: file exists.");
6797
if (existed(filtrangeinput.foslave))
6798
WARNING.print("RF_OUT_SLAVE: file exists.");
6799
if (!ispower2(filtrangeinput.fftlength))
6801
PRINT_ERROR( "RF_FFTLENGTH: not power of 2.");
6802
throw(keyword_error);
6804
if (filtrangeinput.overlap >= 0.5*filtrangeinput.fftlength)
6806
PRINT_ERROR( "RF_OVERLAP >= 0.5*RF_FFTLENGTH");
6807
throw(keyword_error);
6809
if (filtrangeinput.hammingalpha>1. || filtrangeinput.hammingalpha<0.)
6811
PRINT_ERROR( "RF_HAMMING: not e[0,1].");
6812
throw(keyword_error);
6814
} // END checkfiltrange
6818
/****************************************************************
6821
* Checks cards for step dinsar. *
6824
****************************************************************/
6826
const input_dinsar &dinsarinput)
6828
TRACE_FUNCTION("checkdinsar (BK 25-Sep-2000)")
6829
INFO.print("\n\t*** Input for step DINSAR ***");
6831
if (!specified(dinsarinput.topomasterresfile))
6833
INFO.print("Using 3 pass differential (for 4 pass, see DI_IN_TOPOMASTER card).");
6837
INFO << "DI_IN_TOPOMASTER: \t" << dinsarinput.topomasterresfile
6841
INFO << "DI_IN_TOPOSLAVE: \t" << dinsarinput.toposlaveresfile;
6843
INFO << "DI_IN_TOPOINT: \t" << dinsarinput.topointresfile;
6845
INFO << "DI_OUT_FILE: \t" << dinsarinput.fodinsar;
6847
if (!specified(dinsarinput.foscaleduint))
6848
INFO << "DI_OUT_SCALED: \tNo (debug) output requested scaled topography interf.";
6850
INFO << "DI_OUT_SCALED: \t" << dinsarinput.foscaleduint
6851
<< "; debug output requested.";
6853
if (!specified(dinsarinput.toposlaveresfile))
6855
PRINT_ERROR("DI_IN_TOPOSLAVE: result file topo slave not specified.");
6856
throw(keyword_error);
6858
if (!specified(dinsarinput.topointresfile))
6860
PRINT_ERROR("DI_IN_TOPOINT: result file topo interferogram not specified.");
6861
throw(keyword_error);
6863
if (!strcmp(dinsarinput.toposlaveresfile,dinsarinput.topointresfile))
6865
PRINT_ERROR("IN_TOPOSLAVE, IN_TOPOINT: Same input file name.");
6866
throw(keyword_error);
6868
} // END checkdinsar
6872
/****************************************************************
6875
* Checks cards for step filtphase. *
6878
****************************************************************/
6879
void checkfiltphase(
6880
const input_filtphase &filtphaseinput)
6882
TRACE_FUNCTION("checkfiltphase (BK 25-Sep-2000)")
6883
INFO.print("\n\t*** Input for step FILTPHASE ***");
6884
if (specified(filtphaseinput.fifiltphase))
6886
INFO << "PF_IN_FILE: \t" << filtphaseinput.fifiltphase
6887
<< " " << filtphaseinput.finumlines
6888
<< " (this cr4 file will be filtered)";
6890
if (!existed(filtphaseinput.fifiltphase))
6891
WARNING.print("Impossible? PF input file does not exist?");
6893
INFO << "PF_OUT_FILE: \t" << filtphaseinput.fofiltphase
6894
<< " (output filename).";
6897
// ______ Method goldstein filter ______
6898
if (filtphaseinput.method==fp_goldstein)
6900
INFO.print("FILTPHASE: Method goldstein.");
6901
INFO << "PF_ALPHA: \t" << filtphaseinput.alpha
6902
<< " (weigthing parameter for spectrum).";
6904
INFO << "PF_BLOCKSIZE: " << filtphaseinput.blocksize
6905
<< " (size of block to perform filtering on).";
6907
INFO << "PF_OVERLAP: \t" << filtphaseinput.overlap
6908
<< " (half overlap between consequetive blocks).";
6911
// ______ Use 1d kernel to smooth amplitude, e.g. 12321 ______
6912
// ______ Which is normalized by me ______
6913
INFO << "PF_KERNEL: \t";
6914
for (int32 ii=0; ii<filtphaseinput.kernel.pixels(); ++ii)
6915
INFO << " " << filtphaseinput.kernel(0,ii);
6916
INFO << " (smooth |spectrum| with this).";
6918
if (filtphaseinput.kernel.pixels()==1)
6919
INFO.print("No smoothing of amplitude spectrum!");
6921
// ______ Check errors _____
6922
if (filtphaseinput.alpha<0. || filtphaseinput.alpha>1.)
6923
WARNING.print("PF_ALPHA not 0<a<1");
6924
if (filtphaseinput.blocksize>64 || filtphaseinput.blocksize<16)
6925
WARNING.print("PF_BLOCKSIZE very small or large?");
6926
if (filtphaseinput.kernel.pixels()>11)
6927
WARNING.print("smoothing kernel > 11: very large?");
6928
if (filtphaseinput.overlap<0)
6930
PRINT_ERROR("PF_OVERLAP < 0");
6931
throw(keyword_error);
6933
if (2*filtphaseinput.overlap>filtphaseinput.blocksize)
6935
PRINT_ERROR("2*PF_OVERLAP > PF_BLOCKSIZE");
6936
throw(keyword_error);
6938
if (filtphaseinput.kernel.pixels()>filtphaseinput.blocksize)
6940
PRINT_ERROR("smoothing kernel > PF_BLOCKSIZE");
6941
throw(keyword_error);
6943
if (!ispower2(filtphaseinput.blocksize))
6945
PRINT_ERROR("PF_BLOCKSIZE not a power of 2");
6946
throw(keyword_error);
6950
// ______ Method modified goldstein filter ______
6951
else if (filtphaseinput.method==fp_modgoldstein)
6953
INFO.print("FILTPHASE: Method modgoldstein.");
6954
INFO << "PF_ALPHA: \t" << -1
6955
<< " (Calculated based on coherence).";
6957
INFO << "PF_BLOCKSIZE: " << filtphaseinput.blocksize
6958
<< " (size of block to perform filtering on).";
6960
INFO << "PF_OVERLAP: \t" << filtphaseinput.overlap
6961
<< " (half overlap between consequetive blocks).";
6964
// ______ Use 1d kernel to smooth amplitude, e.g. 12321 ______
6965
// ______ Which is normalized by me ______
6966
INFO << "PF_KERNEL: \t";
6967
for (int32 ii=0; ii<filtphaseinput.kernel.pixels(); ++ii)
6968
INFO << " " << filtphaseinput.kernel(0,ii);
6969
INFO << " (smooth |spectrum| with this).";
6971
if (filtphaseinput.kernel.pixels()==1)
6972
INFO.print("No smoothing of amplitude spectrum!");
6974
// ______ Check errors _____
6975
if (filtphaseinput.alpha<0. || filtphaseinput.alpha>1.)
6976
WARNING.print("PF_ALPHA not 0<a<1");
6977
if (filtphaseinput.blocksize>64 || filtphaseinput.blocksize<16)
6978
WARNING.print("PF_BLOCKSIZE very small or large?");
6979
if (filtphaseinput.kernel.pixels()>11)
6980
WARNING.print("smoothing kernel > 11: very large?");
6981
if (filtphaseinput.overlap<0)
6983
PRINT_ERROR("PF_OVERLAP < 0");
6984
throw(keyword_error);
6986
if (2*filtphaseinput.overlap>filtphaseinput.blocksize)
6988
PRINT_ERROR("2*PF_OVERLAP > PF_BLOCKSIZE");
6989
throw(keyword_error);
6991
if (filtphaseinput.kernel.pixels()>filtphaseinput.blocksize)
6993
PRINT_ERROR("smoothing kernel > PF_BLOCKSIZE");
6994
throw(keyword_error);
6996
if (!ispower2(filtphaseinput.blocksize))
6998
PRINT_ERROR("PF_BLOCKSIZE not a power of 2");
6999
throw(keyword_error);
7003
// ______ Method spatial convolution ______
7004
else if (filtphaseinput.method==fp_spatialconv)
7006
INFO.print("FILTPHASE: Method spatial convolution.");
7007
if (!specified(filtphaseinput.fikernel2d))
7009
INFO.print("Using 1d kernel for spatial convolution (no PF_IN_KERNEL2D).");
7010
INFO << "PF_KERNEL: used: \t";
7011
for (int32 ii=0; ii<filtphaseinput.kernel.pixels(); ++ii)
7012
INFO << " " << filtphaseinput.kernel(0,ii);
7017
INFO.print("Using 2d kernel for spatial convolution.");
7018
INFO << "PF_IN_KERNEL2D: \t" << filtphaseinput.fikernel2d
7019
<< " (ascii input file with 2d kernel).";
7021
INFO.print("PF_IN_KERNEL2D: \t(input file has 1 line header: numrows numcols scale");
7022
if (filtphaseinput.kernel.size()!=0)
7023
WARNING.print("PF_KERNEL card ignored due to card PF_IN_KERNEL2D.");
7024
if (!existed(filtphaseinput.fikernel2d))
7025
WARNING.print("PF_IN_KERNEL2D infile cannot be found.");
7028
else if (filtphaseinput.method==fp_spectral)
7030
INFO.print("FILTPHASE: Method spectral filter with 2D kernel.");
7031
INFO << "PF_BLOCKSIZE: " << filtphaseinput.blocksize
7032
<< " (size of block to perform filtering on).";
7034
INFO << "PF_OVERLAP: \t" << filtphaseinput.overlap
7035
<< " (half overlap between consequetive blocks).";
7037
if (filtphaseinput.kernel.size()!=0)
7038
WARNING.print("PF_KERNEL card ignored for method spectral.");
7039
if (filtphaseinput.overlap<0)
7041
PRINT_ERROR("PF_OVERLAP < 0");
7042
throw(keyword_error);
7044
if (2*filtphaseinput.overlap>filtphaseinput.blocksize)
7046
PRINT_ERROR("2*PF_OVERLAP > PF_BLOCKSIZE");
7047
throw(keyword_error);
7049
if (!ispower2(filtphaseinput.blocksize))
7051
PRINT_ERROR("PF_BLOCKSIZE not a power of 2");
7052
throw(keyword_error);
7054
if (!specified(filtphaseinput.fikernel2d))
7056
PRINT_ERROR("method spectral needs card PF_IN_KERNEL2D");
7057
throw(keyword_error);
7062
PRINT_ERROR("Method phasefiltering != {goldstein,modgolstein,spatialconv,spectral}.");
7063
throw(keyword_error);
7065
} // END checkfiltphase
7068
/****************************************************************
7070
* Checks cards for step filtazi. *
7071
* Bert Kampes, 02-Nov-2000 *
7072
****************************************************************/
7074
const input_filtazi &filtaziinput,
7075
const int16 id) // either master, slave, or m+s
7077
TRACE_FUNCTION("checkfiltazi (BK 02-Nov-2000)")
7078
INFO.print("\n\t*** Input for step FILTAZI ***");
7079
INFO << "AF_BLOCKSIZE: \t" << filtaziinput.fftlength;
7081
INFO << "AF_OVERLAP: \t" << filtaziinput.overlap;
7083
INFO << "AF_HAMMING: \t" << filtaziinput.hammingalpha;
7085
if (filtaziinput.oformatflag==FORMATCR4)
7086
INFO.print("AF_OUT_FORMAT: \tcomplex_real4");
7087
else if (filtaziinput.oformatflag==FORMATCI2)
7088
INFO.print("AF_OUT_FORMAT: \tcomplex_short");
7091
PRINT_ERROR("formatflag not ok for output.");
7092
throw(keyword_error);
7097
INFO << "AF_OUT_MASTER: \t" << filtaziinput.fomaster;
7102
INFO << "AF_OUT_SLAVE: \t" << filtaziinput.foslave;
7106
if (filtaziinput.fftlength<256)
7107
WARNING.print("AF_BLOCKSIZE < 256 (too small?)");
7108
if (2*filtaziinput.overlap>0.5*filtaziinput.fftlength)
7109
WARNING.print("2*AF_OVERLAP > .5*AF_BLOCKSIZE (very large?)");
7110
if (filtaziinput.hammingalpha<0 || filtaziinput.hammingalpha>1)
7112
PRINT_ERROR("AF_HAMMING not e[0,1]");
7113
throw(keyword_error);
7115
if (filtaziinput.overlap<0)
7117
PRINT_ERROR("AF_BLOCKSIZE < 0");
7118
throw(keyword_error);
7120
if (2*filtaziinput.overlap>filtaziinput.fftlength)
7122
PRINT_ERROR("AF_BLOCKSIZE < 2*AF_BLOCKSIZE");
7123
throw(keyword_error);
7125
if (!ispower2(filtaziinput.fftlength))
7127
PRINT_ERROR("AF_BLOCKSIZE must be power of 2.");
7128
throw(keyword_error);
7130
} // END checkfiltazi