zkbt / mosasaurus

Tools for extracting chromatic lightcurves from MultiObject Spectrograph data.
MIT License
3 stars 1 forks source link

save intermediates #24

Closed hdiamondlowe closed 5 years ago

hdiamondlowe commented 5 years ago

I continually find I would like to take a look inside of the intermediates data structure. As of now it looks like it exists only within Aperture.py. Useful data saved in the intermediates data structure are:

Everything else of interest can be loaded from already saved data structures (e.g., calib, trace, etc.), or else simply derived from already saved data structures. Perhaps these two intermediates features can be added to the extracted data structure, which is saved for each exposure.

zkbt commented 5 years ago

Yeah, agreed -- it'd be nice to be able to look at these after the fact, and putting them in extracted would be the easiest way to do that. Do you want to implement that change?

zkbt commented 5 years ago

(Or have you already?!)

hdiamondlowe commented 5 years ago

Not yet! I'm working on my LHS 1140 paper, and that data is reduced already. I will be getting LDSS3C observations of LHS 3844b in a couple of weeks and I'm planning to make some updates to mosasaurus for that data set. I agree that sticking these in extracted would be simplest!

hdiamondlowe commented 5 years ago

Update: While it is indeed easy to save some of the properties from intermediates into extracted, it is incredibly redundant and increases the size of the extracted.npy files from order kB to order GB.

To address this I think the values should be saved as such:

hdiamondlowe commented 5 years ago

I do not think that saving the original data stamp and the sky estimates is reasonable, given that it makes the files to big (on order MB; 'GB' from earlier was a typo, but still).

But I have modified mosasaurus to save extractMask and skyMask in a .npy file for each aperture, which does not take up that much space and may come in handy.

Finally, I have added a new diagnostic plot that takes cuts in the spatial direction across the science stamp for each aperture. This helps to inspect the profile, along with the sky and extraction regions, at several points in the spectrum. This was the main use I had for saving the sky estimate, but now it is a default plot. An example is shown here: diagnosticCuts_aperture_391_1133.pdf*

*Caveat! I am not well-versed in the many capabilities of craftroom's display.py. It is likely that this figure can be refined to be more in-line with other mosasaurus figures, but perhaps @zkbt will be more adept at doing this :)