| 1 |
! @(#)prep_fix.prg 19.1 (ES0-DMD) 02/25/03 14:16:05 |
| 2 |
! @(#)prep_fix.prg 19.1 (ESO) 02/25/03 14:16:05 |
| 3 |
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| 4 |
!.COPYRIGHT (C) 1993 European Southern Observatory |
| 5 |
!.IDENT prep_fix.prg |
| 6 |
!.AUTHOR Rein H. Warmels, ESO-Garching |
| 7 |
!.KEYWORDS Direct imaging, CCD package, bad pixel correction |
| 8 |
!.PURPOSE Do the bad pixel correction of the input frame |
| 9 |
!.USE The input file is corrected for bad pixel. The bad pixel |
| 10 |
!. are contained in a bad fixel file, which obviously depend |
| 11 |
!. on tescope and instrument combination. All ESO bad pixel |
| 12 |
!. file are assumed to be in the working directory or in the |
| 13 |
!. the subdirectory stdred/ccd/incl. |
| 14 |
!.PARAMETERS P1: input frame |
| 15 |
! P2: correction label string which will be checked by |
| 16 |
! ccdcorrect.prg to do the desired actions. |
| 17 |
!.NOTE The procedure checks if the operation was already done |
| 18 |
!. by checking the descriptor CCDSTAT(6) |
| 19 |
!. CCDSTAT(1) for overscan correction |
| 20 |
!. CCDSTAT(2) for trimming the frame |
| 21 |
!. CCDSTAT(3) for the bad pixel correction |
| 22 |
!. CCDSTAT(4) for bias subtraction |
| 23 |
!. CCDSTAT(5) for dark current subtraction |
| 24 |
!. CCDSTAT(6) for flat fielding |
| 25 |
!. CCDSTAT(7) for bad pixel correction |
| 26 |
!. CCDSTAT(8) for fringing correction |
| 27 |
!.VERSION 930326 RHW Creation |
| 28 |
!.VERSION 971117 SW correction labels have to be local -> new param. |
| 29 |
!------------------------------------------------------- |
| 30 |
DEFINE/PARAM P1 ? I "Input frame for pixel correction [no default]:" |
| 31 |
DEFINE/PARAM P2 {CCDCORS(1:20)} |
| 32 |
!The correction label string CCDCORS which will be checked by CCDCORRECT.PRG |
| 33 |
!has to be local, in order to always get the right link to the actual frame. |
| 34 |
!In a global definition the correction labels may overwritten by other pre- |
| 35 |
!pared frames which leads to unwished actions to previous frames (SW,97.11.17). |
| 36 |
! |
| 37 |
! *** Check if pixel fixing has already been applied |
| 38 |
IF SC_FXPIX .NE. "yes" .OR. {{P1},CCDSTAT(3)} .EQ. 1 THEN |
| 39 |
WRITE/OUT "{P1}: Pixel correction not requested or was applied" |
| 40 |
RETURN {P2} |
| 41 |
ENDIF |
| 42 |
! |
| 43 |
! *** return if only listing is wanted |
| 44 |
IF SC_PROC .EQ. "yes" THEN |
| 45 |
WRITE/OUT "{P1}: *** TO BE DONE: Bad pixel table is {FX_TABLE}" |
| 46 |
RETURN {P2} |
| 47 |
ENDIF |
| 48 |
! |
| 49 |
! *** check for the existence of the bad pixel table |
| 50 |
IF M$EXIST("{FX_TABLE}") .EQ. 0 THEN ! look for bad pixel file |
| 51 |
WRITE/OUT "{P1} *** ERROR: Bad pixel table {FX_TABLE} not accessible" |
| 52 |
RETURN {P2} |
| 53 |
ENDIF |
| 54 |
! |
| 55 |
! *** write the descriptor status and user info |
| 56 |
WRITE/OUT "{P1}: Bad pixel correction; bad pixel table is {FX_TABLE}" |
| 57 |
P2(3:3) = "P" |
| 58 |
P2(11:11) = "Y" |
| 59 |
! |
| 60 |
RETURN {P2} |