Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for PDS3 Spreadsheets that use record value offsets #4

Open
jordanpadams opened this issue Aug 2, 2019 · 0 comments
Open
Labels

Comments

@jordanpadams
Copy link
Member

jordanpadams commented Aug 2, 2019

This ticket will deal with updating the Transform Tool to support PDS3 Spreadsheet objects that contain a record offset value instead of a byte offset value in the pointer statement.

The tool currently outputs the following error when trying to perform a PDS3 table to CSV transformation:

C:\Users\slavney\Documents\Work_files\Mission_Operations\MSL\PDS3to4\ForSean\APXS>transform apa_402284882rsp00540043232_______p1.lbl -f pds4-label -o apa_pds4label
gov.nasa.pds.transform.TransformException: Error occurred while generating PDS4 label: Invocation of method 'parseInt' in  class java.lang.Integer threw exception java.lang.NumberFormatException: null at /gov/nasa/pds/transform/util/generic-pds3_to_pds4.vm[line 596, column 55]
        at gov.nasa.pds.transform.product.Pds3LabelTransformer.transform(Pds3LabelTransformer.java:91)
        at gov.nasa.pds.transform.product.Pds3LabelTransformer.transform(Pds3LabelTransformer.java:103)
        at gov.nasa.pds.transform.TransformLauncher.doTransformation(TransformLauncher.java:425)
        at gov.nasa.pds.transform.TransformLauncher.processMain(TransformLauncher.java:460)
        at gov.nasa.pds.transform.TransformLauncher.main(TransformLauncher.java:479)
outputs = []
PDS Transform Tool Log

Version                     Version 1.6.0
Time                        Thu, Nov 30 2017 at 02:17:36 PM
Target                      [file:/C:/Users/slavney/Documents/Work_files/Mission_Operations/MSL/PDS3to4/ForSean/APXS/apa_402284882rsp00540043232_______p1.lbl]
Output Directory            apa_pds4label
Index                       1
Format Type                 pds4-label

INFO:   [C:\Users\slavney\Documents\Work_files\Mission_Operations\MSL\PDS3to4\ForSean\APXS\apa_402284882rsp00540043232_______p1.lbl] Transforming label file: C:\Users\slavney\Documents\Work_files\Mission_Operations\MSL\PDS3to4\ForSean\APXS\apa_402284882rsp00540043232_______p1.lbl
ERROR:   [file:/C:/Users/slavney/Documents/Work_files/Mission_Operations/MSL/PDS3to4/ForSean/APXS/apa_402284882rsp00540043232_______p1.lbl] Error occurred while generating PDS4 label: Invocation of method 'parseInt' in  class java.lang.Integer threw exception java.lang.NumberFormatException: null at /gov/nasa/pds/transform/util/generic-pds3_to_pds4.vm[line 596, column 55]

The issue is that when the tool sees a record value in a pointer statement like so:

^SPREADSHEET = ("APA_402284882RSP00540043232_______P1.CSV",2)

it calculates the actual start byte location of the data by using the RECORD_BYTES value. However, this element does not exist in the label so it errors out. Changing this pointer statement with using a BYTE offset value instead, transformation is successful:

^SPREADSHEET = ("APA_402284882RSP00540043232_______P1.CSV",130 <BYTES>)

This update will involve having to read in the data file to determine the starting byte location of the data so that the PDS4 label will get populated with the correct offset value when describing the table object.

apa_402284882rsp00540043232_______p1.csv.txt
apa_402284882rsp00540043232_______p1.lbl.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: ToDo
Development

No branches or pull requests

1 participant