New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modifying our approach to Map metadata #4194
Comments
I'm 👍 for saving the original 100% untouched header somewhere. Whilst writing map classes for synoptic maps it is often helpful to validity check metadata fixes against parts of the original header that may be subsequently modified by the map class, so keeping a copy of the original header would be very useful in at least that case. |
I'll preserve here some Riot discussion between myself and @Cadair:
|
I am going to maintain my position that this is worth doing properly in the 3.x cycle. It's rattling around my brain at the moment and I might take a swing at putting together a concrete proposal for better metadata handling. |
Do we want to SEP this? |
probably. Also there are probably too many things rattling around in my brain for me to actually get to taking a swing at this if someone else wants to. @DanRyanIrish 😁 |
I am going to pull some more recent thoughts of mine into this issue. A bunch of these have come from #5199. Rather than splitting the header into two sets:
The second and third parts, could arguably be dropped when a new instance of the map is made (i.e. rotate). I think it's important to opening up future functionality that we move away from a FITS header-like object as the sole truth of map's metadata model and start using actual Python objects for that. Only if we do this will we be able to support objects like gWCS and other file formats like asdf. |
The current storage of our Map metadata (
.meta
) is confusing because it is the combination of:PCi_j
)CROTA2
)While we our API does have properties as an interface to
.meta
, it's unavoidable for users to directly access.meta
, and then it's opaque to the user whether they can trust what's in.meta
.I suggest a modified approach to Map metadata. Rather than having a single dictionary
.meta
, we would have two dictionaries:.original_header
would preserve the original values from the header, and we don't modify this header at all after it is created.meta
would contain only those keywords that we "bless", whether they are copied from.original_header
or are generated through our own codeFor example, if there's a
PCi_j
keyword in.original_header
, we'd simply copy that to.meta
. If there's onlyCROTA2
, we'd calculate the appropriatePCi_j
keywords and put them in.meta
, but we wouldn't modify.original_header
. TheCROTA2
keyword would never show up in.meta
.For observer coordinates, we'd copy over to
.meta
only the set of coordinates that we trust from.original_header
. In the unfortunate cases where there are no correct values (e.g., #3057, #3037), we could choose to copy over nothing to.meta
so that it's explicit that there are no "blessed" values. Even if we automatically determine the observer location through external sources (e.g., JPL Horizons), we'd put those "blessed" values in.meta
but still not touch.original_header
.It's an open question what we save when saving to a file. I haven't thought much about the considerations there.
Thoughts?
The text was updated successfully, but these errors were encountered: