I am working with point spectrometer files, in particular from MESSENGER/MASCS PDS v3 (see example below).
The PDS data have a detached header file (.LBL) describing the data that internally points to a "STRUCTURE" file (FMT), that contains the commons data structure for all the dataset.
See relevant official NASA documentation for PDS3 :
This particular dataset uses 8 Bytes IEEE_REAL types for different data COLUMNS (in PDS parlance).
I expected OGR/PDS driver to read the data as 8 Bytes, but it just cast them to 4 Bytes ( see code for
ogrpdslayer.cpp ) effectively trowing away the last 4 Bytes, without any Warning or Error to the user.
Link to Data
For ogr tools to work, one need to copy the FMT file in the same folder as the data+header.
This is not the case for a standard NASA PDS archive, where the FMT files are all stored in ROOT/label/.
Implement the 8Bytes Real type in ogrpdslayer.cpp .
An easy test would be to delete the Lines 248-249 that force the type to 4Bytes, but I have no idea if this will impact other parts or if 4Bytes types are assumed/hardcoded somewhere else.
I'll try to compile myself and test it.
GDAL version and provenance
I check until the tag v2.3.0beta1 and the code fragment in ogrpdslayer.cpp (Lines 246-249) are the same.
Intro
I am working with point spectrometer files, in particular from MESSENGER/MASCS PDS v3 (see example below).
The PDS data have a detached header file (.LBL) describing the data that internally points to a "STRUCTURE" file (FMT), that contains the commons data structure for all the dataset.
See relevant official NASA documentation for PDS3 :
read_mascs_org_dgal.ipynb
Expected behavior and actual behavior.
This particular dataset uses 8 Bytes IEEE_REAL types for different data COLUMNS (in PDS parlance).
I expected OGR/PDS driver to read the data as 8 Bytes, but it just cast them to 4 Bytes ( see code for ogrpdslayer.cpp ) effectively trowing away the last 4 Bytes, without any Warning or Error to the user.
Link to Data
For ogr tools to work, one need to copy the FMT file in the same folder as the data+header.
This is not the case for a standard NASA PDS archive, where the FMT files are all stored in
ROOT/label/
.All those data are attached here github_issue.zip
Steps to reproduce the problem.
Data extracted from gdal/ogr cli tool:
"True" data extracted with the official tool delivered from the team ( MESSENGER MASCS Software) :
Both command line tools and python binding relies on the same code
ogrpdslayer.cpp
thus they share the sam behaviour.Partial Solution (Workaround)
For the python binding only, I use this workaround:
osgeo.ogr.Open
This works reasonably well/fast, but it is hacky and only via python.
A notebook summarising my findings is here : read_mascs_org_dgal.ipynb
Real Solution
Implement the 8Bytes Real type in ogrpdslayer.cpp .
An easy test would be to delete the Lines 248-249 that force the type to 4Bytes, but I have no idea if this will impact other parts or if 4Bytes types are assumed/hardcoded somewhere else.
I'll try to compile myself and test it.
GDAL version and provenance
I check until the tag v2.3.0beta1 and the code fragment in
ogrpdslayer.cpp
(Lines 246-249) are the same.