geminiplanetimager / gpi_pipeline

Gemini Planet Imager Data Reduction Pipeline
Other
8 stars 6 forks source link

GPITV DQ Frame fails to load when changing extensions #40

Open dsavransky opened 8 years ago

dsavransky commented 8 years ago

If you change the .fits extension to DQ and then back to science, GPITV will no longer flag the DQ pixels upon reloading, even when explicitly turned off and on again. Possibly line 8648 in gpitv.pro

mperrin commented 8 years ago

Legacy issue migrated from redmine issue tracker. Originally filed by @kfollette on 2015-02-20

dsavransky commented 8 years ago

Recovering rm journals for issue:

kfollette: The problem with this seems to be that a single extension is read with fitsext_read, and so when switching to the science frame, the dq frame is no longer in memory.

mperrin: More generally, the gpitv::switchextension procedure always just calls gpitv::fitsext_read rather than being smart enough to call the more specialized gpitv::fitsext_read_GPI

That happens inside gpitv::readfits (which is what the File Open... menu option runs, or giving a filename on the command line) but not inside ::switchextension.

The function fitsext_read_GPI also hands back a DQext array which then gets passed to gpitv::setup_new_image, again in gpitv::readfits but not gpitv::switchextension.

...what you have stumbled across here is that loading new images into GPItv is horrifyingly complex. This one's probably going to be relatively black-belt to fix. Dmitry, opinions?

dsavransky: ugh. Yeah - this'll be a pain to fix because it actually requires fixes to the extension switching logic. I'll try to dig into it at some point in the next few weeks. In the meantime, Kate, you may find this helpful: http://docs.planetimager.org/pipeline_dev/developers/gpitv_devel.html#the-call-sequence-for-loading-new-images-in-gpitv

mperrin: I wonder if we could refactor things such that switchextension just calls readfits, along with giving it some extra keyword arguments for which extension to read. That way it would always still run through the one load-new-files code path to rule them all.

mperrin: Dmitry are you likely to be able to dig into this one as you mentioned before, or should I put it on my own list?

mperrin: This is complex and doesn't seem to have been a priority lately. Bumping it 6 months down the line.