svalenti / pessto

pessto pipeline
MIT License
9 stars 6 forks source link

How is EFFRON calculated for SOFI spectra? #15

Open thespacedoctor opened 9 years ago

thespacedoctor commented 9 years ago

I know for the imaging it's calculated by:

EFFRON = 12.*sqrt(PI()/2)/sqrt(ncombine*ndit)

but this doesn't seem to be the case for SOFI spectra?

svalenti commented 9 years ago

I think it is on line 602 of sofispec2Ddef.py

ntt.util.updateheader(img,0,{'EFFRON':[12._(1/sqrt(readkey3(hdr,'ndit')__ncomb))* sqrt( pi/2 ), 'Effective readout noise per output (e-)']})

thespacedoctor commented 9 years ago

Ok, the formula is correct, but I think there's a bug in determining NCOMBINE.

Here is the code starting on line 596:

if 'NCOMBINE' in hdr:
    _ncomb=readkey3(hdr,'NCOMBINE')
else:
    _ncomb=1.0

ntt.util.updateheader(img,0,{'DETRON ':[12,'Readout noise per output (e-)']})
ntt.util.updateheader(img,0,{'EFFRON':[12.*(1/sqrt(readkey3(hdr,'ndit')*_ncomb))* sqrt( pi/2 ),
                                       'Effective readout noise per output (e-)']})

If you look at this frame reduced with v2.2.2 of the pipeline (https://db.tt/Mf4LuaMl) you can see that:

NCOMBINE = 8 NDIT = 5

but EFFRON = 6.73, which means NCOMBINE was assumed to be 1 and not 8.

svalenti commented 9 years ago

The problem was in sofispec1Ddef. product of sofispec2Ddef are still not combined. problem fixed 2.2.7