1
! @(#)ccdtestb5.prg 19.1 (ESO-DMD) 02/25/03 14:17:11
2
! +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3
!.IDENTIFICATION: ccdtestb5.prg
4
!.PURPOSE: Procedure to find the means and standard deviations
5
!.AUTHOR: Rein H. Warmels
7
!. where p1 = input catalogue containing the ccd bias frames
8
!. p2 = output identifier [bias]
10
!. p4 = radius of smoothing box for median filtering,
11
!. decimation factor for image size reduction
12
!.USE: @s ccdtestb5 p1 p2 p3 p4
13
!.Algorithm: Determination of the bias level and standard deviation. For
14
!. each input frame in the catalogue determine the mean bias
15
!. and standard deviation after hot pixel correction, box
16
!. averaging and median filtering. The overall mean bias level
17
!. and mean sigma is computed."
18
!.VERSION: 940620 RHW creation
19
!.VERSION: 950115 RHW Inclusion of the subtest
20
!.VERSION: 950808 RHW Split into single procedures
21
! +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
23
define/parameter p1 ? C "Enter input catalogue:"
24
define/parameter p2 BIAS C "Enter output identifier:"
25
define/parameter p3 [<,<:>,>] C "Enter area:"
26
define/parameter p4 5,10 N "Radius med. filtering, and dec. factor:"
28
write/keyw inputi/i/1/2 {P4}
29
write/keyw radius/i/1/1 {inputi(1)}
30
define/local nbox/i/1/1 {inputi(2)}
31
define/local mean/r/1/1 0.0
32
define/local msum/r/1/1 0.0
33
define/local sigm/r/1/1 0.0
34
define/local ssum/r/1/1 0.0
35
define/local frame/c/1/60 " "
36
define/local myouta/c/1/60 " "
37
write/keyw catal/i/1/1 0
38
write/keyw rebin/c/1/3 "mea"
39
define/local ifrm/i/1/1 0
41
! *** check if the catalogue exists
42
IF M$EXIST(P1) .EQ. 0 THEN
43
WRITE/OUT "*** FATAL <CCDTESTB5>: Catalogue {P2} not existing"
47
write/out "Test B5: Determination of the bias level and standard deviation"
48
write/out "------------------------------------------------------------------"
49
write/out " For each input frame in the catalogue determine the mean"
50
write/out " BIAS and standard deviation AFTER hot pixel correction,"
51
write/out " Box averaging and median filtering."
52
write/out " Finally, the overall mean bias level and sigma are computed."
54
create/table {p2}_mean 3 10 null
55
create/colum {p2}_mean :NAME " " A20 C*20
56
create/colum {p2}_mean :MEAN "ADU" F9.4 R*4
57
create/colum {p2}_mean :SIGMA "ADU" F9.4 R*4
59
store/frame in_a {p1} 1 FINISH
63
if M$EXIST("{p2}_hotpix.tbl") .EQ. 1 THEN
64
modify/colu {frame},{p2}_hotpix middummb V ! modify the hot pixels
66
copy/ii {frame} middummb
68
set/midas output=logonly
70
extract/imag middumma = middummb{p3}
76
filter/median {myouta} &a {RADIUS},{RADIUS},0.0
77
filter/median {OUT_B} &b {RADIUS},{RADIUS},0.0
78
statist/imag &a ? ? ? NN
80
statist/imag &b ? ? ? NN
82
{p2}_mean,:NAME,@{ifrm} = "{frame}"
83
{p2}_mean,:MEAN,@{ifrm} = {mean}
84
{p2}_mean,:SIGMA,@{ifrm} = {sigm}
86
write/out " Statistics of {frame}: mean = {mean}; sigma = {sigm}"
95
{p2}_mean,:NAME,@{ifrm} = "all_average"
96
{p2}_mean,:MEAN,@{ifrm} = {biasmean}
97
{p2}_mean,:SIGMA,@{ifrm} = {biassigm}
98
delete/imag {myouta} no
99
delete/imag {OUT_B} no
103
" Statistics all bias frames: mean = {biasmean}; sigma = {biassigm}"
105
write/out " The MIDAS table with results is in file {p2}_mean.tbl"
108
delete/imag bs_sigm.bdf NO
109
delete/imag bs_mean.bdf NO
110
delete/imag postscript.ps NO
111
delete/imag screen*.ps NO
112
delete/imag screen*.ima NO
113
delete/imag graph*.plt NO