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

Scrambled table #33

Closed msbentley closed 2 years ago

msbentley commented 2 years ago

I am trying to open this simple index file:

https://archives.esac.esa.int/psa/ftp/VENUS-EXPRESS/VIRTIS/VEX-V-VIRTIS-2-3-V3.0/INDEX/VIRTIS_INDEX.LBL https://archives.esac.esa.int/psa/ftp/VENUS-EXPRESS/VIRTIS/VEX-V-VIRTIS-2-3-V3.0/INDEX/VIRTIS_INDEX.TAB

but it looks like the offsets get scrambled when reading with pdr. At first glance the label looks OK.

In [2]: import pdr

In [3]: idx = pdr.read('VIRTIS_INDEX.LBL')

In [4]: idx.INDEX_TABLE
Out[4]:
                                 FILE_SPECIFICATION_NAME              PRODUCT_ID  RELEASE_ID  REVISION_ID  OBSERVATION_DURATION  ... TELESCOPE_TEMP SPECTROMETER_TEMP  GRATING_TEMP    PRISM_TEMP         PRODUCT_CREATION_TIME
0      b'"DATA/MTP001/VIR0023/RAW/VH0023_00.QUB"     ...  b',"VH0023_00.QUB"   '   539762720    540093472          1.356847e-19  ...   1.766019e-04      1.765941e-04  1.467260e-19  1.661525e-04  b'9,  -999.999,    0.0000, '
1      b'   0.0000,  -999.999,"N/A"      ,   0,-999, ...  b'999,  -999.999,  -9'   960048697    960048173          1.766427e-04  ...   6.835643e-04      1.668748e-07  4.247033e-05  2.414901e-18  b'6-05-14T00:35:44.394",  2'
2      b'3,"VENUS", 432, 256,   7,   1,  10,    -1.00...  b'-1.000,   7,"NONE" '   538976288    539762720          2.650957e-09  ...   1.766428e-04      1.766427e-04  1.356318e-19  6.637741e-07  b'64,   155.411,"2012-04-15'
3      b'T22:12:10.000"\r\n"DATA/MTP001/VIR0023/RAW/V...  b'.QUB"           ,"V'  1227894834    861876272          4.759682e-11  ...   2.275523e-12      1.766428e-04  1.766427e-04  1.356749e-19  b'99.999,  -999.999,  -999.'
4      b'999,    0.0000,    0.0000,  -999.999,"N/A"  ...  b'  0,   0,     0.148'   740302880    540226862          2.655269e-06  ...   4.103984e-05      6.410542e-10  6.591164e-10  1.976157e-07  b':48:04.186","2006-05-14T0'
...                                                  ...                     ...         ...          ...                   ...  ...            ...               ...           ...           ...                           ...
26125  b'L"    ,"VI0315_02.CAL"    ,   1,   0,    0.3...  b'007-03-01T23:25:33.'   892679202    740438576          6.663923e-10  ...   1.622254e-07      6.409113e-10  6.899093e-07  2.595607e-06  b'0,"MOSAIC"   ,   2,   1, '
26126  b'  -30.213,    35.621,     0.258,   1,    88....  b' 155.757,   155.535'   740302893    960051502          1.766427e-04  ...   5.423506e+13      6.965250e+11  1.668893e-07  1.509479e-19  b', 271,   1,  20,     3.30'
26127  b'0,     5.000,  19,"WAVELET"   ,   2,   1,  -...  b'9,  -999.999,   -54'   775303218    740302880          1.047189e-11  ...   6.721799e-04      1.640808e-07  6.407682e-10  7.812853e-33  b'TA/MTP011/VIR0315/GEOMETR'
26128  b'Y/VI0315_03.GEO"      ,"VI0315_03.GEO"    , ...  b' 0,    0.3764,"2007'   758133549    808604720          6.773775e-10  ...   2.275520e-12      1.492306e-19  6.409688e-10  1.356318e-19  b'4.0000, 55366.300,"MOSAIC'
26129  b'"   ,   2,   1,   -30.213,    35.621,     0....  b' 1,    88.298,   15'   908997170    959193120          1.501009e-19  ...   4.439076e-05      4.142749e-11  2.332739e-18  2.636405e-09  b'VENUS", 432, 256, 271,   '

[26130 rows x 42 columns]

If you think it's a product issue, please let me know. Thanks!

Sierra-MC commented 2 years ago

Hi Mark,

These were being interpreted as binary tables when they should have been interpreted as ASCII. We've added a more robust check to differentiate between the two and now these read just fine. This has been patched into the master git branch. I can update the pip and conda feedstock in just a bit (it can take a few hours for those to go live).

msbentley commented 2 years ago

Fantastic, thanks @Sierra-MC I'll give it a whirl after conda-forge updates!

msbentley commented 2 years ago

Updated: I realised I didn't install from conda, but from source :) Pulled and tested, works well - thanks!