File: run

package info (click to toggle)
doris 4.06~beta2%2Bdfsg-3
  • links: PTS, VCS
  • area: contrib
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 4,132 kB
  • ctags: 1,923
  • sloc: cpp: 42,573; csh: 3,636; sh: 2,869; python: 1,180; ansic: 650; makefile: 246
file content (1847 lines) | stat: -rwxr-xr-x 66,697 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
#!/bin/sh
##########################################################
# Script that:
#       - Runs SAR software: Doris 
#       - (Delft Object-oriented Radar Interferometric Software)
#       - Prints out helpdoris script
#       - NOTE: uses environment variables EDITOR, PAGER (if exist)
#
# Version history:
#       v1.0 22/03/99    bert   initial version.
#       v1.1 28/04/99    bert   added -g(enerate) option.
#       v1.2 12/05/99    bert   added info variables (AUTHOR etc.).
#       v1.3 02/06/99    bert   added steps 8. slant2h and 9. geocode.
#       v1.4 02/06/99    bert   added checks for savety + renaming
#       v2.0 02/12/99    bert   new setup of steps, general improvements
#       v2.1 22/05/00    bert   environment variables
#       v2.2 06/03/01    bert   file name conventions (extensions)
#                               masterorb_slaveorb.cint .srp .srd .uint .coh .dcint
#       v3.0 02/02/02    bert   changed from ksh to sh since cygwin didn't have one.
#       v3.1 12-Sep-2003 bert   added quick look processing
#       v4.01 12-Dec-2008 FvL   updates for Doris 4.01
#       v4.01 23-Dec-2008 MA    minor revisions for Doris 4.01        
#       v4.01 13-Apr-2009 MA    TSX update
#       v4.02 29-May-2009 MA    Ellipsoid card generated
#       v4.0x 23-Jun-2010 MA,PD RS2 and CSK read/crop parameters updated
#
# Future plans:
#       Print out: checklist.tex , shortmanual.tex, (see helpdoris)
#       If existed output, interactive solution for rename, don't auto
#       add check if input exists before vi
#       We had some problems with the which command, so changd it to running programs
#       looking for exit status...
#
# Disclaimer:
#       This run file comes without warranty,
#       You are allowed to change/add whatever you like.
#       If you are using this script for running the Doris software,
#       please keep the version history and disclaimer.
#       Mail comments/bugs to doris_users@tudelft.nl
##########################################################
##########################################################
PROG="doris"                            # executable name in path
PROGDEBUG="doris.debug"                 # executable name in path
PROGINCWD="./processor"                 # executable name in working dir


##########################################################
### Default values for -g option; not used in processing. ###
AUTHOR="TUDelft - MGP Radar Group"      # Bert Kampes is the main author
MASTER="master"
SLAVE="slave"
REMARKS="No remarks"
BASELINE="Unknown"
DATE=`date "+%b %d, %Y (%A)"`           # cannot be changed by input option

### Default directories for input/output ###
INPUTDIR="Inputfiles"                   # directory for input
OUTPUTDIR="Outinfo"                     # directory for output standard out
DATAOUTDIR="Outdata"                    # directory for output matrices
WORKDIR="."                             # don't change?

### Default parameter files/logfile ###
LOGFILE="doris.log"
# BK 19-Jan-2001: defaults to -M -S if specified
#MASTERRES="master.res"
#SLAVERES="slave.res"
#INTERFRES="products.res"


##########################################################
#  No need to change anything below this line (i hope)  #
#  But feel free to change default input generation to  #
#  Save you some editing work later.                    #
#########################################################

##########################################################
# To run Doris software:
#  1) make sure your path is ok.
#  2) create work directory,
#  3) run -g etc. creates the input etc.
#  4) run -s runs the software. -h(elp)
#########################################################
#########################################################
#########################################################
# Script variables.
bn=`basename $0`
EDIT=999
STEP=999
VIEW=999
RESULT=999
INPUT=
INPUT_1=input.m_initial
INPUT_2=input.s_initial
INPUT_3=input.coregistration
INPUT_4=input.resample
INPUT_5=input.products
INPUT_6=input.filter_unwrap
INPUT_7=input.s2h_geocode
#INPUT_8=input.
INPUT_9=input.quicklook
DOGENERATE="0"                  # no default -g ...


# -------------------------------
# Functions for convenience.
NAME()
  {
  echo "   $bn -- Utility for running the Delft insar processor."
  }

SYNOPSIS()
  {
  echo "   $bn -s/-e/-v step  -ql [-f inputfile  -r file-id  -d]"
  echo "          /-g [-M master  -S slave  -B baseline  -R remark  -A author]"
  echo "          /-h"
  echo "  ($bn -h gives more help)"
  }

USAGE()
  {
  echo "Usage:"
  SYNOPSIS
  exit 1
  }

MANPG()
  {
  cat << __MANEOF

  PROGRAM:
  $name


  SYNOPSIS:
  $synopsis


  DESCRIPTION:
    This script is convenient for running the Doris InSAR software.
    It generates template input files, and serves as a shell.
    It allows you to edit the generated input, and to run Doris.
    Of course the results can also be viewed.

    The environment variables PAGER and EDITOR are used (if set)
    for viewing and editing. In your current setup, the programs
    "$PAGER" and "$EDITOR" are used respectively.
__MANEOF

if [ -x $PROGINCWD ]; then
  echo "    "The executable: \"$PROGINCWD\" "is used (run -s step)."
else
  echo "    "The executable: \"$PROG\" "is used (run -s step)."
fi

cat << __MANEOF

  OPTIONS:

==========================
=== GENERATING OPTIONS ===
==========================
    -g  
                Generate directories, template input files.
                Use -M -S -A -B -R to specify comments in template
                input files.
                It makes the following directories:
                 for the input files:        "$INPUTDIR/"
                 for the redirected stdout:  "$OUTPUTDIR/"
                 for data output:            "$DATAOUTDIR/"
                Either the program:
                 "$PROG"       (default in your path),
                 "$PROGDEBUG"  (-d option), or
                 "$PROGINCWD"  (if it exists).
                is called.

    -M  master
                Only in combination with -g option.
                Specify name for master image (e.g., orbit number).
                This variable is used to name the output data files
                and as a comment at the top of the input files. 
                The M_RESFILE is assigned to 'master'.res
                The I_RESFILE is assigned to 'master_slave'.res

    -S  slave
                Only in combination with -g option.
                Specify name for slave image (e.g., orbit number).
                This variable is used to name the output data files
                and as a comment at the top of the input files. 
                The S_RESFILE is assigned to 'slave'.res
                The I_RESFILE is assigned to 'master_slave'.res

    -A  author
                Only in combination with -g option.
                Specify name of author/ person who is processing.
                Used only as a comment at the top of the input files.

    -B  baseline
                Only in combination with -g option.
                Specify baseline (e.g., 100).
                Used only as a comment at the top of the input files.

    -R  remarks
                Only in combination with -g option.
                Specify any remarks on the processing.
                Used only as a comment at the top of the input files.


==========================
=== PROCESSING OPTIONS ===
==========================

    -e  step   
                edit the inputfiles. then exit (no processing).

    -ql
                Quicklook processing. (Edit input: run -e1; run -e2; run -e9).
		If run -s1 has not been done yet, it perform it.
		If run -s2 has not been done yet, it perform it.
		Then it copies the $MASTERRES to master_QL.res
		               and $SLAVERES to slave_QL.res
		Finally it runs doris with options in run -e9 (all steps for interferogram). 

    -s  step
                proces the input file for this step.
         1: initial steps for master (readfiles, crop, porbits)
         2: initial steps for slave (readfiles, crop, porbits)
         3: coregistration (coarse, fine)
         4: compute coregistration parameters and perform resampling
         5: interferometric product generation and reference phase
         6: phase filtering (and phase unwrapping)
         7: slant to height conversion and geocoding
         8: n/a
         9: quicklook processing.
            This step first performs a run -s1 and a run -s2 to read master and slave.
            Make sure that you have edited the input files with run -e1 and run -e2.
            Then, all steps to quickly create an interferogram are performed.
            You can edit that with run -e9, but there should be no need for that.


    -v  step
                view output file of step.

    -r  file-ID
                view/edit result output file.
         1: "$MASTERRES"                (master result file)
         2: "$SLAVERES"                 (slave result file)
         3: "$INTERFRES"                (interferogram result file)
         4: "$LOGFILE"                  (logfile)


==========================
=== FURTHER OPTIONS    ===
==========================

    -f  infile
                Specify an input file to process.
                Useage of this option is discouraged, use option -s step.
                (or use command line syntax if you like that better.)
    -d          
                Use debugger version:   $PROGDEBUG
                instead of regular:     $PROG
                These executables have to be in your path.
                This option can be used if normal processing goes wrong.
                The redirected stdout can get very large (2GB) with this option.



==========================
=== EXAMPLES           ===
==========================

    Normally, the processing starts by generating input files: run -g
    Then, check/edit the input for the first step:             run -e1
    Next the executable $PROG is called by:                    run -s1
    The output can be viewed with:                             run -v1
     for the stdout and with:                                  run -r[1/2/3/4]
    The processing continues with the next step:               run -e2 etc. 

    To generate the input files for master 21066, slave 01393,
    with a baseline of about 100m for testing purposes:
      run -g -M 21066 -S 01393 -R "Testing generate option" -B 100

    To edit the input file for step one: 
      run -e 1

    To run first step, and put ouput file (redirected stout) in dir: 
      run -s 1

    To view the output file for step one: 
      run -v 1

    To run an input file named inputA in the current directory (discouraged with -f):
      run -f inputA
      doris inputA > outputA


==========================
=== AUTHOR             ===
==========================
  Author:
    $bn is written by Bert Kampes, Delft University, (c)1999-2003, b.m.kampes@lr.tudelft.nl.

  Known bugs:
    It is not possible to edit more then one file with the -e option.


  See also:
    helpdoris
    plotoffsets
    plotcpm

  Note: You can edit this script if you want other options, etc.
        Please notify b.m.kampes@lr.tudelft.nl in that case.

__MANEOF
  }



