~ubuntu-branches/debian/jessie/eso-midas/jessie

« back to all changes in this revision

Viewing changes to stdred/ccdtest/proc/ccdtestt3.prg

  • Committer: Package Import Robot
  • Author(s): Ole Streicher
  • Date: 2014-04-22 14:44:58 UTC
  • Revision ID: package-import@ubuntu.com-20140422144458-okiwi1assxkkiz39
Tags: upstream-13.09pl1.2+dfsg
ImportĀ upstreamĀ versionĀ 13.09pl1.2+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
! @(#)ccdtestt3.prg     19.1 (ES0-DMD) 02/25/03 14:17:13
 
2
! +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
3
!.IDENTIFICATION: ccdtestt3.prg
 
4
!.PURPOSE:        Procedure to the test ccd linearity and transfer
 
5
!.AUTHOR:         Rein H. Warmels
 
6
!.USE:            @s ccdtestt3 p1 p2 p3 p4 p5
 
7
!.                where p1 = test to be execcted
 
8
!.                      p2 = input catalogue containing the ccd bias frames
 
9
!.                      p3 = output identifier [TRANS]
 
10
!.                      p4 = image section to be used for the median and
 
11
!.                           variance determination
 
12
!.                      p5 = time interval to fit the shutter offset
 
13
!.                      p6 = selection criteria table 
 
14
!.USE:            @@ ccdtestt p1 p2 p3 p4
 
15
!.Algorithm:      The following tests are done:
 
16
!.                Test T1: Creation of the transfer and linearity table"
 
17
!.                Test T2: Determination of linearity curve and shutter error
 
18
!.                Test T3: Determination of the transfer curve
 
19
!.VERSION:        940524 RHW creation
 
20
! +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
21
DEFINE/PARAMETER P1  ?             T  "Enter input table:"
 
22
DEFINE/PARAMETER P2  TRANS         C  "Enter output identifier:"
 
23
DEFINE/PARAMETER P3  all           C  "Selection criterium for table:"
 
24
 
25
define/local xlab/r/1/1 0.0
 
26
define/local ylab/r/1/1 0.0
 
27
define/local aducf1/r/1/1 0.0
 
28
define/local aducf2/r/1/1 0.0
 
29
define/local enoise1/r/1/1 0.0
 
30
define/local enoise2/r/1/1 0.0
 
31
!
 
32
! *** check if the catalogue exists
 
33
IF M$EXIST("{P1}.tbl") .EQ. 0 THEN
 
34
   WRITE/OUT "*** FATAL <CCDTESTT3>: Table {P1} not existing"
 
35
   RETURN
 
36
ELSE
 
37
   read/table {p1}
 
38
ENDIF
 
39
!
 
40
crea/graph; set/graph 
 
41
set/graph pmode=1
 
42
!
 
43
define/local col1/c/1/20  :UT_tim1 
 
44
define/local col2/c/1/20  :UT_tim2 
 
45
define/local col3/c/1/20  :Exp_tim1 
 
46
define/local col4/c/1/20  :Exp_tim2
 
47
define/local col5/c/1/20  :Med_cnt1
 
48
define/local col6/c/1/20  :Med_cnt2
 
49
define/local col7/c/1/20  :Variance
 
50
define/local col8/c/1/20  :Frc_cnt1
 
51
define/local col9/c/1/20  :Frc_cnt2
 
52
define/local col10/c/1/20 :scratch
 
53
!
 
54
write/out "Test T3: Determination of the transfer curve"
 
55
write/out "----------------------------------------------------------------"
 
56
write/out "     From the selected entries the table a linear regression"
 
57
write/out "     analysis is done to determine the readout noise. The readout"
 
58
write/out "     noise is determined by the inverse of the slope between"
 
59
write/out "     the median and the variance" multiplied by the sigma of the"
 
60
write/out "     bias (determined by TESTB/CCD and stored in keyword BIASSIGM."
 
61
write/out " "
 
62
!
 
63
set/graph stype=5
 
64
set/midas output=logonly
 
65
select/table {p1} {p3}
 
66
set/graph xformat=e6.0 yformat=e6.2
 
67
plot/table {p1} {col5} {col7}  -80,-40,40,75
 
68
xlab = plrgrap(1) + (plrgrap(2)-plrgrap(1))/10
 
69
ylab = plrgrap(6) - (plrgrap(6)-plrgrap(5))/10
 
70
label/gra "Transfer curve (1), edited" {xlab},{ylab} ? ? 1
 
71
set/graph clear=off
 
72
regression/linear {p1} {col7} {col5}
 
73
save/regress {p1} regress
 
74
compute/regress {p1} {col10} = regress
 
75
ADUCF1  = 1/OUTPUTD(2) 
 
76
ENOISE1 = aducf1*BIASSIGM
 
77
set/midas output=yes
 
78
write/out "     Transfer curve 1 : slope: {outputd(2)}, offset in y: {outputd(1)}"
 
79
write/out "     Conv. factor: {aducf1} e-/ADU; Elec. RON: {enoise1} e-/pixel"
 
80
set/graph stype=0
 
81
overplot/table {p1} {col5} {col10}
 
82
!
 
83
set/midas output=logonly
 
84
select/table {p1} {p3}
 
85
set/graph stype=5
 
86
plot/table {p1} {col6} {col7} -80,-40,40,15
 
87
xlab = plrgrap(1) + (plrgrap(2)-plrgrap(1))/10
 
88
ylab = plrgrap(6) - (plrgrap(6)-plrgrap(5))/10
 
89
label/graph "Transfer curve (2), edited" {xlab},{ylab} ? ? 1
 
90
regression/linear {p1} {col7} {col6}
 
91
save/regress {p1} regress
 
92
compute/regress {p1} {col10} = regress
 
93
aducf2 = 1/OUTPUTD(2) 
 
94
enoise2 = aducf2*BIASSIGM
 
95
set/midas output=yes
 
96
write/out "     Transfer curve 2 : slope: {outputd(2)}, offset in y: {outputd(1)}"
 
97
write/out "     Conv. factor: {aducf2} e-/ADU; Elec. RON: {enoise2} e-/pixel"
 
98
ADUCF  = (aducf1 + aducf2) / 2
 
99
ENOISE = (enoise1 + enoise2) / 2
 
100
write/out " "
 
101
write/out "     Mean conv. factor: {ADUCF} e-/ADU"
 
102
WRITE/OUT "     Mean Elec. RON:   {ENOISE} e-/pixel"
 
103
write/out "     Values are store in the CCD keywords ADUCF and ENOISE"
 
104
set/graph stype=0
 
105
overplot/table {p1} {col6} {col10}
 
106
copy/graph postscript 
 
107
-copy postscript.ps {p2}_trans.ps
 
108
write/out " "
 
109
write/out "     Plot with fitted transfer curves in file {p2}_trans.ps"
 
110
write/out " "
 
111
!
 
112
set/grap clear=on
 
113
delete/imag postscript*.ps NO
 
114
delete/imag graph*.plt NO
 
115
RETURN
 
116
 
 
117
 
 
118
 
 
119
 
 
120
 
 
121
 
 
122
 
 
123