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

Error loading Rosetta/RPC MIP data table #34

Closed msbentley closed 2 years ago

msbentley commented 2 years ago

I am trying to load this data product:

https://archives.esac.esa.int/psa/ftp/INTERNATIONAL-ROSETTA-MISSION/RPCMIP/RO-C-RPCMIP-3-EXT3-V1.0/DATA/CALIBRATED/2016/JUL/RPCMIPS3WSF1607290000_07684.LBL

having downloaded the label, table file and format file. However, I get the following error:

In [5]: data['SS_PO_F_SPECTRUM_TABLE']
/Users/mbentley/Library/CloudStorage/OneDrive-ESA/software/pds/pdr/pdr/pdr.py:488: UserWarning: Unable to load SS_PO_F_SPECTRUM_TABLE: Each column specification must be 2 element tuple or list of integers
  warnings.warn(f"Unable to load {object_name}: {ex}")

Any ideas of this is a pdr issue or something awry with the data? Thanks!

m-stclair commented 2 years ago

Thank you for the bug report. I think this is a pdr issue. Specifically, these files specify field positions in a way that is very unusual but not illegal (at least in the PDS) for ASCII tables, and because it is unusual, we have not yet implemented support for this format specification style. It shouldn't be particularly difficult to do so, though; we will look into it and get back to you.

msbentley commented 2 years ago

Great, thanks @m-stclair!

m-stclair commented 2 years ago

I've implemented a quick fix for this that should make these tables readable. It's not as performant as a more complete approach to this category of problem, but these files aren't very big and it shouldn't present a meaningful performance issue for you. It's in the most recent commit (be7b1275dc041ae5699b7bbe125b620af53a1260) on the develop branch. Let us know how it works out!

msbentley commented 2 years ago

LGTM @m-stclair , many thanks!