# generate input files------------------
GENERAL()
  {
  cat << __GENERALEOF
# **********************************************************************
# ***  Doris inputfile generated by: $bn at: $DATE *****
# **********************************************************************
# ***
# ***  Filename:        $INPUTDIR/$fn
# ***  Author:          $AUTHOR
# ***  Master:          $MASTER
# ***  Slave :          $SLAVE
# ***  Baseline:        $BASELINE
# ***  Remarks:         $REMARKS
# ***  
# ***  Intended to be used with shell script: $bn
# **********************************************************************

########################################################################
# NOTE: BK 16-JUN-2003                                                 #
#   It seems when compiled with g++ 3.2, there cannot be an empty      #
#   optional argument, since instead the first (key) of the next line  #
#   is read.  Therefore, it seems wise to always use arguments, or to  #
#   always have a comment with "//" behind the last argument.          #
#   Of course there must be a way to prevent this, but I don't know how#
########################################################################


#   ------------------------------------------
#   The general options
#   ------------------------------------------

SCREEN          info                    // level of output to standard out
c SCREEN          debug                 // [trace, debug, info, progress, warning, error]
c SCREEN          trace                 // [trace, debug, info, progress, warning, error]
BEEP            warning                 // level of beeping
c PREVIEW         xv                    // SUNraster files with cpxfiddle
PREVIEW         on                      // SUNraster files with cpxfiddle
MEMORY          500                     // [MB] RAM available to Doris
OVERWRITE       ON                      // do overwrite existing files
BATCH           ON                      // do process non-interactive
LISTINPUT       ON                      // do copy this file to log
HEIGHT          0.0                     // average WGS84 terrain height
TIEPOINT        0.0 0.0 0.0             // lat/lon/hei of a tiepoint
ORB_INTERP      POLYFIT 4               // use 5th degree polynomial
c ORB_INTERP      SPLINE                // natural cubic spline
c ORB_INTERP      POLYFIT               // orbit interpolation method
c ELLIPSOID     WGS84                   // WGS84 (default), GRS80, BESSEL or define a,b  (major radius, minor radius)

c DUMPBASELINE  15 10                   // eval baseline on grid
c M_RG_T_ERROR    0.0                   // one-way [sec] timing error
c M_AZ_T_ERROR    0.0                   // azimuth timing error
c S_RG_T_ERROR    0.0                   // one-way [sec]; d_rg=err*rsr*2
c S_AZ_T_ERROR    0.0                   // [sec]; d_az=err*prf [m]
__GENERALEOF
  }


FILES()
  {
  cat << __FILESEOF


#   ------------------------------------------
#   The general io files
#   ------------------------------------------

LOGFILE         $LOGFILE                // log file
M_RESFILE       $MASTERRES              // parameter file master
S_RESFILE       $SLAVERES               // parameter file slave
I_RESFILE       $INTERFRES              // parameter file interferogram

__FILESEOF
  }


GEN_1()
  {
  fn=$INPUT_1
  GENERAL
  FILES
  cat << __GENEOF_1a
PROCESS         m_readfiles             // reading of slc files
PROCESS         m_porbits               // get precise orbits
PROCESS         m_crop                  // convert data to internal format
PROCESS         m_simamp                // simulate amplitude
PROCESS         m_timing                // estimate timing error 
c PROCESS         m_ovs                 // optionally oversample data
__GENEOF_1a
  cat << __GENEOF_1b


#   ------------------------------------------
#      READFILES (master)
#   ------------------------------------------

c M_IN_METHOD      JERS                          // uses ERS ceos reader
c M_IN_METHOD      RSAT                          // uses RSAT ceos reader
c M_IN_METHOD      ATLANTIS                      // uses RSAT ceos reader
c M_IN_METHOD      ALOS                          // uses ALOS ceos reader
# -- select following 5 for ERS ceos reader --         
M_IN_METHOD       ERS                           // default
M_IN_VOL          /CDROM/SCENE1/VDF_DAT.001     // slc volume file
M_IN_LEA          /CDROM/SCENE1/LEA_01.001      // slc leaderfile
M_IN_DAT          /CDROM/SCENE1/DAT_01.001      // slc data file
M_IN_NULL         dummy                         //
#
#
# --or select following 2 for ERS--
c M_IN_METHOD    ERS_N1                         // ERS1/2 in Envisat format
c M_IN_DAT       SAR_IMS_1PXDLR19951008_144123_00000017G150_00096_22128_3605.E1 // please link the actual input file with "ln -s" to avoid long pathnames 
#
# --or select following 2 for ENVISAT--
c M_IN_METHOD    ASAR                            // ENVISAT
c M_IN_DAT       ASA_IMS_1PXPDE19911013_214038_00000015X000_00000_04784_0002.N1 // please link the actual input file with "ln -s" to avoid long pathnames 
# 
#
c M_IN_METHOD    TSX                             // TERRASAR-X
c M_IN_DAT       IMAGE_HH_SRA_strip_007.cos      // please link the actual input file with "ln -s"
c M_IN_LEA       TSX1_metadata.xml              
#
#
c M_IN_METHOD    RADARSAT-2                      // RADARSAT-2 
c M_IN_DAT       imagery_HH.tif                  // please link the actual input file with "ln -s"
c M_IN_LEA       product.xml
#
#
c M_IN_METHOD    CSK                             // Cosmo-skymed
c M_IN_DAT       master.h5                       // please link the actual (CSKS1_SCS_B_HI_05_HH_RA_SF_date.h5) 
                                                 // input file with "ln -s"


#   ------------------------------------------
#      PORBITS (master)
#   ------------------------------------------

M_ORBDIR        /data/delftorbits/ers?
c M_ORBDIR        /data/delftorbits/ers1/dgm-e04           // dgm gravity model
c M_ORBDIR        /data/delftorbits/ers2/eigen-grace01s    // grace gravity model
c M_ORBDIR        /data/delftorbits/envisat/eigen-grace01s // grace gravity model
c --for spline--
c M_ORB_EXTRATIME 300                           // Time before first line
c M_ORB_INTERVAL  30                            // Time between data
c M_ORB_DUMP      0.05                          // dump to ascii file
c --for polyfit(3)--
M_ORB_EXTRATIME 5                               // Time before first line
M_ORB_INTERVAL  4                               // Time between data


#   ------------------------------------------
#      CROP (master)
#   ------------------------------------------
 
c --for CEOS reader: ERS JERS RADARSAT-1 ALOS--
M_CROP_IN       /CDROM/SCENE1/DAT_01.001        // slc data file
c
c --or for ENVISAT--
c M_CROP_IN     /cdrom/ASA_IMS_1PXPDE19911013_214038_00000015X000_00000_04784_0002.N1 // please link the actual input file with "ln -s" to avoid long pathnames
c
c --or for TERRASAR-X
c M_CROP_IN     IMAGE_HH_SRA_strip_007.cos      // please link the actual input file with "ln -s" 
c
c --or for Radarsat-2
c M_CROP_IN     FQ9HV_20090515.tif              // please link the actual input file with "ln -s" 
c
c --or for Cosmo-skymed
c M_CROP_IN     master.h5                       // please link the actual (CSKS1_SCS_B_HI_05_HH_RA_SF_date.h5) 
                                                // input file with "ln -s"
c
c --and the rest of parameters
M_CROP_OUT      $DATAOUTDIR/$MASTER.raw         // output filename
M_DBOW          1 5000 1 1000                   // database output window in the radar cordinates
c M_DBOW_GEO    41.1 12.0 5000 1000             // lat_0[deg], lon_0, height, width[pix]


#   ------------------------------------------
#      SIMULATE AMPLITUDE (master)
#   ------------------------------------------
 
SAM_IN_DEM     final_netherlands.dem
SAM_IN_FORMAT  r4               	 // default is short integer
SAM_IN_SIZE    4801 6001
SAM_IN_DELTA   0.000833333  0.000833333 
SAM_IN_UL      54  3 
SAM_IN_NODATA  -32768
SAM_OUT_FILE   master_sam.raw
SAM_OUT_DEM    master_demcrop.dem
c SAM_OUT_DEM_LP master_demhei_lp.raw 
c SAM_OUT_THETA_LP master_theta_lp.raw 


#   ------------------------------------------
#      TIMING (master)
#   ------------------------------------------

MTE_METHOD    magspace
c MTE_IN_POS  window_locations.txt 
MTE_NWIN      16
MTE_WINSIZE   256 128
MTE_ACC       32 32
MTE_INITOFF   0 0


#   ------------------------------------------
#      OVERSAMPLE (master)
#   ------------------------------------------

M_OVS_OUT         $DATAOUTDIR/${MASTER}_ovs.raw   // output filename              
M_OVS_OUT_FORMAT  ci2       // output format for the oversampled image ci2 | cr4.
M_OVS_FACT_RNG    2         // range oversampling ratio
M_OVS_FACT_AZI    1         // azimuth oversampling ratio (>2 not implemented yet!)
M_OVS_KERNELSIZE  16        // interpolation kernel length 
c                                               //
c                                               //
STOP                                            // mandatory
# vim: syntax=doris
__GENEOF_1b
  }
