Change map FITS unit header key to standard "BUNIT" #1755
This is a reminder issue for me to look check if we should support
the CTA 1DC diffuse model was given like this:
@robertazanin @facero @registerrier - For now, when using the diffuse model, please always load it via
It looks like
Reading back works of course:
It looks like we did support
And we did support
There is no mention of
Looking at the FITS standard, as far as I can see it only mentions BUNIT and neither UNIT or SPECUNIT as valid keywords:
So I'm inclined to change gammapy.maps to just use BUNIT instead of UNIT.
Of course we could also support multiple keys, e.g.
The maps spec doesn't mention how to store unit, and the example files contain no unit:
This package seems to use BUNIT only, not read or write UNIT or SPECUNIT:
If anyone has files that contain "UNIT" or "SPECUNIT" (e.g. from the Fermi ST or other missions) instead fo "BUNIT" that you want to use with Gammapy, please mention it here so that we know whether to support that on read.
I've made the change from UNIT to BUNIT, attached in commit e6a31fb here.
The change is covered by a test for both HPX and WCS already.
This change caused one fail: in
It fails with a
But the question remains: what should we do for maps with invalid units?
I'm +1 to emit a warning and put no unit in the map. It's not the users fault often if they get bad data, so I think we should be "lenient on read and strict on write".