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.
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 ifimage
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 fromget_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.