Debian Codegraph @

stdred/ccdred/proc/mosaicalign.prg

raw
1 ! @(#)mosaicalign.prg 19.1 (ES0-DMD) 02/25/03 14:16:04
2 ! @(#)mosaicalign.prg 19.1 (ESO-SDAG) 02/25/03 14:16:04
3 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 !.COPYRIGHT (C) 1995 European Southern Observatory
5 !.IDENT mosaicalign.prg
6 !.PURPOSE Do alignment of mosaic of subframes
7 !.AUTHOR Rein H. Warmels, ESO-Garching
8 !.KEYWORDS Direct imaging, CCD package, mosacing
9 !.USE @@ mosaicalign
10 !. with P1 input mosaic frame
11 !. P2 database table"
12 !. P3 combined output frame"
13 !. P4 column and row of reference subframe"
14 !. P5 x and y offset of reference subframe"
15 !. P6 size of the output frame"
16 !.VERSION 950608 RHW Creation
17 !-------------------------------------------------------
18 DEFINE/PARAMETER P1 ? C "Enter input mosaic frame:"
19 DEFINE/PARAMETER P2 ? C "Enter database table:"
20 DEFINE/PARAMETER P3 ? C "Enter combined output frame:"
21 DEFINE/PARAMETER P4 ? C "Enter alignment method and data:"
22 DEFINE/PARAMETER P5 0,0 N "Enter column and row of reference subframe:"
23 DEFINE/PARAMETER P6 0,0 N "Enter x and y offset of reference subframe:"
24 DEFINE/PARAMETER P7 0,0 N "Enter size of the output frame:"
25 !
26 DEFINE/LOCAL CCDIN/C/1/60 " "
27 DEFINE/LOCAL CCDOUT/C/1/60 " "
28 DEFINE/LOCAL TBLDB/C/1/60 " "
29 DEFINE/LOCAL ICOMMA/I/1/1 0
30 DEFINE/LOCAL ALIGN/C/1/60 " "
31 DEFINE/LOCAL TBLCO/C/1/60 " "
32 DEFINE/LOCAL SHIFT/R/1/2 0,0
33 DEFINE/LOCAL IDOT/I/1/1 0
34 !
35 ! *** All done; now copy remaining keywords to local ones
36 IDOT = M$INDEX("{P1}",".bdf") ! get input frame
37 IF IDOT .GT. 0 THEN
38 CCDIN = "{P1(1:{IDOT})}"
39 ELSE
40 CCDIN = "{P1}"
41 ENDIF
42 IF M$EXIST("{CCDIN}.bdf") .EQ. 0 THEN
43 WRITE/OUT "*** FATAL <ALIGN>: Input frame {CCDIN} not existing"
44 RETURN/EXIT
45 ENDIF
46 !
47 IDOT = M$INDEX("{P2}",".tbl") ! get database table
48 IF IDOT .GT. 0 THEN
49 TBLDB = "{P2(1:{IDOT})}"
50 ELSE
51 TBLDB = "{P2}"
52 ENDIF
53 !
54 CCDOUT = "{P3}"
55 !
56 ! *** get method and data
57 ICOMMA = M$INDEX("{P4}",",") -1
58 ALIGN = "{P4(1:{ICOMMA})}"
59 ICOMMA = ICOMMA + 2
60 IF ALIGN(1:1) .EQ. "S" THEN ! here for fixed shift
61 WRITE/KEY SHIFT/R/1/2 {P4({ICOMMA}:>)}
62 ELSEIF ALIGN(1:1) .EQ. "C" THEN
63 TBLCO = "{P4({ICOMMA}:>)}" ! here for coordinates
64 ELSEIF ALIGN(1:1) .EQ. "R" THEN
65 TBLCO = "{P4({ICOMMA}:>)}" ! here for reference shift
66 ELSE
67 WRITE/OUT "*** FATAL <ALIGN>: None existing alignment method"
68 RETURN/EXIT
69 ENDIF
70 !
71 ! *** write keywords
72 DEFINE/LOCAL NRSUB/I/1/2 {P5}
73 DEFINE/LOCAL XYREF/I/1/2 {P6}
74 DEFINE/LOCAL OSIZE/I/1/2 {P7}
75 DEFINE/LOCAL TR_SEC/I/1/4 {MO_TRIM(1)},{MO_TRIM(2)},{MO_TRIM(3)},{MO_TRIM(4)}
76 DEFINE/LOCAL BLANK/C/1/20 {MO_NUL} ! null value
77 DEFINE/LOCAL INTERPOL/C/1/20 {MO_INTER}
78 !
79 RUN STD_EXE:CCDALIGN
80 !
81 ! *** check on existence of the output frame
82 IF M$EXIST("{CCDOUT}.bdf") .EQ. 0 THEN ! is it there?
83 WRITE/OUT "*** ERROR: Failed to make the aligned output frame"
84 RETURN
85 ENDIF
86 !
87 ! *** write the descriptors
88 WRITE/DES {CCDOUT} LHCUTS/R/1/1 {OUTPUTR(1)},{OUTPUTR(2)}
89 WRITE/DES {CCDOUT} MEAN/R/1/1 {OUTPUTR(3)}
90 WRITE/DES {CCDOUT} MODE/R/1/1 {OUTPUTR(7)}
91 WRITE/DES {CCDOUT} MEDIAN/R/1/1 {OUTPUTR(8)}
92 !
93 RETURN
94
95
96
97
98
99
100
101