| 1 |
! @(#)ccdbias.prg 19.1 (ESO-DMD) 02/25/03 14:15:58 |
| 2 |
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| 3 |
!.COPYRIGHT (C) 1993 European Southern Observatory |
| 4 |
!.IDENT ccdbias.prg |
| 5 |
!.AUTHOR Rein H. Warmels, ESO-Garching |
| 6 |
!.KEYWORDS Direct imaging, CCD package |
| 7 |
!.PURPOSE Do the correction of bias frame |
| 8 |
!.USE @s ccdbscor P1 P2 P3 |
| 9 |
!. P1 = input frame |
| 10 |
!. P2 = output frame |
| 11 |
!. P3 = bias frame |
| 12 |
!.NOTE The procedure checks if the operation was already done |
| 13 |
!. by checking the descriptor CCDSTAT(4) |
| 14 |
!. Other CCDSTAT descriptor values |
| 15 |
!. CCDSTAT(1) for overscan correction |
| 16 |
!. CCDSTAT(2) for trimming the frame |
| 17 |
!. CCDSTAT(3) for bad pixel correction |
| 18 |
!. CCDSTAT(4) for bias subtraction |
| 19 |
!. CCDSTAT(5) for dark current subtraction |
| 20 |
!. CCDSTAT(6) for flat fielding |
| 21 |
!. CCDSTAT(7) for illumination correction |
| 22 |
!. CCDSTAT(8) for fringing correction |
| 23 |
!.VERSION 930503 RHW Creation |
| 24 |
!------------------------------------------------------- |
| 25 |
DEFINE/PARAM P1 ? I "Enter input frame:" |
| 26 |
DEFINE/PARAM P2 ? I "Enter output frame:" |
| 27 |
DEFINE/PARAM P3 {SC_BSFRM} I "Enter the bias frame:" |
| 28 |
! |
| 29 |
! *** check if bias hasn't already been subtracted or if present |
| 30 |
IF M$EXISTD(P1,"CCDSTAT") .EQ. 0 THEN |
| 31 |
WRITE/OUT "{P1}: *** WARNING: No check on CCD reduction status possible" |
| 32 |
WRITE/DESCR {P1} CCDSTAT/I/1/10 0 ALL |
| 33 |
ELSE |
| 34 |
IF {{P1},CCDSTAT(4)} .EQ. 1 THEN ! bias |
| 35 |
WRITE/OUT "{P1}: *** WARNING: Bias already subtracted; nothing done ..." |
| 36 |
RETURN |
| 37 |
ENDIF |
| 38 |
ENDIF |
| 39 |
! |
| 40 |
! *** check the frame and exposure descriptors; return on errors |
| 41 |
IF M$EXIST("{P3}.bdf"} .EQ. 0 THEN |
| 42 |
WRITE/OUT "{P1}: *** ERROR: Bias frame {P3}.bdf doesn't exist ..." |
| 43 |
RETURN |
| 44 |
ENDIF |
| 45 |
IF BS_TYP .NE. "*" .AND. BS_TYP .NE. "?" THEN |
| 46 |
IF M$EXISTD(P3,EXP_DESC) .EQ. 1 .AND. - |
| 47 |
"{{P3},{EXP_DESC}}" .NE. "{BS_TYP}" THEN |
| 48 |
WRITE/OUT - |
| 49 |
"{P3}: *** ERROR: Exposure descriptor {EXP_DESC} has wrong type" |
| 50 |
RETURN |
| 51 |
ENDIF |
| 52 |
ENDIF |
| 53 |
! |
| 54 |
! *** do the work |
| 55 |
COMPUTE/IMAGE {P2} = {P1} - {P3} |
| 56 |
WRITE/DESCR {P2} CCDSTAT/I/4/1 1 ! bias correction done |
| 57 |
WRITE/DESCR {P2} HISTORY/C/-1/80 "BIAS/CCD {P1} {P2} {P3} |
| 58 |
IF VERBOSE(1:1) .EQ. "Y" THEN |
| 59 |
STATISTIC/IMAGE {P2} {IM_SEC} ? ? FF ! full statistics |
| 60 |
ELSE |
| 61 |
STATISTIC/IMAGE {P2} {IM_SEC} ? ? FX ! short statistics |
| 62 |
ENDIF |
| 63 |
! |
| 64 |
RETURN |
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|