#
#
GEN_2()
  {
  fn=$INPUT_2
  GENERAL
  FILES
  cat << __GENEOF_2a
PROCESS         s_readfiles             // reading of slc files
PROCESS         s_porbits               // get precise orbits
PROCESS         s_crop                  // convert data to internal format
c PROCESS         s_ovs                 // optionally oversample data
__GENEOF_2a
  cat << __GENEOF_2b


#   ------------------------------------------
#      READFILES (slave)
#   ------------------------------------------

c S_IN_METHOD     JERS                          // uses ERS ceos reader
c S_IN_METHOD     RSAT                          // uses RSAT ceos reader
c S_IN_METHOD     ATLANTIS                      // uses RSAT ceos reader
c S_IN_METHOD     ALOS                          // uses ALOS ceos reader
# -- select following 5 for ERS ceos reader --         
S_IN_METHOD      ERS                            // default 
S_IN_VOL         /CDROM/SCENE1/VDF_DAT.001      // slc volume file
S_IN_LEA         /CDROM/SCENE1/LEA_01.001       // slc leaderfile
S_IN_DAT         /CDROM/SCENE1/DAT_01.001       // slc data file
S_IN_NULL        dummy                          //
#
#
# --or select following 2 for ENVISAT--         //
c S_IN_METHOD    ASAR                           // ENVISAT
c S_IN_DAT       ASA_IMS_1PXPDE19911013_214038_00000015X000_00000_04784_0002.N1 // please link the actual input file with "ln -s" to avoid long pathnames 
#
#
c S_IN_METHOD    TSX                            // TERRASAR-X  
c S_IN_DAT       IMAGE_HH_SRA_strip_007.cos     // please link the actual input file with "ln -s"
c S_IN_LEA       TSX1_metadata.xml
#
#
c S_IN_METHOD    RADARSAT-2                     
c S_IN_DAT       FQ9HV_20090515.tif             // please link the actual input file with "ln -s"
c S_IN_LEA       FQ9_20090515.xml
#
#
c S_IN_METHOD    CSK                            // Cosmo-skymed
c S_IN_DAT       slave.h5                       // please link the actual (CSKS1_SCS_B_HI_05_HH_RA_SF_date.h5) 
                                                // input file with "ln -s"


#   ------------------------------------------
#      PORBITS (slave)
#   ------------------------------------------

S_ORBDIR        /data/delftorbits/ers?
c S_ORBDIR        /data/delftorbits/ers1/dgm-e04           // dgm gravity model
c S_ORBDIR        /data/delftorbits/ers2/eigen-grace01s    // grace gravity model
c S_ORBDIR        /data/delftorbits/envisat/eigen-grace01s // grace gravity model
c --for spline--              
c S_ORB_EXTRATIME 300                           // Time before first line
c S_ORB_INTERVAL  30                            // Time between data
c S_ORB_DUMP      0.05                          // dump to ascii file
c --for polyfit(3)--          
S_ORB_EXTRATIME 5                               // Time before first line
S_ORB_INTERVAL  4                               // Time between data


#   ------------------------------------------
#      CROP (slave)
#   ------------------------------------------

c --for CEOS reader: ERS JERS RADARSAT-1 ALOS--
S_CROP_IN       /CDROM/SCENE1/DAT_01.001        // slc data file
c
c --or for ENVISAT--
c S_CROP_IN     /cdrom/ASA_IMS_1PXPDE19911013_214038_00000015X000_00000_04784_0002.N1 // please link the actual input file with "ln -s" to avoid long pathnames
c
c --or for TERRASAR-X
c S_CROP_IN     IMAGE_HH_SRA_strip_007.cos      // please link the actual input file with "ln -s"
c
c --or for Radarsat-2
c S_CROP_IN     FQ9HV_20090515.tif              // please link the actual input file with "ln -s" 
c
c --or for Cosmo-skymed
c S_CROP_IN     slave.h5                        // please link the actual (CSKS1_SCS_B_HI_05_HH_RA_SF_date.h5) 
                                                // input file with "ln -s"
c
c --and the rest of parameters
S_CROP_OUT      $DATAOUTDIR/$SLAVE.raw          // output file
S_DBOW          101 6100 11 1010                // database output window in the radar coordinates
c S_DBOW_GEO    41.1 12.0 5000 1000             // lat_0[deg], lon_0, height, width[pix]


#   ------------------------------------------
#      OVERSAMPLE (slave)
#   ------------------------------------------

S_OVS_OUT             $DATAOUTDIR/${SLAVE}_ovs.raw   // output filename              
S_OVS_OUT_FORMAT      ci2   // output format for the oversampled image ci2 | cr4.
S_OVS_FACT_RNG        2     // range oversampling ratio
S_OVS_FACT_AZI        1     // azimuth oversampling ratio (>1 not implemented yet!)
S_OVS_KERNELSIZE      16    // interpolation kernel length 
c
c
STOP                                            // mandatory
# vim: syntax=doris
__GENEOF_2b
  }

#
GEN_3()
  {
  fn=$INPUT_3
  GENERAL
  FILES
  cat << __GENEOF_3a
PROCESS         coarseorb               // no cards later
PROCESS         coarsecorr              // based on correlation
PROCESS       m_filtazi                 // azimuth filter
PROCESS       s_filtazi                 // azimuth filter
c PROCESS       filtrange               // range filter (orbits)
c -- note that fine requires good initial offset by coarsecorr   --
c -- ..and/or coarseorb.  See the logfile if the coarse offset   --
c -- ..is computed correctly if you have low coherence after fine --
PROCESS         fine                    // fine coregistration
PROCESS         reltiming               // relative timing error master-slave
PROCESS         demassist               // DEM assisted coregistration
__GENEOF_3a
  cat << __GENEOF_3b


#   ------------------------------------------
#      COARSE COREGISTRATION
#   ------------------------------------------

CC_METHOD       magfft                  // default
c CC_METHOD     magspace                // 
CC_NWIN         21                      // number of large windows
CC_WINSIZE      256 256                 // size of windows (square better?)
c CC_INITOFF    0 0                     // initial offset
CC_INITOFF      orbit                   // use result of orbits


#   ------------------------------------------
#      AZIMUTH FILTERING
#   ------------------------------------------

c AF_METHOD                             //
AF_BLOCKSIZE    1024                    // fftlength each column
AF_OVERLAP      64                      // hbs
AF_HAMMING      0.75                    // alpha of hamming, see logfile
AF_OUT_MASTER   $DATAOUTDIR/$MASTER.af
AF_OUT_SLAVE    $DATAOUTDIR/$SLAVE.af
AF_OUT_FORMAT   cr4                     //


#   ------------------------------------------
#      RANGE FILTERING (master&slave)
#   ------------------------------------------

RF_METHOD       porbits                 // based on orbit geometry
RF_SLOPE        0.0                     // [deg] and terrain slope
RF_FFTLENGTH    1024                    // power of 2
RF_HAMMING      0.75                    // 'alpha'
RF_OUT_MASTER   $DATAOUTDIR/$MASTER.rf_orb
RF_OUT_SLAVE    $DATAOUTDIR/$SLAVE.rf_orb
RF_OUT_FORMAT   cr4                     //


#   ------------------------------------------
#      FINE COREGISTRATION
#   ------------------------------------------

c FC_METHOD       magfft                // fast
FC_METHOD     oversample                // best: oversample complex data
c FC_METHOD     magspace                // same as magfft
FC_NWIN         601                     // number of smaller windows
c FC_IN_POS       highcorr.pos          // filename with window positions
FC_WINSIZE      64 64                   // size of windows
FC_ACC          8 8                     // search window, 2^n
FC_INITOFF      coarsecorr              // use result of coarse
FC_OSFACTOR     32                      // oversampling factor
FC_PLOT         0.2 NOBG                // GMT plot with magnitude background


#   ------------------------------------------
#      RELATIVE TIMING ERROR
#   ------------------------------------------

RTE_THRESHOLD  0.4
RTE_MAXITER  10000
RTE_K_ALPHA  1.97


#   ------------------------------------------
#      DEM ASSISTED COREGISTRATION
#   ------------------------------------------

DAC_IN_DEM     final_netherlands.dem
DAC_IN_FORMAT  r4        	 // default is short integer
DAC_IN_SIZE    4801 6001
DAC_IN_DELTA   0.000833333  0.000833333 
DAC_IN_UL      54  3 
DAC_IN_NODATA  -32768
c DAC_OUT_DEM    demassist.dem
c DAC_OUT_DEMI   demassist_int.dem
c DAC_OUT_DEM_LP demheight_lp.raw 
 
c                                       //
c                                       //
STOP                                    // mandatory
# vim: syntax=doris
__GENEOF_3b
  }
