Debian Codegraph @

stdred/ccdred/proc/mosaiccreate.prg

raw
1 ! @(#)mosaiccreate.prg 19.1 (ES0-DMD) 02/25/03 14:16:04
2 ! @(#)mosaiccreate.prg 19.1 (ESO-SDAG) 02/25/03 14:16:04
3 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 !.COPYRIGHT (C) 1995 European Southern Observatory
5 !.IDENT mosaiccreate.prg
6 !.PURPOSE Do mosaicing of a number of input frames
7 !.AUTHOR Rein H. Warmels, ESO-Garching
8 !.KEYWORDS Direct imaging, CCD package, mosacing
9 !.USE @@ mosaiccreate
10 !. with p1 = input catalogue with exposures
11 !. p2 = output combine frame
12 !.VERSION 920629 RHW Creation
13 !.VERSION 920716 RHW parameter p2
14 !.VERSION 930725 RHW chnage of syntax
15 !-------------------------------------------------------
16 DEFINE/PARAMETER P1 ? C "Enter input catalogue:"
17 DEFINE/PARAMETER P2 ? C "Enter combined output frame:"
18 DEFINE/PARAMETER P3 ? C "Enter operations table:"
19 DEFINE/PARAMETER P4 ? N "Enter number of subframes in x and y:"
20 DEFINE/PARAMETER P5 " " C "Enter list of unobserved rasters:"
21 DEFINE/PARAMETER P6 0,0 N "Enter size of the output frame:"
22 !
23 DEFINE/LOCAL CCDIN/C/1/60 " "
24 DEFINE/LOCAL CCDOUT/C/1/60 " "
25 DEFINE/LOCAL CCDTBL/C/1/60 " "
26 DEFINE/LOCAL IDOT/I/1/1 0
27 WRITE/KEYW INPUTI/I/1/2 {P4}
28 WRITE/KEYW INPUTI/I/3/2 {P6}
29 ! *** check the consistency of the input parameters
30 !
31 ! *** All done; now copy remaining keywords to local ones
32 IDOT = M$INDEX("{P1}",".cat")
33 IF IDOT .EQ. 0 THEN
34 CCDIN = "{P1}.cat" ! input catalog
35 ELSE
36 CCDIN = "{P1}" ! input catalog
37 ENDIF
38 IF M$EXIST("{CCDIN}") .EQ. 0 THEN
39 WRITE/OUT "*** FATAL <MOSAIC>: Catalogue {CCDIN} not existing"
40 RETURN/EXIT
41 ENDIF
42 !
43 IDOT = M$INDEX("{P2}",".bdf")
44 IF IDOT .GT. 0 THEN
45 CCDOUT = "{P2(1:{IDOT})}" ! reference frame
46 ELSE
47 CCDOUT = "{P2}" ! reference frame
48 ENDIF
49 !
50 IDOT = M$INDEX("{P3}",".tbl")
51 IF IDOT .GT. 0 THEN
52 CCDTBL = "{P3(1:{IDOT})}" ! reference frame
53 ELSE
54 CCDTBL = "{P3}" ! reference frame
55 ENDIF
56 !
57 WRITE/KEYW NSUB/I/1/2 {INPUTI(1)},{INPUTI(2)} ! # frames in x and y
58 WRITE/KEYW OSIZE/I/1/2 {INPUTI(3)},{INPUTI(4)} ! size of output frame
59 WRITE/KEYW NULL_IN/C/1/60 {P5} ! list of unobserved rasters
60 !
61 DEFINE/LOCAL SECTION/C/1/40 {MO_SEC} ! frame section for finding mode
62 DEFINE/LOCAL SUBTR/C/1/10 {MO_SUBT} ! subtract median sky
63 DEFINE/LOCAL CORNER/C/1/2 {MO_CORN} ! starting position in output
64 DEFINE/LOCAL DIRECT/C/1/2 {MO_DIREC} ! add subraster row/column wise
65 DEFINE/LOCAL RASTER/C/1/2 {MO_RAST} ! add in raster pattern
66 DEFINE/LOCAL NOVER/I/1/2 {MO_OVER(1)},{MO_OVER(2)} ! #c/r betw. adj. frs
67 DEFINE/LOCAL BLANK/C/1/20 {MO_NUL} ! null value
68 !
69 RUN STD_EXE:CCDMOSAIC
70 !
71 ! *** check on existence of the output frame
72 IF M$EXIST("{CCDOUT}.bdf") .EQ. 0 THEN ! is it there?
73 WRITE/OUT "*** ERROR: Failed to make the mosaic output frame"
74 RETURN
75 ENDIF
76 !
77 ! *** write the descriptors
78 WRITE/DES {CCDOUT} LHCUTS/R/1/1 {OUTPUTR(1)},{OUTPUTR(2)}
79 WRITE/DES {CCDOUT} MEAN/R/1/1 {OUTPUTR(3)}
80 WRITE/DES {CCDOUT} MODE/R/1/1 {OUTPUTR(7)}
81 WRITE/DES {CCDOUT} MEDIAN/R/1/1 {OUTPUTR(8)}
82 !
83 RETURN
84
85
86
87
88
89
90
91