HiRISE

HiRISE.HiCat.HiVolume
Class Product

java.lang.Object
  extended by java.io.File
      extended by PIRL.Utilities.File
          extended by HiRISE.HiCat.HiVolume.Product
All Implemented Interfaces:
Serializable, Comparable<File>

public class Product
extends File

This Product is a very simple subclass of PIRL.Utilities.File for reading in the label parameters from a PDS product. This class reads the PDS label of the input product to determine the Product Type (EDR or RDR), the Product ID, and the Version of the product.

Author:
Rodney Heyd UA/PIRL/HiRISE
See Also:
Serialized Form

Field Summary
static String ID
          The revision identifier of this class.
 
Fields inherited from class PIRL.Utilities.File
DEFAULT_CONFIGURATION_FILENAME, EXIT_CONFIGURATION_PROBLEM, EXIT_INVALID_COMMAND_LINE_SYNTAX, EXIT_IO_ERROR, EXIT_SUCCESS, PATHNAMES_MAP_GROUP
 
Fields inherited from class java.io.File
pathSeparator, pathSeparatorChar, separator, separatorChar
 
Constructor Summary
Product(String pathname)
          Construct a new Product from a string representing the full path and filename of a product.
 
Method Summary
 boolean Color()
          Is the product a color product? Returns true if the product is a color product, false otherwise.
 File Data_File()
          Return the data_file for this product.
 void Data_File(String data_file)
          Set the data file location for this product.
 String HiCat_Pathname()
          Get the Pathname to this product as defined in HiCat.
 void HiCat_Pathname(String pathname)
          Set the pathname for this product.
 File Label_File()
          Get the PDS label file of this product.
 void Label_File(String label_file)
          Set the path and location of the PDS label file for this product.
static void main(String[] arguments)
           
 String Observation_ID()
          Get the Observation_ID of the product
 void Observation_ID(String observation_id)
          Set the Observation_ID of the product, this can be acquired directly from the product label or can be found from a database query.
 void Parse_Product()
          Parse the product label to get the product id, version, observation id, target name, etc.
 File PDS_Path()
          Get the PDS release path as a file.
 void PDS_Path(String Release_Path)
          Set the PDS release path for this product.
 String Product_ID()
          Get the Product_ID of the Product
 void Product_ID(String product_id)
          Set the Product_ID of the product
 String Product_Type()
          Get the product type.
 void Product_Type(String product_type)
          Set the product type.
 String Target_Name()
          Get the Target_Name of the target contained within this product.
 void Target_Name(String target_name)
          Set the target_name for this product.
 String Version()
          Get the version of this product
 void Version(String version)
          Set the version of this product
 
Methods inherited from class PIRL.Utilities.File
Logical_Path, Pathnames_Map, Pathnames_Map, Pathnames_Map, Usage
 
Methods inherited from class java.io.File
canExecute, canRead, canWrite, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, equals, exists, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getFreeSpace, getName, getParent, getParentFile, getPath, getTotalSpace, getUsableSpace, hashCode, isAbsolute, isDirectory, isFile, isHidden, lastModified, length, list, list, listFiles, listFiles, listFiles, listRoots, mkdir, mkdirs, renameTo, setExecutable, setExecutable, setLastModified, setReadable, setReadable, setReadOnly, setWritable, setWritable, toString, toURI, toURL
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ID

public static final String ID
The revision identifier of this class.

See Also:
Constant Field Values
Constructor Detail

Product

public Product(String pathname)
Construct a new Product from a string representing the full path and filename of a product.

Parameters:
pathname - The full path and filename of a PDS product.
Throws:
PVL_Exception - if the input file does not have a PDS label.
Method Detail

Parse_Product

public void Parse_Product()
                   throws PVL_Exception
Parse the product label to get the product id, version, observation id, target name, etc. This can be slow if a large list of products is being processed. In such cases, pulling the needed data from a database and using the setter methods will probably be faster.

Throws:
PVL_Exception

Product_ID

public String Product_ID()
Get the Product_ID of the Product

Returns:
the Product_ID

Product_ID

public void Product_ID(String product_id)
Set the Product_ID of the product

Parameters:
product_id - the product_id to associate with the product

Version

public String Version()
Get the version of this product

Returns:
a version string which should be parsable into an integer

Version

public void Version(String version)
Set the version of this product

Parameters:
version - the version id of the product

Observation_ID

public String Observation_ID()
Get the Observation_ID of the product

Returns:
the Observation_ID associated with the product

Observation_ID

public void Observation_ID(String observation_id)
Set the Observation_ID of the product, this can be acquired directly from the product label or can be found from a database query.

Parameters:
observation_id - the Observation_ID to associate with the product.

Product_Type

public String Product_Type()
Get the product type. This should be an EDR or RDR

Returns:
the product type as a string.

Product_Type

public void Product_Type(String product_type)
Set the product type. This should be "EDR" or "RDR"

Parameters:
product_type -

Target_Name

public String Target_Name()
Get the Target_Name of the target contained within this product.

Returns:
the target name string.

Target_Name

public void Target_Name(String target_name)
Set the target_name for this product. Note: this is a convenience function for cases in which parsing the product might be slow.

Parameters:
target_name -

HiCat_Pathname

public String HiCat_Pathname()
Get the Pathname to this product as defined in HiCat. This will normally be the logical path within the HiRISE filesystem to this product.

Returns:
the logical pathname string include the file name.

HiCat_Pathname

public void HiCat_Pathname(String pathname)
Set the pathname for this product. This should be acquired from a database query.

Parameters:
pathname - the filesystem path to the product including the filename.

PDS_Path

public void PDS_Path(String Release_Path)
Set the PDS release path for this product.

Parameters:
Release_Path -

PDS_Path

public File PDS_Path()
Get the PDS release path as a file.

Returns:
the PDS_Path file.

Label_File

public File Label_File()
Get the PDS label file of this product. Note, this file may be the same as the data file if the label is attached to the PDS image file.

Returns:
return the PDS label file.

Label_File

public void Label_File(String label_file)
Set the path and location of the PDS label file for this product. If the label is not detached, then this should be the same as the data file.

Parameters:
label_file -

Data_File

public File Data_File()
Return the data_file for this product.

Returns:
the data file.

Data_File

public void Data_File(String data_file)
Set the data file location for this product.

Parameters:
data_file -

Color

public boolean Color()
Is the product a color product? Returns true if the product is a color product, false otherwise. The determination is made based on the product file name. If the file name contains the word "COLOR" then the product is assumed to be a color product.

Returns:
true if the product is color, false otherwise.

main

public static void main(String[] arguments)

HiRISE

Copyright (C) Arizona Board of Regents on behalf of the Planetary Image Research Laboratory, Lunar and Planetary Laboratory at the University of Arizona