Debian Codegraph @

stdred/ccdred/proc/ccdtrim.prg

raw
1 ! @(#)ccdtrim.prg 19.1 (ESO-DMD) 02/25/03 14:16:03
2 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 !.COPYRIGHT (C) 1992 European Southern Observatory
4 !.IDENT ccdtrim.prg
5 !.AUTHOR Rein H. Warmels, ESO-Garching
6 !.KEYWORDS Direct imaging, CCD package
7 !.PURPOSE Trimmed image from overscan area.
8 !.USE @s ccdtrim p1 p2 p3 p4
9 !. p1 = input frame;
10 !. p2 = output frame;
11 !. p3 = useful data area;
12 !. p4 = delete flag.
13 !.METHOD A subimage of the desired size is extracted by EXTRACT/IMAGE
14 !. command. All coordinates are in (integer pixels)
15 !.NOTE The procedure checks if the operation was already done
16 !. CCDSTAT(1) for overscan correction
17 !. CCDSTAT(2) for trimming the frame
18 !. CCDSTAT(3) for bad pixel correction
19 !. CCDSTAT(4) for bias subtraction
20 !. CCDSTAT(5) for dark current subtraction
21 !. CCDSTAT(6) for flat fielding
22 !. CCDSTAT(7) for illumination correction
23 !. CCDSTAT(8) for fringing correction
24 !.VERSION 921005 RHW Creation
25 !-------------------------------------------------------
26 DEFINE/PARAM P1 ? I "Enter input frame:"
27 DEFINE/PARAM P2 ? I "Enter output frame:"
28 DEFINE/PARAM P3 {IM_SEC} C "Enter frame area to be extracted:"
29 DEFINE/PARAM P4 NO C "Delete input frame after extraction:"
30 !
31 ! *** check if frame was trimmed
32 IF M$EXISTD(P1,"CCDSTAT") .EQ. 0 THEN
33 WRITE/OUT "{P1}: *** WARNING: No check on CCD reduction status possible"
34 WRITE/DESCR {P1} CCDSTAT/I/1/10 0 ALL
35 ELSE
36 IF {{P1},CCDSTAT(2)} .EQ. 1 THEN
37 WRITE/OUT "{P1}: *** WARNING: Frame was trimmed; nothing done ..."
38 RETURN
39 ENDIF
40 ENDIF
41 !
42 ! *** do the extraction administration
43 EXTRACT/IMAGE {P2} = {P1}{P3}
44 WRITE/DESCR {P2} HISTORY/C/-1/80 "TRIM/CCD {P1} {P2} {P3} {P4}
45 WRITE/DESCR {P2} CCDSTAT/I/2/1 1 ! image trimming done
46 IF VERBOSE(1:1) .EQ. "Y" THEN
47 STATISTIC/IMAGE {P2} [<,<:>,>] ? ? FF ! full statistics
48 ELSE
49 STATISTIC/IMAGE {P2} [<,<:>,>] ? ? FX ! short statistics
50 ENDIF
51 !
52 ! *** delete frame if requested
53 IF P4(1:1) .EQ. "Y" THEN
54 DELETE/IMAG {P1} NOCONF
55 ENDIF
56 !
57 RETURN
58