Status: offline
Registered: 07/10/2007
Posts: 42
|
Mike-I have written a script that utilizes [i:36cd83ebb1]Findgain[/i:36cd83ebb1] to calculate an average gain and rdnoise for a night. I have been utilizing 5 sections of each bias and flat and have begun having some problems. On some nights my script works fine. On others, however, it inexplicably has the following error: [i:36cd83ebb1]Can't compute gain and readout noise[/i:36cd83ebb1]. As you can see the error code does not give me much to go on in terms of debugging. Interestingly the error seems to change where it occurs in the script when applying the script to different nights. So far I have tried the following:1. I thought I might be using sections too close to the edges (I don't know what difference this would make but suddenly it began working for one particular night) but the problem has remained for other nights.2. I tried tinkering with the parameters of findgain but to no effect.What is going on?Thanks,
PaulP.S. I have included a portion of the script below
[size=9:36cd83ebb1][color=red:36cd83ebb1]#ap_gain_rdnoise_collector_v_1.cl by Paul Iverson#variable declarations
int f1
int f2
int b1
int b2
int xlen
int ylen
int x1, x2, x3, x4, x5, x6
int y1, y2, y3, y4, y5, y6
int numflatU
int numflatB
int numflatV
int numflatR
int numflatI
int numflatN
int numflatW
int numbias
string flat1
string flat2
string bias1
string bias2hselect("*.fit", "$I,FILTER", yes, >>"datalist1")
sections @datalist1
if (sections.nimages == 0){
hselect ("*.FIT", "$I,FILTER", yes, >>"datalist1")
}
;match ("FLAT","datalist1",>>"datalistflat")
sections @datalistflat
if (sections.nimages == 0){
match ("flat","datalist1",>>"datalistflat")
}
;
match ("U$","datalistflat",>>"datalistflatU")
match ("B$","datalistflat",>>"datalistflatB")
match ("V$","datalistflat",>>"datalistflatV")
match ("R$","datalistflat",>>"datalistflatR")
match ("I$","datalistflat",>>"datalistflatI")
match ("N$","datalistflat",>>"datalistflatN")
match ("W$","datalistflat",>>"datalistflatW")match ("BIAS","datalist1",>>"datalistbias")
sections @datalistbias
if (sections.nimages == 0){
match ("zero","datalist1",>>"datalistbias")
}
;clearsections @datalistflatU
numflatU = sections.nimagessections @datalistflatB
numflatB = sections.nimagessections @datalistflatV
numflatV = sections.nimagessections @datalistflatR
numflatR = sections.nimagessections @datalistflatI
numflatI = sections.nimagessections @datalistflatN
numflatN = sections.nimagessections @datalistflatW
numflatW = sections.nimagessections @datalistbias
numbias = sections.nimagesif (numflatU > 0) {
for (f1=1;f1<=numflatU-1;f1+=1){
for (f2=f1+1;f2<numflatU;f2+=1){
for (b1=1;b1<=numbias-1;b1+=1){
for (b2=b1+1;b2<numbias;b2+=1){
tabpar ("datalistflatU",1,f1)
flat1 = tabpar.value imgets.param.p_mode = "h" imgets (flat1, param="i_naxis1")
xlen = int(imgets.value)
imgets (flat1, param="i_naxis2")
ylen = int(imgets.value) x1 = 50
x2 = 150
x3 = xlen - 150
x4 = xlen - 50
if ((xlen % 2) == 0){
x5 = (xlen/2)-50
x6 = (xlen/2)+50
}
;
if ((xlen % 2) == 1){
x5 = ((xlen - 1)/2)-50
x6 = ((xlen - 1)/2)+50
}
;
y1 = 50
y2 = 150
y3 = ylen - 150
y4 = ylen - 50
if ((ylen % 2) == 0){
y5 = (ylen/2)-50
y6 = (ylen/2)+50
}
;
if ((ylen % 2) == 1){
y5 = ((ylen - 1)/2)-50
y6 = ((ylen - 1)/2)+50
}
;
tabpar ("datalistflatU",1,f2)
flat2 = tabpar.value
tabpar ("datalistbias",1,b1)
bias1 = tabpar.value
tabpar ("datalistbias",1,b2)
bias2 = tabpar.value
findgain.section = "["//x1//":"//x2//","//y1//":"//y2//"]"
findgain (flat1,flat2,bias1,bias2,>>"gainrdnoiseU.info")
findgain.section = "["//x1//":"//x2//","//y3//":"//y4//"]"
findgain (flat1,flat2,bias1,bias2,>>"gainrdnoiseU.info")
findgain.section = "["//x3//":"//x4//","//y1//":"//y2//"]"
findgain (flat1,flat2,bias1,bias2,>>"gainrdnoiseU.info")
findgain.section = "["//x3//":"//x4//","//y3//":"//y4//"]"
findgain (flat1,flat2,bias1,bias2,>>"gainrdnoiseU.info")
findgain.section = "["//x5//":"//x6//","//y5//":"//y6//"]"
findgain (flat1,flat2,bias1,bias2,>>"gainrdnoiseU.info")
}
}
}
}
}
;[/color:36cd83ebb1][/size:36cd83ebb1]
|
Status: offline
Registered: 11/11/2005
Posts: 728
|
Hello Paul,You should look at the output from findgain in gainrdnoiseU.info. Findgain is a fairly simple task so you could take a look at it at obsutil$src/findgain.cl. From the code[code:1:35a35d578a]
err = NO
if (fscan (fd, m_f1, junk) != 2) {
printf ("WARNING: Failed to compute statisics for %s\n", lf1)
err = YES
}
if (fscan (fd, m_f2, junk) != 2) {
printf ("WARNING: Failed to compute statisics for %s\n", lf2)
err = YES
}
if (fscan (fd, m_b1, junk) != 2) {
printf ("WARNING: Failed to compute statisics for %s\n", lz1)
err = YES
}
if (fscan (fd, m_b2, junk) != 2) {
printf ("WARNING: Failed to compute statisics for %s\n", lz1)
err = YES
}
if (fscan (fd, junk, s_fd) != 2) {
printf ("WARNING: Failed to compute statisics for %s - %s\n",
lf1, lf2)
err = YES
}
if (fscan (fd, junk, s_bd) != 2) {
printf ("WARNING: Failed to compute statisics for %s - %s\n",
lz1, lz2)
err = YES
}
fd = ""; delete (statsfile, verify-) if (err == YES)
error (1, "Can't compute gain and readout noise")
[/code:1:35a35d578a]So you see the error message has something to do with computing statistics and there should be a message with more details about what failed. Write back if you still can see the problem.Yours,
Frank Valdes
|