NASA - National Aeronautics and Space Administration

+ NASA Homepage
+ NASA en Español
+ Contact NASA
Go
Planetary Data System - Engineering Node Banner

Operation

This document describes how to operate the Transform Tool. The following topics can be found in this document:

Note: The command-line examples in this section have been broken into multiple lines for readability. The commands should be reassembled into a single line prior to execution.

Tool Execution

The Transform Tool can be executed in various ways. This section describes how to run the tool, as well as its behaviors and caveats.

Command-Line Options

The following table describes the command-line options available:

Command-Line OptionDescription
-t, --targetExplicitly specify a PDS3 or PDS4 product label that contains a reference to an image file to transform. The target can be specified implicitly as well. (example: transform i943630r.xml)
-o, --outputSpecify an output directory where the transformed images will reside. If this option is not specified on the command-line, the tool will default to placing the output files in the current working directory.
-f, --format-typeSpecify the transformation format type to perform on the target(s). Please see the Format Types section for details on the valid format types available to the tool.
-V, --versionDisplay the release number and copyright information.
-h, --helpDisplay tool usage.

Format Types

The following table describes the format types available to both PDS3 and PDS4 target inputs:

Format TypeDescription
jpeg or jpgSpecify to transform to an image in a Joint Photogrpahic Experts Group format.
jp2Specify to transform to an image in a JPEG 2000 format.
bmpSpecify to transform to an image in a Windows bitmap format.
wbmpSpecify to transform to an image in a Wireless Bitmap image format.
gifSpecify to transform to an image in a Graphics Interchange Format.
pngSpecify to transform to an image in a Portable Network Graphics format.
rawSpecify to transform to an image in a Raw image format.
tif or tiffSpecify to transform to an image in a Tagged Image File Format.
pnmSpecify to transform to an image in a Portable Any Map format.

The following table describes the format types available only to PDS4 products:

Format TypeDescription
pvlSpecify to transform a given PDS4 label into a Parameter Value Language file.
htmlSpecify to transform a given PDS4 label into an html representation of the label.
html-structure-onlySpecify to transform a given PDS4 label into an html representation of the label structure. As a result, the element contents are stripped out in the resulting file.
csvSpecify to transform a given table into a comma-separated value file.

The following table describes the format types available only to PDS3 products:

Format TypeDescription
pds4Specify to transform a given image into a PDS4 Array 2D image. Additionally, the given PDS3 label will be transformed into a PDS4 label. Note that this transformation currently applies to target VICAR images only. Please see the PDS3 to PDS4 Label Transformation section for more details on how the tool performs a PDS3 to PDS4 label transformation.
pds4-labelSpecify to transform a given PDS3 data product label into a PDS4 Product Observational product label. Please see the PDS3 to PDS4 Label Transformation section for more details on how the tool performs a PDS3 to PDS4 label transformation.

Running the Transform Tool

The Transform Tool requires the passing in of a PDS3 or PDS4 product label that contains a reference to an image file. In addition, the tool assumes that the referenced image file is co-located with the product label. Under the current implementation, if there are multiple image files referenced in a target label, the tool will default to only transforming the first image file reference. Other notable caveats with this initial version of the tool include:

  • Transformations of PDS3 images greater than 8-bits are not supported at the moment.
  • For PDS3 to TIFF transformations, the output tile size defaults to 8 lines by the image width.

This section demonstrates some of the ways that the tool can be executed using the command-line option flags:

  • Transform a Single PDS4 Array 2D Image
  • Transform a Single PDS4 Label To Parameter Value Language (PVL) File
  • Transform a Single 8-Bit PDS3 Image
  • Transform a PDS3 Label to PDS4 Label

The files used in the command-line examples below are packaged with the tool in the examples directory.

Transform a Single PDS4 Array 2D Image

The following command demonstrates transforming a PDS4 array 2D image referenced in the associated product label, i943630r.xml, into a jpeg image file named i943630r.jpg:

% transform ../examples/i943630r.xml -f jpg
        

Under the current implementation, for PDS4 data products, the tool only supports the transformation of array 2D images.

If the -o flag option is not specified on the command-line, the tool will default to creating an output file using the target image file name with the user-specified format as the file extension. The resulting output file will be written to the current working directory. The following command demonstrates transforming a PDS4 array 2D image referenced in the associated product label, i943630r.xml, into a graphics interchange format file:

% transform ../examples/i943630r.xml -f gif
        

The resulting output is written to the output file i943630r.gif in the current working directory.

Transform a Single PDS4 Label To Parameter Value Language (PVL) File

The following command demonstrates transforming a PDS4 label, i943630r.xml, to a PVL file, i943630r.pvl:

% transform ../examples/i943630r.xml -f pvl
        

Transform a Single 8-Bit PDS3 Image