#
#
GEN_4()
  {
  fn=$INPUT_4
  GENERAL
  FILES
  cat << __GENEOF_4a
c -- note that coregpm requires a threshold, and you may need    --
c -- ..to run step coregpm again.  I put it here as process      --
c -- ..to obtain an automatic processing for my test data.       --
c -- ..but normally you have to remove some points interactively --
c -- ..in an iterative way (i.e., before running "resample).     --
PROCESS         coregpm                 // estimate coregistration param.
PROCESS         resample                // slave
c -- note that filtrange adaptive is recommended to run.         --
c PROCESS       filtrange               // master&slave
__GENEOF_4a
  cat << __GENEOF_4b


#   ------------------------------------------
#      COREGISTRATION PARAMETERS MODELING
#   ------------------------------------------

CPM_THRESHOLD   0.2                     // higher threshold->less windows
c CPM_DEGREE      2                       // 2d-polynomial 
CPM_DEGREE      1                       // 1d-polynomial (if demassist coregistration)
c CPM_WEIGHT      linear                // or [none]
c CPM_WEIGHT      quadratic             // or [none]
CPM_WEIGHT      bamler                  // paper R.Bamler, IGARSS 2000/2004
CPM_MAXITER     10000                      // automated removal, max 10000 iterations
c CPM_K_ALPHA     1.97                  // automated removal crit. value
CPM_PLOT        NOBG                    // plot w/o magnitude background
c CPM_DUMP      OFF                     // no creation of files


#   ------------------------------------------
#      RESAMPLING SLAVE
#   ------------------------------------------

c --- Interpolation Kernel ---
c RS_METHOD     tri                     // linear
c RS_METHOD     nearest                 // nearest neighbour
c RS_METHOD     cc4p                    // cubic convolution
c RS_METHOD     cc6p                    // good choice; tested
c RS_METHOD     ts6p                    // truncated sinc
c RS_METHOD     ts8p                    // truncated sinc
c RS_METHOD     ts16p                   // slower but better
c RS_METHOD       knab6p                // better than cc6 (theory)
c RS_METHOD       knab8p                // KNAB window
c RS_METHOD       knab10p               // KNAB window
c RS_METHOD       knab16p               // KNAB window
c RS_METHOD       knab4p                // KNAB window
RS_METHOD       rc6p                    // best choice (theory 0.9999)
c RS_METHOD       rc12p                 // best choice (theory 0.9999)
c
c --- Output file ---
RS_OUT_FILE     $DATAOUTDIR/$SLAVE.resampled
RS_OUT_FORMAT   cr4                     //
c RS_DBOW       2000 3000 1 5000        // database output window
c RS_DBOW_GEO     52.6743 5.3434 10000 2000  // lat_0[deg], lon_0, height, width[pix]
RS_SHIFTAZI     on                      // keep this on


#   ------------------------------------------
#      RANGE FILTERING (master&slave)
#   ------------------------------------------

RF_METHOD       adaptive                // estimate local fringe freq.
c RF_FFTLENGTH    8                     // 8 pixels ~ 160m ground range
c RF_FFTLENGTH    32                    // 32 pixels ~ 640m ground range
RF_FFTLENGTH    128                     // 128 pixels ~ 2500m ground range
RF_OVERLAP      50                      // half overlap
RF_OVERSAMPLE   2                       // master/slave before ifg generation
RF_NLMEAN       9                       // must be odd (15 pixels ~ 60m)
RF_THRESHOLD    2                       // SNR spectral peak detection
RF_HAMMING      0.75                    // alpha of Hamming window
RF_WEIGHTCORR   OFF
RF_OUT_MASTER   $DATAOUTDIR/$MASTER.rf_adapt
RF_OUT_SLAVE    $DATAOUTDIR/$SLAVE.rf_adapt
c RF_OUT_FORMAT   ci2                   // reduce output file size
c                                       //
c                                       //
STOP                                    // mandatory
# vim: syntax=doris
__GENEOF_4b
  }
#
#
GEN_5()
  {
  fn=$INPUT_5
  GENERAL
  FILES
  cat << __GENEOF_5a
PROCESS       interfero                 //
// -- note: compute reference phase after interfero,    --
// -- ..otherwise it is subtracted in INT_METHOD old    --
PROCESS       comprefpha                // estimate flatearth param.
PROCESS       subtrrefpha               //
PROCESS       comprefdem                // synthetic phase from DEM
PROCESS       subtrrefdem               //
PROCESS       coherence                 //
__GENEOF_5a
  cat << __GENEOF_5b


#   ------------------------------------------
#      INTERFEROGRAM
#   ------------------------------------------

INT_METHOD      old                     // 
c INT_METHOD    oversample              // 
INT_OUT_CINT    $DATAOUTDIR/${MASTER}_${SLAVE}.cint // optional complex int.
c INT_OUT_INT   $DATAOUTDIR/${MASTER}_${SLAVE}.int  // optional real int. 
INT_MULTILOOK   5 1                     // line, pixel factors


#   ------------------------------------------
#      REFERENCE PHASE COMPUTATION
#   ------------------------------------------

FE_METHOD       porbits                 //
c FE_METHOD     method2                 // not implemented?
FE_DEGREE       5                       //
FE_NPOINTS      501                     //


#   ------------------------------------------
#      SUBTRACT REFERENCE PHASE
#   ------------------------------------------

c SRP_METHOD    exact                   // compute foreach pixel
c SRP_METHOD    polynomial              // evaluate comprefpha poly
SRP_OUT_CINT    $DATAOUTDIR/${MASTER}_${SLAVE}.srp  //
SRP_MULTILOOK   2 2
c SRP_DUMPREFPHA        ON
c SRP_OUT_REFPHA        $DATAOUTDIR/refphase.cr4  // only output for debug


#   ------------------------------------------
#      REFERENCE DEM
#   ------------------------------------------

CRD_IN_DEM      /home/fmr/d4/dem/gtopo30/w020n90/W020N90.DEM
c CRD_IN_FORMAT r4                              // default is short integer
CRD_IN_UL       89.995833333333333 -19.995833333333333333333    // w020n90.HDR
CRD_IN_SIZE     6000 4800                       // number of rows columns
CRD_IN_DELTA    0.00833333333333333333 0.00833333333333333333  // latitude, longitude dec degrees
CRD_IN_NODATA   -9999                           // DEM invalid sample indicator
CRD_INCLUDE_FE  OFF                             // phase w.r.t. ellips
c CRD_OUT_DEM     $DATAOUTDIR/DEM_crop.raw          // debug cropped dem
c CRD_OUT_DEMI    $DATAOUTDIR/DEM_crop_interp.raw   // debug cropped dem interpolated
c CRD_OUT_DEM_LP  $DATAOUTDIR/refdem_hei.raw        // DEM [m] in radar geometry
CRD_OUT_FILE    $DATAOUTDIR/refdem_pha.raw          // phase of DEM


#   ------------------------------------------
#      SUBTRREF DEM
#   ------------------------------------------

SRD_OUT_CINT    $DATAOUTDIR/${MASTER}_${SLAVE}.srd  //
c                                               //
c                                               //

#   ------------------------------------------
#      COHERENCE
#   ------------------------------------------

c COH_METHOD      refphase_only                 // 
COH_METHOD      include_refdem                  // remove topographic phase also.
c COH_OUT_CCOH  $DATAOUTDIR/${MASTER}_${SLAVE}.ccoh // optional complex image
COH_OUT_COH     $DATAOUTDIR/${MASTER}_${SLAVE}.coh  // optional real
COH_MULTILOOK   10 2                            // same as interferogram
COH_WINSIZE     20 4                            // estimator window size
c                                               //
c                                               //
STOP                                            // mandatory
# vim: syntax=doris
__GENEOF_5b
  }
#
#
GEN_6()
  {
  fn=$INPUT_6
  GENERAL
  FILES
  cat << __GENEOF_6a
c -- note to set filtparameters correctly, or not to filter. --
c -- ..also set unwrap snaphu to correct model.              --
c -- ..unwrap relies on snaphu to be installed!              --
PROCESS       filtphase                         // filter interferogram
PROCESS       unwrap                            // unwrap interferogram
c PROCESS         dinsar                          // differential interferogram
__GENEOF_6a
  cat << __GENEOF_6b


#   ------------------------------------------
#      PHASE FILTERING
#   ------------------------------------------

c PF_IN_FILE   $DATAOUTDIR/${MASTER}_${SLAVE}.srp 323  // only for standalone usage
PF_OUT_FILE  $DATAOUTDIR/${MASTER}_${SLAVE}.cint.filtered
PF_METHOD    spatialconv
PF_KERNEL    5 1 1 1 1 1
c c PF_KERNEL    5 1 4 9 4 1
c c PF_KERNEL    5 1 2 3 2 1
c c PF_KERNEL    3 -1 1 0
c c PF_IN_KERNEL2D    myfilt.asc
 c
c PF_METHOD    goldstein
c PF_ALPHA     1.8
c PF_BLOCKSIZE 32
c PF_OVERLAP   12
c PF_KERNEL    5 1 1 1 1 1


#   ------------------------------------------
#      PHASE UNWRAPPING
#   ------------------------------------------

c UW_METHOD       RAMON                         // (delft only)
c UW_SEEDS        100                           // delta seedL = seedP
c UW_SEEDS      100 200                         //
c UW_SEEDS      seedfilename                    // put EOL after last
UW_OUT_FILE     $DATAOUTDIR/${MASTER}_${SLAVE}.uint // unwrapped interferogram
c UW_OUT_REGIONS    $DATAOUTDIR/${MASTER}_${SLAVE}.regions // 2b used with manuw.m
UW_METHOD         SNAPHU
UW_OUT_FORMAT     HGT
UW_SNAPHU_LOG     snaphu.log
UW_SNAPHU_coh     $DATAOUTDIR/${MASTER}_${SLAVE}.coh
UW_SNAPHU_MODE    TOPO
UW_SNAPHU_INIT    MST
UW_SNAPHU_VERBOSE ON


#   ------------------------------------------
#      DIFFERENTIAL INSAR
#   ------------------------------------------

DI_OUT_FILE     $DATAOUTDIR/${MASTER}_${SLAVE}.dcint // differential
DI_IN_TOPOSLAVE  topodir/slave.res
DI_IN_TOPOINT    topodir/products.res
c DI_IN_TOPOMASTER topodir/master.res           // 4 pass
c DI_OUT_SCALED   debug.raw
c                                               //
c                                               //
STOP                                            // mandatory
# vim: syntax=doris
__GENEOF_6b
  }
#
#
GEN_7()
  {
  fn=$INPUT_7
  GENERAL
  FILES
  cat << __GENEOF_7a
PROCESS         slant2h                         //
PROCESS         geocode                         //
__GENEOF_7a
  cat << __GENEOF_7b


#   ------------------------------------------
#      SLANT TO HEIGHT CONVERSION
#   ------------------------------------------

c
c S2H_METHOD      ambiguity                       //
c S2H_METHOD      rodriguez                       //
S2H_METHOD      schwabisch                      // adviced!
S2H_NPOINTS   200                             //
S2H_DEGREE1D  2                               //
S2H_NHEIGHTS  3                               //
S2H_DEGREE2D  5                               //
S2H_OUT_HEI     $DATAOUTDIR/heights.raw         //
C S2H_OUT_HEI     $DATAOUTDIR/s2h_heights.raw         //
C S2H_OUT_LAM     $DATAOUTDIR/s2h_lambda.raw      //
C S2H_OUT_PHI     $DATAOUTDIR/s2h_phi.raw         //


#   ------------------------------------------
#      GEOCODING
#   ------------------------------------------

GEO_OUT_PHI     $DATAOUTDIR/phi.raw             //
GEO_OUT_LAM     $DATAOUTDIR/lambda.raw          //
c                                               //
c                                               //
STOP                                            // mandatory
# vim: syntax=doris
__GENEOF_7b
  }
#
#
GEN_8()
  {
  fn=$INPUT_8
  GENERAL
  FILES
  cat << __GENEOF_8a
PROCESS         ???
__GENEOF_8a
  cat << __GENEOF_8b


#   ------------------------------------------
#      ??
#   ------------------------------------------

c CARDS GO HERE
c CARDS GO HERE
c CARDS GO HERE
c                                               //
c                                               //
STOP                                            // mandatory
__GENEOF_8b
  }
#
#
GEN_9()
  {
  fn=$INPUT_9
  cat << __GENEOF_9a
######################################################################################
### This is a (full scene) quicklook processing.  To quickly see the ifg etc,      ###
### use "run -ql (or equivalently run -s9)".                                       ###
###  this will run -s1; run -s2; run -s9 (i.e, read files, process them            ###
### Therefore, also edit step1,2 input (run -e1; run -e2) to set input filenames.  ###
### You can set the DBOW crop there.   If master.res or slave.res already exist    ###
### then these steps are skipped.                                                  ###
###                                                                                ###
### Basically we read the data, then automated coregistration with lower quality,  ###
### fast resampling to short output format, and form the interferogram, flatten it ###
### and compute the coherence image, all heavily multilooked.                      ###
### NO spektral filtering. Experimental...                                         ###
###                                                                                ###
### This takes about 6 minutes for a quarter scene.                                ###
###                                                                                ###
###%// BK 15-Sep-2003                                                              ###
######################################################################################
SCREEN        info                    // level of output to standard out
BEEP          warning                 // level of beeping
PREVIEW       on                      // SUNraster files with cpxfiddle
MEMORY        200                     // MB
OVERWRITE     ON                      // overwrite existing files
BATCH         ON                      // non-interactive
LISTINPUT     ON                      // copy this file to log
ORB_INTERP    POLYFIT 3               // orbit interpolation method
LOGFILE       quicklook.log              //
M_RESFILE     master_QL.res           // after run -s1, run -s2 the files are 
S_RESFILE     slave_QL.res            // copied to these
I_RESFILE     ifg_QL.res              // names
###
###
PROCESS       coarseorb               // no cards later
PROCESS       coarsecorr              // based on correlation
PROCESS       fine                    // fine coregistration
PROCESS       coregpm                 // estimate coregistration param.
PROCESS       resample                // slave
PROCESS       interfero               //
PROCESS       comprefpha              // estimate flatearth param.
PROCESS       subtrrefpha             //
PROCESS       coherence               //
###
###
CC_METHOD       magfft                  // default
CC_NWIN         21                      // number of windows
CC_WINSIZE      256 256                 // size of large windows
CC_INITOFF      orbit                   // use result of orbits
###
###
FC_METHOD       magfft                  //
FC_NWIN         501                     // number of windows
FC_WINSIZE      64 64                   // size of small windows
FC_ACC          8 8                     // search window, 2^n
FC_INITOFF      coarsecorr              // use result of coarse
FC_OSFACTOR     8                       // oversampling factor
###
###
CPM_THRESHOLD   0.2                     //
CPM_DEGREE      2                       //
CPM_WEIGHT      quadratic               // none | linear | quadratic
CPM_MAXITER     350                     // automated removal, max 20 iterations
CPM_K_ALPHA     5.00                    // automated removal crit. value
###
###
RS_METHOD       tri                     // linear interpolation
RS_OUT_FILE     $DATAOUTDIR/$SLAVE.resampled_QL
RS_OUT_FORMAT   ci2                     //
RS_SHIFTAZI     off                     // doppler
###
###
INT_METHOD      old                     // 
INT_OUT_CINT    $DATAOUTDIR/${MASTER}_${SLAVE}.cint_QL // optional complex int.
INT_MULTILOOK   10 2                    // 20 x 20 m
###
###
FE_METHOD       porbits                 //
FE_DEGREE       5                       //
FE_NPOINTS      301                     //
###
###
SRP_OUT_CINT    $DATAOUTDIR/${MASTER}_${SLAVE}.srp_QL  //
SRP_MULTILOOK   3 3                     // total 60x60 m
###
###
COH_METHOD      refphase_only                   // options: refphase_only or include_refdem
COH_OUT_COH     $DATAOUTDIR/${MASTER}_${SLAVE}.coh_QL  // optional real
COH_MULTILOOK   30 6                            //
COH_WINSIZE     30 6                            //
###
STOP                                            // mandatory
# vim: syntax=doris
__GENEOF_9a
  }


GENERATE()
  {
#BK 19-Jan-2001: set resultfiles -M -S option
MASTERRES="$MASTER.res"
SLAVERES="$SLAVE.res"
INTERFRES="${MASTER}_${SLAVE}.res"

# Workdir
if [ ! -d $WORKDIR ]; then
  mkdir $WORKDIR
  echo "${bn}: ***INFO***    workdir: $WORKDIR created."
fi
# Directory where input prototypes are stored.
if [ -d $INPUTDIR ]; then
  echo "${bn}: ***WARNING*** inputdir: $INPUTDIR existed, I renamed it to $INPUTDIR.$$."
  mv -f $INPUTDIR $INPUTDIR.$$
fi
mkdir $INPUTDIR

# Output directory for redirected standard output.
if [ -d $OUTPUTDIR ]; then
  echo "${bn}: ***WARNING*** outputdir: $OUTPUTDIR existed, I renamed it to $OUTPUTDIR.$$"
  mv -f $OUTPUTDIR $OUTPUTDIR.$$
fi
mkdir $OUTPUTDIR

# Output directory for matrices.
if [ ! -d $DATAOUTDIR ]; then
  mkdir $DATAOUTDIR
fi

# Test if executable is present.
#if [ ! -x $SWDIR/$PROG ]; then
#  echo "executable: $SWDIR/$PROG not present."
#  if [ ! -x $WORKDIR/$PROG ]; then
#    echo "also not in workdir: $WORKDIR, exiting."
#    exit 4
#  fi
#  echo "Continuing"
#fi
#if [ -x $WORKDIR/$PROG ]; then
#  echo "executable already present in: $WORKDIR/$PROG, I renamed it to $WORKDIR/$PROG.$$"
#  mv -f $WORKDIR/$PROG $WORKDIR/$PROG.$$
#fi

#  cp   $SWDIR/$PROG    $WORKDIR/$PROG
  GEN_1 > $INPUTDIR/$INPUT_1
  GEN_2 > $INPUTDIR/$INPUT_2
  GEN_3 > $INPUTDIR/$INPUT_3
  GEN_4 > $INPUTDIR/$INPUT_4
  GEN_5 > $INPUTDIR/$INPUT_5
  GEN_6 > $INPUTDIR/$INPUT_6
  GEN_7 > $INPUTDIR/$INPUT_7
#  GEN_8 > $INPUTDIR/$INPUT_8
  GEN_9 > $INPUTDIR/$INPUT_9

  echo "${bn}: ***INFO***    generation of inputfiles finished."
  echo "${bn}: ***INFO***    inputdir:   $INPUTDIR"
  echo "${bn}: ***INFO***    outputdir (stout):  $OUTPUTDIR"
  echo "${bn}: ***INFO***    outputdir (matrices):  $DATAOUTDIR"
#
# BK 25-feb-2000
# 2nd check is not ok, should check with whence?
#
if [ -x $PROGINCWD ]; then
  echo "${bn}: ***INFO***    Using executable in cwd: $PROGINCWD"
else
  echo "${bn}: ***INFO***    Using executable in path:  $PROG"
  echo "${bn}: ***INFO***    or (if -d option present): $PROGDEBUG"
fi
  echo "${bn}: ***TIP***     run -e1; run -s1"
  exit 0
  }


##################################################
# START SCRIPT ---------------
# Set viewer (if no default environment variables: PAGER and EDITOR) ###
# Set PAGER (VIEWER) and EDITOR if not default (prefer less and nedit)
if [ "X$PAGER" = "X" ]; then
  #default should be specified in your login resource file.
  echo "environment variable PAGER not set, please set this variable"
  echo "to specify your prefered viewer.  For example in csh shell type:"
  echo " setenv PAGER more"
  echo " setenv PAGER less   (adviced)"
  #PAGER="more"
  PAGER="less"
  $PAGER 2>&1
  if [ "$status" = "0" ]; then
    echo "PAGER: $PAGER found in path..."
  else
    PAGER="more"
    echo "using PAGER $PAGER"
  fi
fi
VIEWER="$PAGER"
if [ "X$EDITOR" = "X" ]; then
  #default should be specified in your login resource file.
  echo "environment variable EDITOR not set, please set this variable"
  echo "to specify your prefered editor.  For example in csh shell type:"
  echo " setenv EDITOR vi"
  echo " setenv EDITOR nedit"
  echo " setenv EDITOR xemacs"
  EDITOR="nedit"
  $EDITOR 2>&1
  if [ "$status" = "0" ]; then
    echo "EDITOR: $EDITOR found in path..."
  else
    EDITOR="vi"
    echo "using EDITOR $EDITOR"
  fi
fi

# Assume template inputfile are generated, obtain name of files...
# only for view?
if [ "$DOGENERATE" = "0" ]; then
  if [ -r $INPUTDIR/$INPUT_1 ]; then
    MASTERRES=`awk '/M_RESFILE/ {print $2}' $INPUTDIR/$INPUT_1`
    SLAVERES=`awk  '/S_RESFILE/ {print $2}' $INPUTDIR/$INPUT_1`
    INTERFRES=`awk '/I_RESFILE/ {print $2}' $INPUTDIR/$INPUT_1`
  fi
fi

# Help wanted?
#if [ $# -eq 1 -a "$1" = "-h" ]; then
if [ "$1" = "-h" ]; then
  name=`NAME`
  synopsis=`SYNOPSIS`
  MANPG | $PAGER
  exit
fi


### Simple options parsing by bert... since getopts not known on my cygwin sh shell (?)
### This is slower and not tested properly like lib function, but seems to work.
### Also it doesn't incorporate numargs exceptions checks.
### Bert Kampes, 03-Feb-2002.
#1) delete all spaces from input option string, delimiters are - signs
#2) insert spaces before - signs (use QQQ to keep spaces in OPTARG)
#3) for each word, obtain option and argument
#INPUTARGS=`echo "$*" | sed 's/ /QQQ/g' | sed 's/-/ -/g'`
INPUTARGS=`echo "$*" | sed 's/ //g' | sed 's/-/ -/g'`
for OPTION in $INPUTARGS; do
  OPTKEY=`echo $OPTION | awk '{print substr($1,1,2)}'`
  OPTARG=`echo $OPTION | awk '{print substr($1,3)}'`
#  OPTARG=`echo $OPTION | awk '{print substr($1,3)}' | sed 's/QQQ/ /g'`
#  echo "OPTKEY: "XXX${OPTKEY}XXX
#  echo "OPTARG: "XXX${OPTARG}XXX
#  if test "$OPTKEY"="-f"; then
#    INPUT="$OPTARG"
#  fi
### quicklook run step 9
  case $OPTKEY in
    -f)   INPUT=$OPTARG                 ;;
    -d)   PROG=$PROGDEBUG               ;;
    -s)   STEP=$OPTARG                  ;;
    -q)   STEP=9                        ;;
    -e)   EDIT=$OPTARG                  ;;
    -v)   VIEW=$OPTARG                  ;;
    -r)   RESULT=$OPTARG                ;;
    -g)   DOGENERATE="1"                ;;
    -M)   MASTER=$OPTARG                ;;
    -S)   SLAVE=$OPTARG                 ;;
    -A)   AUTHOR=$OPTARG                ;;
    -B)   BASELINE=$OPTARG              ;;
    -R)   REMARKS=$OPTARG               ;;
    -h)  USAGE                          ;;
    \?)  USAGE                          ;;
    *)   echo "wrong input argument"; USAGE             ;;
  esac
