| 1 |
! @(#)ccdcheck.prg 19.1 (ES0-DMD) 02/25/03 14:15:59 |
| 2 |
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| 3 |
!.COPYRIGHT (C) 1991 European Southern Observatory |
| 4 |
!.IDENT ccdcheck.prg |
| 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 |
| 9 |
!. p1 = input frame; |
| 10 |
!. p2 = exposure type |
| 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]: " |
| 25 |
! |
| 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 |
| 29 |
ENDIF |
| 30 |
! |
| 31 |
! *** Check if overscan correction has been dome |
| 32 |
IF SC_SCAN .EQ. "yes" .AND. {{P1},CCDSTAT(2)} .NE. 1 THEN |
| 33 |
RETURN 1 |
| 34 |
ENDIF |
| 35 |
! |
| 36 |
! *** Check if trimming has already been applied |
| 37 |
IF SC_TRIM .EQ. "yes" .AND. {{P1},CCDSTAT(1)} .NE. 1 THEN |
| 38 |
RETURN 1 |
| 39 |
ENDIF |
| 40 |
! |
| 41 |
! *** Check if bad pixel correction has been applied |
| 42 |
IF SC_FXPIX .EQ. "yes" .AND. {{P1},CCDSTAT(1)} .NE. 1 THEN |
| 43 |
RETURN 1 |
| 44 |
ENDIF |
| 45 |
! |
| 46 |
! *** branch depending on exposure type |
| 47 |
BRANCH P2(1:2) BS,DK,FF,SK,IL BIAS,DARK,FLAT,FLAT,ILLUM |
| 48 |
! |
| 49 |
! *** here for the default case |
| 50 |
DEFAULT: |
| 51 |
IF SC_BSCOR .EQ. "yes" .AND. {{P1},CCDSTAT(4)} .NE. 1 THEN ! bias |
| 52 |
RETURN 1 |
| 53 |
ENDIF |
| 54 |
IF SC_DKCOR .EQ. "yes" .AND. {{P1},CCDSTAT(5)} .NE. 1 THEN ! dark |
| 55 |
RETURN 1 |
| 56 |
ENDIF |
| 57 |
IF SC_FFCOR .EQ. "yes" .AND. {{P1},CCDSTAT(6)} .NE. 1 THEN ! flat |
| 58 |
RETURN 1 |
| 59 |
ENDIF |
| 60 |
IF SC_ILCOR .EQ. "yes" .AND. {{P1},CCDSTAT(7)} .NE. 1 THEN ! illum |
| 61 |
RETURN 1 |
| 62 |
ENDIF |
| 63 |
IF SC_FRCOR .EQ. "yes" .AND. {{P1},CCDSTAT(8)} .NE. 1 THEN ! fringe |
| 64 |
RETURN 1 |
| 65 |
ENDIF |
| 66 |
RETURN 0 |
| 67 |
! |
| 68 |
BIAS: |
| 69 |
RETURN 0 |
| 70 |
! |
| 71 |
! *** here for the dark |
| 72 |
DARK: |
| 73 |
IF SC_BSCOR .EQ. "yes" .AND. {{P1},CCDSTAT(4)} .NE. 1 THEN ! bias |
| 74 |
RETURN 1 |
| 75 |
ENDIF |
| 76 |
RETURN 0 |
| 77 |
! |
| 78 |
! *** here for the flat |
| 79 |
FLAT: |
| 80 |
IF SC_BSCOR .EQ. "yes" .AND. {{P1},CCDSTAT(4)} .NE. 1 THEN ! bias |
| 81 |
RETURN 1 |
| 82 |
ENDIF |
| 83 |
IF SC_DKCOR .EQ. "yes" .AND. {{P1},CCDSTAT(5)} .NE. 1 THEN ! dark |
| 84 |
RETURN 1 |
| 85 |
ENDIF |
| 86 |
IF M$EXISTD(P1,"CCDMEAN") .EQ. 0 THEN ! mean |
| 87 |
RETURN 1 |
| 88 |
ELSE |
| 89 |
CCDMEAN = {{P1},CCDMEAN} |
| 90 |
ENDIF |
| 91 |
RETURN 0 |
| 92 |
! |
| 93 |
! *** here for illumination |
| 94 |
ILLUM: |
| 95 |
IF SC_BSCOR .EQ. "yes" .AND. {{P1},CCDSTAT(4)} .NE. 1 THEN ! bias |
| 96 |
RETURN 1 |
| 97 |
ENDIF |
| 98 |
IF SC_DKCOR .EQ. "yes" .AND. {{P1},CCDSTAT(5)} .NE. 1 THEN ! dark |
| 99 |
RETURN 1 |
| 100 |
ENDIF |
| 101 |
IF SC_FFCOR .EQ. "yes" .AND. {{P1},CCDSTAT(6)} .NE. 1 THEN ! flat |
| 102 |
RETURN 1 |
| 103 |
ENDIF |
| 104 |
IF M$EXISTD(P1,"CCDMEAN") .EQ. 0 THEN ! mean |
| 105 |
RETURN 1 |
| 106 |
ELSE |
| 107 |
CCDMEAN = {{P1},CCDMEAN} |
| 108 |
ENDIF |
| 109 |
RETURN 0 |
| 110 |
|
| 111 |
|