This is a C shared library that parses the labels of NASA Planetary Data Science (PDS) files into structs with hashmap access to metadata and embedded objects. Labels only - metadata, but no data yet. The eventual goal of this project is to provide low-overhead conversion of PDS data files into 3D coordinates, but the label parsing is a necessary first step. It also has Java Native Interface bindings.
The library is currently only distributed via git.
Its only dependency, Christopher Clark's hashtable library, is checked in to the lib folder, so it can be compiled as long as you have a C compiler and runtime.
This project is still quite new and hasn't been extensively tested on extant PDS files. If you find a PDS label that doesn't parse correctly, or causes errors, please open an issue about it, email me, or tweet @aperiodic.
To get started:
git clone https://github.com/aperiodic/pds-tools
cd pds-tools
make runThe default make target produces a shared library named libpdstools.so in the bin folder.
The demo target produces bin/pds-parse-demo, and can be run on an included PDS label by executing the run target with make run.
The Java bindings live in bindings/java.
cd bindings/java
make && make run label=../../samples/mola.lblThe make command for the Java bindings produces two things:
- a
libpdstools.sonative shared library that will need to be in yourjava.library.path. - a
PDSTools.jarJAR that contains a Java wrapper around the native library. You may want to look at the definition of theruntarget in the Java bindings' Makefile for how exactly to run a simple demo of the Java bindings.
That demo also serves as documentation on the Java bindings.
The bindings/java/org/aperiodic/PDSTools.java file contains a main method that parses a PDS label file, then prints its version, metadata, and embedded objects (and their attributes).
The debug make target can be used to turn on print statements emitted during parsing that can be helpful when debugging errors.
make debug && ./build/pds-parse samples/mola.lblCopyright © Dan Lidral-Porter 2014.
This library's source and its bindings are licensed under the GPLv3 (see COPYING).
The included hash table library from Christopher Clark is included in lib under the terms of the MIT License; the GPLv3 license that applies to the rest of this repository does not include the contents of the lib directory.