done

### OLD KSH getopts...
### Get other options.
###OPTIONS="f:s:e:v:r:M:S:A:B:R:gd"
###while getopts $OPTIONS OPT; do
###  case $OPT in
###    f)   INPUT=$OPTARG                               ;;
###    d)   PROG=$PROGDEBUG                     ;;
###    s)   STEP=$OPTARG                                ;;
###    e)   EDIT=$OPTARG                                ;;
###    v)   VIEW=$OPTARG                                ;;
###    r)   RESULT=$OPTARG                              ;;
###    g)   DOGENERATE="1"                      ;;
###    M)   MASTER=$OPTARG                              ;;
###    S)   SLAVE=$OPTARG                       ;;
###    A)   AUTHOR=$OPTARG                              ;;
###    B)   BASELINE=$OPTARG                    ;;
###    R)   REMARKS=$OPTARG                     ;;
###    \?)  USAGE                                       ;;
###  esac
###done

# Check any input.
if [ "$1" = "" ]; then
  USAGE
fi

# -g option.
if [ "$DOGENERATE" = "1" ]; then
  GENERATE
fi

# -e option.
case $EDIT in
  1)   if [ -r $INPUTDIR/$INPUT_1 ]; then
         $EDITOR $INPUTDIR/$INPUT_1
         #echo "don't forget to mountcd";
         echo "to run, use: $bn -s$EDIT"
       else
         echo "${bn}: ***ERROR*** file $INPUTDIR/$INPUT_1 not found."
       fi;;
  2)   if [ -r $INPUTDIR/$INPUT_2 ]; then 
         $EDITOR $INPUTDIR/$INPUT_2
         #echo "don't forget to mountcd"
         echo "to run, use: $bn -s$EDIT"
       else
         echo "${bn}: ***ERROR*** file $INPUTDIR/$INPUT_2 not found."
       fi;;
  3)   if [ -r $INPUTDIR/$INPUT_3 ]; then 
         $EDITOR $INPUTDIR/$INPUT_3
         echo "to run, use: $bn -s$EDIT"
       else
         echo "${bn}: ***ERROR*** file $INPUTDIR/$INPUT_3 not found."
       fi;;
  4)   if [ -r $INPUTDIR/$INPUT_4 ]; then 
         $EDITOR $INPUTDIR/$INPUT_4
         echo "to run, use: $bn -s$EDIT"
       else
         echo "${bn}: ***ERROR*** file $INPUTDIR/$INPUT_4 not found."
       fi;;
  5)   if [ -r $INPUTDIR/$INPUT_5 ]; then 
         $EDITOR $INPUTDIR/$INPUT_5
         echo "to run, use: $bn -s$EDIT"
       else
         echo "${bn}: ***ERROR*** file $INPUTDIR/$INPUT_5 not found."
       fi;;
  6)   if [ -r $INPUTDIR/$INPUT_6 ]; then 
         $EDITOR $INPUTDIR/$INPUT_6
         echo "to run, use: $bn -s$EDIT"
       else
         echo "${bn}: ***ERROR*** file $INPUTDIR/$INPUT_6 not found."
       fi;;
  7)   if [ -r $INPUTDIR/$INPUT_7 ]; then 
         $EDITOR $INPUTDIR/$INPUT_7
         echo "to run, use: $bn -s$EDIT"
       else
         echo "${bn}: ***ERROR*** file $INPUTDIR/$INPUT_7 not found."
       fi;;
  8)   if [ -r $INPUTDIR/$INPUT_8 ]; then 
         $EDITOR $INPUTDIR/$INPUT_8
         echo "to run, use: $bn -s$EDIT"
       else
         echo "${bn}: ***ERROR*** file $INPUTDIR/$INPUT_8 not found."
       fi;;
  9)   if [ -r $INPUTDIR/$INPUT_9 ]; then 
         $EDITOR $INPUTDIR/$INPUT_9
         echo "to run, use: $bn -s$EDIT"
       else
         echo "${bn}: ***ERROR*** file $INPUTDIR/$INPUT_9 not found."
       fi;;
  999)                                                  ;;
  *)   echo "wrong -e(dit) argument"; USAGE             ;;
