Hi Markus,
Thanks for the interest in FITS.
As you already have noticed we switched from list of rules to associations, since we believe it's easier to extract data from an association, but as you also mentioned, you could always use Normal
over association to make your old code work.
To get exactly the same output as in 11.1, you could just use the legacy element: Import[file, "MetadataLegacy"]
.
One benefit you will notice in upcoming versions, is an indexed association and not a list of associations as an output of metadata, which allows you to easily associate the data to the HDU it was extracted from.
Previously you could see the values in the metadata being lists of a form {value, comment}
, which has been replaced by value
in 11.2, but we are bringing back the original output design of values in upcoming versions with a slight modification; now you will be having meaningful Wolfram Language objects instead of just empty strings (e.g. " "
will be shown as Missing["NotAvailable"]
); "RawMetaInformation"
will still be giving the unprocessed version of the output.
Introducing "GENERAL INFORMATION"
as a general key to metadata was motivated by changes described above, and the fact that association can't hold duplicate keys. For files with richer metadata this makes a lot of sense; let's take a look at one example:
Import["w0bs0102t_c0h.fit", "Metadata"]//Keys
(* ==> {{"GENERAL INFORMATION", "WFPC DATA DESCRIPTOR KEYWORDS", "SCIENCE INSTRUMENT CONFIGURATION", "FILTER CONFIGURATION", "EXPOSURE TIME AND RELATED INFORMATION", "TARGET INFORMATION", "INSTRUMENT STATUS USED IN DATA PROCESSING", "IMAGE TYPE CHARACTERISTICS", "RSDP CONTROL KEYWORDS", "CALIBRATION REFERENCE FILES", "DEFAULT KEYWORDS SET BY STSCI", "PLANETARY SCIENCE KEYWORDS", "PODPS FILL VALUES", "MISC KEYWORDS", "DMF EXPOSURE DATA"}, {"GENERAL INFORMATION"}} *)
Which looks as follows in upcoming versions:
Import["w0bs0102t_c0h.fit", {"MetaInformation", 1}]//Keys
(* ==> {"GENERAL INFORMATION", "WFPC DATA DESCRIPTOR KEYWORDS", "SCIENCE INSTRUMENT CONFIGURATION", "FILTER CONFIGURATION", "EXPOSURE TIME AND RELATED INFORMATION", "TARGET INFORMATION", "INSTRUMENT STATUS USED IN DATA PROCESSING", "IMAGE TYPE CHARACTERISTICS", "RSDP CONTROL KEYWORDS", "CALIBRATION REFERENCE FILES", "DEFAULT KEYWORDS SET BY STSCI", "PLANETARY SCIENCE KEYWORDS", "PODPS FILL VALUES", "MISC KEYWORDS", "DMF EXPOSURE DATA"} *)
You could see that the first HDU of the file contains metadata with multiple domains of key-value pairs; "GENERAL INFORMATION"
is here, in a sense, for consistency, when all other keys above are present in the file. If we wouldn't have done this, some metadata would have been ignored:
DuplicateFreeQ[Flatten[Normal[Import["w0bs0102t_c0h.fit", {"MetaInformation", 1}]//Values]]//Keys]
(* ==> False *)
This is just one example, you could in fact find more.
Concerning the "dimensions"; to be short and to admit the truth, we were doing it incorrectly in 11.1, and just fixed it in 11.2 :) Upcoming versions will introduce a new option which is called DataReversed
to control the dimensions of the import and/or export.
Upcoming versions will introduce a lot of interesting design decisions that will hopefully make FITS manipulations in WL easier and more intuitive; of course all of them will be nicely documented.
Last, but not least, upcoming versions will introduce full import and export support for all types of FITS compression, as well as all types of HDU.
Please let me know if you have any other questions and/or concerns, and I will do my best to guide you through.
Cheers,
Mikayel