c3-time-domain / SeeChange

A time-domain data reduction pipeline (e.g., for handling images->lightcurves) for surveys like DECam and LS4
BSD 3-Clause "New" or "Revised" License
0 stars 4 forks source link

Instrument.get_gain_at_pixel doesn't do the right thing #369

Open rknop opened 2 weeks ago

rknop commented 2 weeks ago

This one is kind of tangled because the whole handling of section is complicated with lots of implicit loading and things all over the place. Instrument.get_gain_at_pixel first looks to see if image is not None; if it's not, it looks for the gain from the section object. However, at least with PTF and DECam, the _make_new_section method doesn't actually set the gain property. So, Instrument.get_gain_at_pixel will return None.

The right thing to do is probably to make sure every instrument class has its own get_gain_at_pixel. However, the default behavior should be different. Either it should look elsewhere if the gain from get_section_id is None, it should look first at image.gain, or maybe do something else. Perhaps the right thing to do is raise a NotImplemented exception.