esac


# -s option.
if [ "$STEP" != "999" ]; then
  case $STEP in
    1)   INPUT=$INPUT_1                         ;;
    2)   INPUT=$INPUT_2                         ;;
    3)   INPUT=$INPUT_3                         ;;
    4)   INPUT=$INPUT_4                         ;;
    5)   INPUT=$INPUT_5                         ;;
    6)   INPUT=$INPUT_6                         ;;
    7)   INPUT=$INPUT_7                         ;;
    8)   INPUT=$INPUT_8                         ;;
    9)   INPUT=$INPUT_9                         ;;
#    999)                                       ;;
    *)   echo "wrong -s argument"; USAGE        ;;
  esac

  #substitution problem on capone with sh? (simple solution change name...)
  #%// BK 16-Jun-2003
  #OUTFILE=$OUTPUTDIR/out.${INPUT#input.}
  OUTFILE=$OUTPUTDIR/stdout.$INPUT
  INPUT=$INPUTDIR/$INPUT
  ### Check if there is an inputfile.
  if [ ! -r $INPUT ]; then
    echo "${bn}: ***ERROR***   Inputfile: $INPUT not readable, exiting"
    exit
  fi;

  ### Check if output allready exists.
  if [ -f $OUTFILE ]; then
    echo "${bn}: ***WARNING*** (redirected) outputfile: $OUTFILE existed, I renamed it to $OUTFILE.$$"
    mv -f $OUTFILE $OUTFILE.$$
  fi;
  
  ### if no -d option and prog "doris" is present in cwd, use it.
  if [ -x $PROGINCWD ] && [ $PROG != $PROGDEBUG ]; then
    PROG=$PROGINCWD
  fi;

  ### If quicklook processing, first run step1 and step2 to read the data
  ### this means step=9, and run that after that!
  touch $OUTFILE
  if [ "$STEP" = "9" ]; then
    touch $LOGFILE
    mv $LOGFILE $LOGFILE.tmp
    echo " "
    echo " - - PERFORMING QUICKLOOK PROCESSING - -"
    echo " "
    echo " First I will do: run -s1, then run -s2 (readfiles and crop)"
    echo " Then I will copy the resultfiles to new QL names"
    echo " Then I will do: run -s9 (the steps to get the interferogram)"
    echo " "
    echo " I will pause after the master has been read, so you can change the CDROM"
    echo " "
    echo " ---------------------------------------------------------------" >> $OUTFILE
    echo " --- START STEP 1 for QUICKLOOK --------------------------------" >> $OUTFILE
    echo " ---------------------------------------------------------------" >> $OUTFILE
    if [ -f master_QL.res ]; then
      echo " SKIPPING run -s1 since file master_QL.res exists (master has been read)"
    else
      $PROG $INPUTDIR/$INPUT_1 >> $OUTFILE
      if [ ! -f $MASTERRES ]; then
        echo "file $MASTERRES does not exist.  Exiting."
        mv $LOGFILE.tmp $LOGFILE
        exit 1
      fi;
      cp $MASTERRES master_QL.res
    fi;
    echo " "
    echo " *************************************************************"
    echo " *** Pausing after reading master so you can change cdrom. ***"
    echo " *** Press <ENTER> when ready to proceed.                  ***"
    echo " *************************************************************"
    echo " "
    read key
    echo " "
    echo " ---------------------------------------------------------------" >> $OUTFILE
    echo " --- START STEP 2 for QUICKLOOK --------------------------------" >> $OUTFILE
    echo " ---------------------------------------------------------------" >> $OUTFILE
    if [ -f slave_QL.res ]; then
      echo " SKIPPING run -s1 since file slave_QL.res exists (slave has been read)"
    else
      $PROG $INPUTDIR/$INPUT_2 >> $OUTFILE
      if [ ! -f $SLAVERES ]; then
        echo "file $SLAVERES does not exist.  Exiting."
        mv $LOGFILE.tmp $LOGFILE
        exit 1
      fi;
      cp $SLAVERES  slave_QL.res
    fi;
    echo " "
    echo " Done with reading slave (and master).  Proceeding with quicklook"
    echo " First copying master and slave result file to master_QL.res, slave_QL.res"
    echo " "
    echo " ---------------------------------------------------------------" >> $OUTFILE
    echo " --- START STEP 9 for QUICKLOOK --------------------------------" >> $OUTFILE
    echo " --- (first moving the output files of run -s1 and run -s2 -----" >> $OUTFILE
    echo " ---------------------------------------------------------------" >> $OUTFILE
    mv $LOGFILE quicklook.log
    mv $LOGFILE.tmp $LOGFILE
    if [ -f ifg_QL.res ]; then
      echo "file ifg_QL.res already exists??? continuing..."
    fi;
  fi;

  ### Execute program (use >> for quicklook, is an empty touched file anyway)
  echo "  $PROG $INPUT >> $OUTFILE "
  echo " "
  $PROG $INPUT >> $OUTFILE
  echo " "
  echo "   Redirected output in file: $OUTFILE"
  echo "   view with: run -v$STEP"

  ### Save some work for user / tips ###
  if [ "$STEP" = "1" ]; then
    #    echo " don't forget to umountcd"
    echo " NOTE: before run -s1, you can do run -ql to get a quicklook processing."
    echo "       which will run step 1 and 2 if not done already."
  fi;
  if [ "$STEP" = "9" ]; then
    echo " "
    echo " Moving quicklook output to QL sub directory."
    echo " "
    mkdir QL
    mv *ras *ras.sh *_QL* *quicklook* ./QL
  fi;
