Debian Codegraph @

stdred/ccdred/proc/make_skyflat.prg

raw
1 ! @(#)make_skyflat.prg 19.1 (ESO-DMD) 02/25/03 14:16:04
2 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 !.COPYRIGHT (C) 1993 European Southern Observatory
4 !.IDENT make_skyflat.prg
5 !.AUTHOR Rein H. Warmels, ESO-Garching
6 !.KEYWORDS Direct imaging, CCD package
7 !.PURPOSE Make a sky flat field by multiplying the input illumination
8 ! frame with the flat field
9 !.VERSION 930730 RHW Creation
10 !.NOTE The procedure checks if the operation was already done
11 !. by checking the descriptor CCDSTAT(6)
12 !. Other CCDSTAT descriptor values
13 !. CCDSTAT(1) for overscan correction
14 !. CCDSTAT(2) for trimming the frame
15 !. CCDSTAT(3) for bad pixel correction
16 !. CCDSTAT(4) for bias subtraction
17 !. CCDSTAT(5) for dark current subtraction
18 !. CCDSTAT(6) for flat fielding
19 !. CCDSTAT(7) for illumination correction
20 !. CCDSTAT(8) for fringing correction
21 !-------------------------------------------------------
22 DEFINE/PARAM P1 ? IMA "Enter input flat field frame: "
23 DEFINE/PARAM P2 ? IMA "Enter sky illumination frame: "
24 DEFINE/PARAM P3 ? IMA "Enter sky flat output frame : "
25 !
26 DEFINE/LOCAL SCALE/R/1/1 1.0
27 !
28 ! First, check if already operation has already been done
29 IF M$EXISTD(P1,"SKYFLAT") .EQ. 1 THEN
30 RETURN
31 ENDIF
32 !
33 IF M$EXIST("{P2}.bdf"} .EQ. 0 THEN
34 WRITE/OUT "{P1}: *** ERROR: Illumination correction {P2} doesn't exist ..."
35 RETURN
36 ENDIF
37 !
38 IF M$EXISTD(P2,"CCDMEAN") .EQ. 1 THEN
39 SCALE = {{P2},CCDMEAN}
40 ELSE
41 @s ccdmean {P2}
42 IF M$EXISTD(P2,"CCDMEAN") .EQ. 1 THEN
43 SCALE = {{P2},CCDMEAN}
44 ELSE
45 SCALE = 1.0
46 ENDIF
47 ENDIF
48 !
49 IF SCALE .LE. 0 THEN
50 COMPUTE/IMAGE {P3} = {P1}*{P2}
51 ELSE
52 COMPUTE/IMAGE {P3} = {P1}*{P2}/{SCALE}
53 ENDIF
54 WRITE/DESCR {P3} CCDSTAT/I/7/1 1 ! correction done
55 WRITE/DESCR {P3} SKYFLAT/C/1/10 SKYFLAT ! sky flat descriptor
56 WRITE/DESCR {P3} {EXP_DESC}/C/1/20 {FF_TYP} ! flat exposure
57 IF VERBOSE(1:1) .EQ. "Y" THEN
58 STATISTIC/IMAGE {P3} {IM_SEC} ? ? FF ! full statistics
59 ELSE
60 STATISTIC/IMAGE {P3} {IM_SEC} ? ? FX ! short statistics
61 ENDIF
62 !
63 RETURN
64
65
66
67
68