public class DTM_Verifier
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
DTM_Verifier.ExitCode
Exit Code Enumeration
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEBUG_DTM_PRODUCT_ID_PROP |
static java.lang.String |
DEFAULT_CONFIGURATION_FILENAME
The default configuration file
|
static java.lang.String |
ID |
static int |
MAX_LINE_LENGTH
The maximum number of bytes a single line in the label can have.
|
Constructor and Description |
---|
DTM_Verifier(java.io.File inputDir)
Construct a new verifier given a directory to read product files from.
|
Modifier and Type | Method and Description |
---|---|
void |
checkFile(java.io.File label)
Perform file formatting tests on the product label.
|
boolean |
checkLatitude(PIRL.PVL.Parameter latitude)
Checks that the input Parameter contains a valid latitude value
|
boolean |
checkLongitude(PIRL.PVL.Parameter longitude)
Checks that the input Parameter contains a valid longitude value
|
boolean |
checkMapProjection(PIRL.PVL.Parameter projection)
Checks that the input Parameter holds a valid map projection type.
|
boolean |
checkNorthAzimuth(PIRL.PVL.Parameter northAz,
PIRL.PVL.Parameter projection)
Checks that the north azimuth setting is valid for the given input
parameters.
|
boolean |
checkOffset(PIRL.PVL.Parameter offset,
boolean isDTM)
Checks that the input Parameter contains a valid OFFSET value.
|
boolean |
checkProducerName(PIRL.PVL.Parameter prodName)
Tests that the producer name parameter has been set.
|
boolean |
checkScaling(PIRL.PVL.Parameter scale,
boolean isDTM)
Checks that the input Parameter contains a valid SCALE_FACTOR value.
|
boolean |
checkSourceProductID(PIRL.PVL.Parameter spid,
boolean isDTM)
Tests that the SOURCE_PRODUCT_ID parameter contains the correct DTM
product id for orthoimages.
|
void |
generateReport()
Generates a report for the DTM and Ortho-image products found in the input
directory.
|
PIRL.PVL.Parameter |
getProductID(PIRL.PVL.Parameter param)
Gets the Parameter from the input parameter that contains the PRODUCT_ID
Parameter from the input Parameter tree.
|
static void |
main(java.lang.String[] args)
Verify label parameters and file formatting.
|
void |
verboseErrors(boolean verbose)
If this method is set to true, then more verbose error messages are
output, which should help to diagnose problems.
|
void |
verboseFileErrors(boolean verbose)
If set true, additional error information is output while checking the
file formating, this includes line length errors and end-of-line character
errors.
|
public static final java.lang.String ID
public static final java.lang.String DEFAULT_CONFIGURATION_FILENAME
public static final int MAX_LINE_LENGTH
public static final java.lang.String DEBUG_DTM_PRODUCT_ID_PROP
public DTM_Verifier(java.io.File inputDir) throws java.lang.Exception
inputDir
- - a directory containing HiRISE DTM product
(orthoimage and/or digitial terrain models (DTM)java.lang.Exception
- if an error while attempting to read the input directory.public void verboseErrors(boolean verbose)
verbose
- boolean value to that sets verbose error output. If set to
true, then more verbose error information is outputpublic void verboseFileErrors(boolean verbose)
verbose
- - a boolean value indicating of extra verbose file errors should
be output. Set to true to output additional error information.public void generateReport() throws java.lang.Exception
With the verbose options set (-v and -vf from the command line) verbose output from the parameter and file checks will be output respectively.
java.lang.Exception
- if any errors occurs during the test process.public PIRL.PVL.Parameter getProductID(PIRL.PVL.Parameter param)
param
- - The input Parameter containing a parameter called "PRODUCT_ID"public boolean checkSourceProductID(PIRL.PVL.Parameter spid, boolean isDTM) throws PIRL.PVL.PVL_Exception
spid
- - the SOURCE_PRODUCT_ID parameter from a HiRISE DTM labelisDTM
- - indicates if the input parameter is from a DTM product (instead
of an orthoimage).PIRL.PVL.PVL_Exception
- if an error occurs while attempting to read the input
parameterpublic boolean checkProducerName(PIRL.PVL.Parameter prodName) throws PIRL.PVL.PVL_Exception
prodName
- - A Parameter containing the producer namePIRL.PVL.PVL_Exception
- if an error occurs while attempting to read the
Parameterpublic boolean checkLatitude(PIRL.PVL.Parameter latitude) throws PIRL.PVL.PVL_Exception
latitude
- - A Parameter object containing a numerical latitude valuePIRL.PVL.PVL_Exception
- if an exception occurs while reading the input parameterpublic boolean checkLongitude(PIRL.PVL.Parameter longitude) throws PIRL.PVL.PVL_Exception
longitude
- - A Parameter object containing a numerical longitude valuePIRL.PVL.PVL_Exception
- if an exception occurs while attempting to read the
input Parameterpublic boolean checkScaling(PIRL.PVL.Parameter scale, boolean isDTM) throws PIRL.PVL.PVL_Exception
scale
- - A parameter object containing a scaling factor valueisDTM
- - A boolean value indicating that the input Parameter is from
a DTM product and not an ortho-image.PIRL.PVL.PVL_Exception
- if an error occurs while reading the Parameter valuepublic boolean checkOffset(PIRL.PVL.Parameter offset, boolean isDTM) throws PIRL.PVL.PVL_Exception
offset
- - A Parameter object holding the OFFSET label parameterisDTM
- - A boolean value indicating that the input Parameter is from
a DTM product and not an ortho-image.PIRL.PVL.PVL_Exception
- if an error occurs while attempting to read the Parameter
valuepublic boolean checkMapProjection(PIRL.PVL.Parameter projection) throws PIRL.PVL.PVL_Exception
projection
- - A Parameter containing a map projection typePIRL.PVL.PVL_Exception
public boolean checkNorthAzimuth(PIRL.PVL.Parameter northAz, PIRL.PVL.Parameter projection) throws PIRL.PVL.PVL_Exception
northAz
- - a Parameter holding the north azimuth information from the
product labelprojection
- - a Parameter holding the projection type information from
the product labelPIRL.PVL.PVL_Exception
- if an error occurs while reading the input Parameterspublic void checkFile(java.io.File label) throws java.io.IOException
More verbose output will be enable if verboseFileErrors is set to true.
label
- - A File object referencing the file to be checked for errorsjava.io.IOException
- if an error occurs while reading the filepublic static void main(java.lang.String[] args) throws java.lang.Exception
By default, all output is sent to stdout, however the -l option can be used to redirect output to a log-file in the current working directory.
args
- - the array of command line argumentsjava.lang.Exception
Copyright \ (C) Arizona Board of Regents on behalf of the \ Planetary Image Research Laboratory, Lunar and \ Planetary Laboratory at the University of Arizona