fi;


### -v option.
case $VIEW in
  1)   if [ -r $OUTPUTDIR/stdout.$INPUT_1 ]; then
         $VIEWER $OUTPUTDIR/stdout.$INPUT_1
       else
         echo "${bn}: ***ERROR*** file $OUTPUTDIR/stdout.$INPUT_1 not found."
       fi;;
  2)   if [ -r $OUTPUTDIR/stdout.$INPUT_2 ]; then
         $VIEWER $OUTPUTDIR/stdout.$INPUT_2
       else
         echo "${bn}: ***ERROR*** file $OUTPUTDIR/stdout.$INPUT_2 not found."
       fi;;
  3)   if [ -r $OUTPUTDIR/stdout.$INPUT_3 ]; then
         $VIEWER $OUTPUTDIR/stdout.$INPUT_3
       else
         echo "${bn}: ***ERROR*** file $OUTPUTDIR/stdout.$INPUT_3 not found."
       fi;;
  4)   if [ -r $OUTPUTDIR/stdout.$INPUT_4 ]; then
         $VIEWER $OUTPUTDIR/stdout.$INPUT_4
       else
         echo "${bn}: ***ERROR*** file $OUTPUTDIR/stdout.$INPUT_4 not found."
       fi;;
  5)   if [ -r $OUTPUTDIR/stdout.$INPUT_5 ]; then
         $VIEWER $OUTPUTDIR/stdout.$INPUT_5
       else
         echo "${bn}: ***ERROR*** file $OUTPUTDIR/stdout.$INPUT_5 not found."
       fi;;
  6)   if [ -r $OUTPUTDIR/stdout.$INPUT_6 ]; then
         $VIEWER $OUTPUTDIR/stdout.$INPUT_6
       else
         echo "${bn}: ***ERROR*** file $OUTPUTDIR/stdout.$INPUT_6 not found."
       fi;;
  7)   if [ -r $OUTPUTDIR/stdout.$INPUT_7 ]; then
         $VIEWER $OUTPUTDIR/stdout.$INPUT_7
       else
         echo "${bn}: ***ERROR*** file $OUTPUTDIR/stdout.$INPUT_7 not found."
       fi;;
  8)   if [ -r $OUTPUTDIR/stdout.$INPUT_8 ]; then
         $VIEWER $OUTPUTDIR/stdout.$INPUT_8
       else
         echo "${bn}: ***ERROR*** file $OUTPUTDIR/stdout.$INPUT_8 not found."
       fi;;
  9)   if [ -r $OUTPUTDIR/stdout.$INPUT_9 ]; then
         $VIEWER $OUTPUTDIR/stdout.$INPUT_9
       else
         echo "${bn}: ***ERROR*** file $OUTPUTDIR/stdout.$INPUT_9 not found."
       fi;;
  999)                                          ;;
  *)   echo "wrong -v argument"; USAGE          ;;
