1
! @(#)ccdcheck.prg 19.1 (ES0-DMD) 02/25/03 14:15:59
2
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++
3
!.COPYRIGHT (C) 1991 European Southern Observatory
5
!.AUTHOR Rein H. Warmels, ESO-Garching
6
!.KEYWORDS Direct imaging, CCD package
7
!.PURPOSE Check the processing status of an image
8
!.USE @s ccdcheck p1 p2
11
!.METHOD - Check for the CCD keyword setting and the image descriptor
12
!.VERSION 930416 RHW Creation
13
!.NOTE The procedure checks if the operation was already done
14
!. CCDSTAT(1) for overscan correction
15
!. CCDSTAT(2) for trimming the frame
16
!. CCDSTAT(3) for the bad pixel correction
17
!. CCDSTAT(4) for bias subtraction
18
!. CCDSTAT(5) for dark current subtraction
19
!. CCDSTAT(6) for flat fielding
20
!. CCDSTAT(7) for bad pixel correction
21
!. CCDSTAT(8) for fringing correction
22
!-------------------------------------------------------
23
DEFINE/PARAM P1 ? I "Enter input frame [no default]:"
24
DEFINE/PARAM P2 ? C "Enter the exposure type [no default]: "
26
! *** see if there is any status descriptor; if not create one
27
IF M$EXISTD(P1,"CCDSTAT") .EQ. 0 THEN
28
WRITE/DESCR {P1} CCDSTAT/I/1/10 0 ALL
31
! *** Check if overscan correction has been dome
32
IF SC_SCAN .EQ. "yes" .AND. {{P1},CCDSTAT(2)} .NE. 1 THEN
36
! *** Check if trimming has already been applied
37
IF SC_TRIM .EQ. "yes" .AND. {{P1},CCDSTAT(1)} .NE. 1 THEN
41
! *** Check if bad pixel correction has been applied
42
IF SC_FXPIX .EQ. "yes" .AND. {{P1},CCDSTAT(1)} .NE. 1 THEN
46
! *** branch depending on exposure type
47
BRANCH P2(1:2) BS,DK,FF,SK,IL BIAS,DARK,FLAT,FLAT,ILLUM
49
! *** here for the default case
51
IF SC_BSCOR .EQ. "yes" .AND. {{P1},CCDSTAT(4)} .NE. 1 THEN ! bias
54
IF SC_DKCOR .EQ. "yes" .AND. {{P1},CCDSTAT(5)} .NE. 1 THEN ! dark
57
IF SC_FFCOR .EQ. "yes" .AND. {{P1},CCDSTAT(6)} .NE. 1 THEN ! flat
60
IF SC_ILCOR .EQ. "yes" .AND. {{P1},CCDSTAT(7)} .NE. 1 THEN ! illum
63
IF SC_FRCOR .EQ. "yes" .AND. {{P1},CCDSTAT(8)} .NE. 1 THEN ! fringe
71
! *** here for the dark
73
IF SC_BSCOR .EQ. "yes" .AND. {{P1},CCDSTAT(4)} .NE. 1 THEN ! bias
78
! *** here for the flat
80
IF SC_BSCOR .EQ. "yes" .AND. {{P1},CCDSTAT(4)} .NE. 1 THEN ! bias
83
IF SC_DKCOR .EQ. "yes" .AND. {{P1},CCDSTAT(5)} .NE. 1 THEN ! dark
86
IF M$EXISTD(P1,"CCDMEAN") .EQ. 0 THEN ! mean
89
CCDMEAN = {{P1},CCDMEAN}
93
! *** here for illumination
95
IF SC_BSCOR .EQ. "yes" .AND. {{P1},CCDSTAT(4)} .NE. 1 THEN ! bias
98
IF SC_DKCOR .EQ. "yes" .AND. {{P1},CCDSTAT(5)} .NE. 1 THEN ! dark
101
IF SC_FFCOR .EQ. "yes" .AND. {{P1},CCDSTAT(6)} .NE. 1 THEN ! flat
104
IF M$EXISTD(P1,"CCDMEAN") .EQ. 0 THEN ! mean
107
CCDMEAN = {{P1},CCDMEAN}