The following command demonstrates transforming a PDS3, 8-bit image referenced in the associated attached label, FHA01118.LBL, into a bitmap image file named FHA01118.BMP:

% transform ../examples/FHA01118.LBL -f bmp
        

The following command demonstrates transforming a PDS3, 8-bit image referenced in the associated detached label, FF01.LBL, into a portable network graphics file named FF01.PNG:

% transform ../examples/FF01.LBL -f png
        

Transform a PDS3 Label to PDS4 Label

The following command demonstrates transforming a PDS3 data product label, ELE_MOM.LBL, into a PDS4 Product Observational label named ele_mom.xml:

% transform ../examples/ELE_MOM.LBL -f pds4-label
        

PDS3 to PDS4 Label Transformation

The intent of the PDS3 to PDS4 label transformation is to transform a PDS3 data product label into a PDS4 Product Observational product label with the minimum set of elements in order to be compliant with the PDS4 standards. Therefore, not all PDS3 keywords will map to the resulting label. This section details how the Transform tool populates some of the required elements of a PDS4 label. Please see the Known Issues section for details on the limitations with PDS3 to PDS4 label transformations.

Populating PDS4 Elements

This section describes how the tool leverages the PDS3 label in order to populate some of the PDS4 elements. Below is a list of PDS4 elements and a description of how the tool goes about populating that element.

logical_identifier

The tool will populate the logical_identifier element in the following mannner:

urn:nasa:pds:data:${DATA_SET_ID}:${PRODUCT_ID}
        

If PRODUCT_ID does not exist in the PDS3 label, then the tool will default to using the label filename instead:

urn:nasa:pds:data:${DATA_SET_ID}:${labelFilename}
        

title

The tool will populate the title element in the PDS4 label based on the existency of one or more of the following keywords:

  • OBSERVATION_NAME or
  • OBSERVATION_ID or
  • PRODUCT_NAME or
  • DATA_SET_ID + PRODUCT_ID or
  • DATA_SET_ID

So if OBSERVATION_NAME exists in the PDS3 label, it will use that to populate the title element. If it does not exist, it will use OBSERVATION_ID. If that does not exist, then it will use PRODUCT_NAME, and so forth.

Investigation_Area

For the Investigation_Area, the tool will use MISSION_NAME to populate this element in the following manner:

<name>${MISSION_NAME}</name>
<type>Mission</type>
<Internal_Reference>
  <lid_reference>urn:nasa:pds:investigation.${MISSION_NAME}</lid_reference>
  <reference_type>data_to_investigation</reference_type>
</Internal_Reference>
        

If MISSION_NAME does not exist, then the tool will use MISSION_PHASE_NAME instead.

Observing_System

For the Observing_System, the tool will populate this element with INSTRUMENT_HOST_NAME, INSTRUMENT_NAME, and INSTRUMENT_ID in the following manner:

<Observing_System_Component>
  <name>${INSTRUMENT_HOST_NAME}</name>
  <type>Spacecraft</type>
</Observing_System_Component>

<Observing_System_Component>
  <name>${INSTRUMENT_NAME}</name>
  <type>Instrument</type>
</Observing_System_Component>

<Observing_System_Component>
  <name>${INSTRUMENT_ID}</name>
  <type>Instrument</type>
</Observing_System_Component>
        

Known Issues

This section describes some of the known issues and limitations with the Transform Tool.

PDS3 Image Transformations

  • For target detached labels, the Transform Tool currently only supports 8-bit image transformations. To transform PDS3 images greater than 8-bits, the target label must be an attached label.
  • There is a known bug when performing a PDS3 to JPEG 2000 image transformation for target attached labels. The tool will report "null" in the output log and produce an empty output file.

PDS4 Image Transformations

The tool may not support image transformations other than those with a data type of "UnsignedMSB2". It has been tested with a PDS4 image of type "SignedMSB2", which throws the following error even though this is a valid data type according to the PDS data model:

Array data type is not valid, null, or unsupported
      

Due to lack of PDS4 image test data, it is unknown at this time what other data types are supported by the tool.

PDS3 to PDS4 Label Transformations

At this time, the Transform tool will support PDS3 to PDS4 label transformations of the following object types:

  • TABLE
  • SERIES
  • COLUMN
  • BIT_COLUMN
  • CONTAINER
  • IMAGE
  • SPREADSHEET

Explicit FILE objects, QUBE objects, as well as labels containing pointers to label fragments (i.e. ^STRUCTURE) are not supported by the tool at this time.


FirstGov Logo
+ Freedom of Information Act
+ NASA 2003 Strategic Plan
+ NASA Privacy Statement, Disclaimer, and
   Accessiblity Certification

+ Copyright/Image Use Policy
NASA Logo
Curator: Emily.S.Law
Webmaster: Maryia Sauchanka-Davis
NASA Official: William Knopf
Last Updated:
+ Comments and Questions