esac


cd $WORKDIR
# -r option.
case $RESULT in
  1)   if [ -r $MASTERRES ]; then
         $EDIT $MASTERRES
       else
         echo "${bn}: ***ERROR*** file $MASTERRES not found."
       fi;;
  2)   if [ -r $SLAVERES ]; then
         $EDIT $SLAVERES
       else
         echo "${bn}: ***ERROR*** file $SLAVERES not found."
       fi;;
  3)   if [ -r $INTERFRES ]; then
         $EDIT $INTERFRES
       else
         echo "${bn}: ***ERROR*** file $INTERFRES not found."
       fi;;
  4)   if [ -r $LOGFILE ]; then
         $EDIT $LOGFILE
       else
         echo "${bn}: ***ERROR*** file $LOGFILE not found."
       fi;;
  999)                                  ;;
  *)   echo "wrong -v argument"; USAGE          ;;
esac


exit 0


### RCS #####
# $Source: /users/kampes/DEVELOP/DORIS/doris/bin/RCS/run,v $
# $Revision: 4.01 $
# $Author: FvL $
# $Date: 2008/12/17 12:02:06 $
# $Log: run,v $
# Revision 4.01  2008/12/17 12:02:06  FvL
# Update to doris v4.01
#
# Revision 3.47  2005/09/20 12:02:06  kampes
# *** empty log message ***
#
# Revision 3.46  2005/09/20 11:02:16  kampes
# ERR changed to ERROR
#
# Revision 3.45  2005/08/25 13:38:01  kampes
# *** empty log message ***
#
# Revision 3.44  2005/08/25 07:37:50  kampes
# *** empty log message ***
#
# Revision 3.43  2005/08/24 15:12:40  kampes
# *** empty log message ***
#
# Revision 3.42  2005/08/24 11:35:32  kampes
# *** empty log message ***
#
# Revision 3.41  2005/08/16 11:46:26  kampes
# update for v3.16
#
# Revision 3.40  2005/07/28 09:28:48  kampes
# *** empty log message ***
#
# Revision 3.39  2005/04/16 10:08:05  kampes
# *** empty log message ***
#
# Revision 3.38  2005/04/16 10:00:37  kampes
# added CRD_OUT_DEM_LP
#
# Revision 3.37  2005/04/08 14:09:53  kampes
# *** empty log message ***
#
# Revision 3.36  2005/03/08 14:04:55  kampes
# *** empty log message ***
#
# Revision 3.35  2004/09/20 08:05:59  kampes
# *** empty log message ***
#
# Revision 3.34  2004/09/15 10:49:03  kampes
# *** empty log message ***
#
# Revision 3.33  2004/09/13 08:20:57  kampes
# *** empty log message ***
#
# Revision 3.32  2004/08/24 15:33:15  kampes
# *** empty log message ***
#
# Revision 3.31  2004/08/09 09:46:53  kampes
# *** empty log message ***
#
# Revision 3.30  2004/08/03 13:22:56  kampes
# increased default memory usage
#
# Revision 3.29  2004/06/17 09:38:54  kampes
# *** empty log message ***
#
# Revision 3.28  2004/06/03 06:19:52  kampes
# *** empty log message ***
#
# Revision 3.27  2004/05/13 18:28:58  kampes
# *** empty log message ***
#
# Revision 3.26  2004/01/20 15:08:03  kampes
# added oversampling
#
# Revision 3.25  2003/12/22 06:50:51  kampes
# added knab windows card
#
# Revision 3.24  2003/12/15 07:56:41  kampes
# added DBOW_GEO card
#
# Revision 3.23  2003/11/27 16:14:54  kampes
# *** empty log message ***
#
# Revision 3.22  2003/11/27 16:01:11  kampes
# *** empty log message ***
#
# Revision 3.21  2003/11/27 15:39:42  kampes
# *** empty log message ***
#
# Revision 3.20  2003/09/15 13:27:54  kampes
# *** empty log message ***
#
# Revision 3.19  2003/09/15 13:11:26  kampes
# *** empty log message ***
#
# Revision 3.18  2003/09/15 12:24:12  kampes
# *** empty log message ***
#
# Revision 3.17  2003/09/15 10:14:08  kampes
# added quicklook
#
# Revision 3.16  2003/09/12 15:12:46  kampes
# added quicklook as s9
#
# Revision 3.15  2003/09/01 15:33:33  kampes
# *** empty log message ***
#
# Revision 3.14  2003/09/01 06:42:56  kampes
# *** empty log message ***
#
# Revision 3.13  2003/08/28 17:12:36  kampes
# added coregpm maxioter
#
# Revision 3.12  2003/08/14 08:45:58  kampes
# added jers info
#
# Revision 3.11  2003/06/24 08:32:38  kampes
# release version
#
# Revision 3.10  2003/06/17 13:24:00  kampes
# *** empty log message ***
#
# Revision 3.9  2003/06/16 14:59:10  kampes
# increased default numwindows fine coreg.
#
# Revision 3.8  2003/06/16 11:44:33  kampes
# seemed to be a problem with run file variable name substitution.
#
# Revision 3.7  2003/06/16 07:05:11  kampes
# new version
#
# Revision 3.6  2003/04/15 06:31:58  kampes
# *** empty log message ***
#
# Revision 3.5  2003/04/14 06:35:15  kampes
# doris release 3.5
#
# Revision 1.60  2001/09/28  14:09:57  14:09:57  kampes (B.M.Kampes)
# release doris 3.2
# 
# Revision 1.57  2000/12/07  13:53:44  13:53:44  kampes (B.M.Kampes)
# release 3
# 
# Revision 1.56  2000/10/24  13:46:20  13:46:20  kampes (B.M.Kampes)
# doris2.6
# 
# Revision 1.42  2000/04/05  11:37:13  11:37:13  kampes (B.M.Kampes)
# range filtering
# 
# Revision 1.41  2000/02/25  15:36:20  15:36:20  kampes (B.M.Kampes)
# cohwinsize added.
# 
# Revision 1.40  2000/02/25  09:45:26  09:45:26  kampes (B.M.Kampes)
# check whence
# 
# Revision 1.39  2000/02/16  17:44:49  17:44:49  kampes (B.M.Kampes)
# new cards, refdem, check release 2.2
# 
# Revision 1.37  2000/02/09  11:22:35  11:22:35  kampes (B.M.Kampes)
# new cards
# 
# Revision 1.32  2000/01/06  09:55:04  09:55:04  kampes (B.M.Kampes)
# use exe in cwd
# 
# Revision 1.31  2000/01/06  09:25:06  09:25:06  kampes (B.M.Kampes)
# author added
# 
# Revision 1.29  99/12/20  14:35:45  14:35:45  kampes (B.M.Kampes)
# synopsis updated
# 
# Revision 1.28  99/12/16  13:53:03  13:53:03  kampes (B.M.Kampes)
# some new options -d for use with 1 script
# 
# Revision 1.27  99/12/13  16:50:42  16:50:42  kampes (B.M.Kampes)
# *** empty log message ***
# 
# Revision 1.26  99/12/09  16:06:48  16:06:48  kampes (B.M.Kampes)
# mountcds
# 
# Revision 1.25  99/12/09  15:11:44  15:11:44  kampes (B.M.Kampes)
# bugfixed
# 
# Revision 1.24  99/12/03  09:39:31  09:39:31  kampes (B.M.Kampes)
# new setup steps, reviewed ok version.
# 
# 
# Revision 1.16  99/11/02  11:34:53  11:34:53  kampes (B.M.Kampes)
# doris v1.2 s2h geocoding
# 
# Revision 1.1  99/09/13  15:57:22  15:57:22  kampes (B.M.Kampes)
# initial version
# 
#############