roman-corgi / corgidrp

Data Reduction Pipeline for the Roman Coronagraph Instrument
BSD 3-Clause "New" or "Revised" License
5 stars 4 forks source link

A proposal for how to add more flexible hdus without hardcoding attributes #134

Closed maxwellmb closed 3 months ago

maxwellmb commented 4 months ago

Describe your changes

I've added an hdu_list attribute to the Image class that allows us to flexibly add new HDUs to an Image without having to hardcode in attributes, such as how we are currently treating Image.bias. In fact, this PR demonstrates the functionality by completely replacing Image.bias. Part of the motivation for this came up in a conversation with @neilzim about future spectroscopic dataset. There is a new Image.add_extension_hdu() function.

Another advantage of this implementation is that means that if we decide at some point we no longer need to carry around some information then we can drop HDUs, e.g. when saving data to a new level. For example, do level 4 data products need to drag around the pre-scan bias information?

Type of change

Reference any relevant issues (don't forget the #)

If we decide to go this route it will affect several current PRs, such as PR #116, PR #105, as it will provide a convenient way to attach new HDUs (e.g. the PTC for the KGain class). Its also relevant for issue #112.

Checklist before requesting a review