Debian Codegraph @

stdred/ccdred/proc/mosaicmatch.prg

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