MillionConcepts / pdr

[P]lanetary [D]ata [R]eader - A single function to read all Planetary Data System (PDS) data into Python
Other
60 stars 6 forks source link

Cannot open Rosetta/MIDAS table #6

Closed msbentley closed 3 years ago

msbentley commented 3 years ago

Perhaps table support is not yet implemented, but I tested this product:

https://pdssbn.astro.umd.edu/holdings/ro-c-midas-5-prl-to-ext3-v2.0/data/cah_0409522_1627308_01.lbl https://pdssbn.astro.umd.edu/holdings/ro-c-midas-5-prl-to-ext3-v2.0/data/cah_0409522_1627308_01.tab

and receive the "pointer not yet fully supported" message, and EVENT_TABLE lists the tab filename, not the table contents.

cmillion commented 3 years ago

Tables that are defined within the local label like this one should work. I just have to generalize the interpretation of the pointer name so that it knows to treat it like a TABLE.

cmillion commented 3 years ago

Oh, wait, nevermind. The format is defined externally in 'CAH_STRUCTURE.FMT'

I should be able to read the FMT files just fine; they are just PVL. The issue with these external reference files is that they aren't always in the same place in the data archive, so I don't know where to grab them from. I think that the only solution is to manually create a lookup table that keys off of, like, MISSION+INSTRUMENT+FILENAME.FMT.

msbentley commented 3 years ago

Ahh yes, sorry, I forgot that the table structure is needed. These are indeed a pain to work with. I would be happy if the tool looked for this format file e.g. in the same directory as the label (and below it?) and/or search for the LABEL folder in the dataset?

But it's a pain if one only downloads a few products rather than the whole dataset, indeed...

cmillion commented 3 years ago

Ok. I can at least implement logic where it looks for the FMT file in the same folder as the data and also return a warning like "XXX.FMT is required to interpret TABLE data" when it's not present. I would prefer that it "just works," but this seems like a reasonable stopgap. Do you agree?

msbentley commented 3 years ago

Thanks @cmillion, yes that sounds fine as an intermediate step!

cmillion commented 3 years ago

I have basically rewritten the whole thing to make handling of images, tables, and headers more generalized, and I also included the functionality discussed in this issue.

msbentley commented 3 years ago

Fantastic! Confirmed that my MIDAS cantilieger history table opens fine!