public class Retire_Suggestions
extends java.lang.Object
The retirement algorithm consists of several rules:
Parent Suggestion Rule
The parent suggestion of the given observation is always retired. Even if the observation does not overlap the parent suggestion sufficiently to retire the suggestion based on any of the following rules. This must be done to ensure suggestion retirement under circumstances of a delay by, where the observation might get shifted enough to not sufficiently overlap the parent suggestion.
Overlapping Areas Rule
This rule aplies to suggestions that have not been mapped to the input Observation. This rule has two parts:
Overlapping Seasonals Rule
If a set of seasonal suggestions overlaps an observation, but no member of the seasonal set is mapped to the observation, then only suggestions in the seasonal set with an LS range that contains the LS value of the acquired observation will be retired.
Exclusion Rule
If the parent suggestion is a member of a stereo or seasonal relation, then the other members of this relationship will be excluded from retirement (since these members will always overlap the parent suggestion).
Suggestions can be retired as soon as an observation has been planned and mapped to a suggestion. This means that the full geometry information may not yet be available if the observation has not yet been acquired and geometrically processed. When the geometry information is not available, the retirement algorithm will attempt to use the predicted center of the observation from the Planned_Observations table in HiCat. However, since the full geometry information is not available, only suggestions for which the predicted center of the observation falls within the region of interest of the suggestion will be retired. The second overlapping areas test will not be performed because the observation's footprint information is not available.
Unretire_Suggestions
,
HiCat Data DictionaryModifier and Type | Class and Description |
---|---|
static class |
Retire_Suggestions.Messages
The Messages class is a little data structure used for holding
informational and warning messages that might be generated during the process
of retiring a Suggested Observation.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEBUG_DATES_PROPERTY |
static java.lang.String |
DEBUG_GEOMETRY_PROPERTY |
static java.lang.String |
DEBUG_INIT_PROPERTY |
static java.lang.String |
DEBUG_MAIN_PROPERTY |
static java.lang.String |
DEBUG_METHODS_PROPERTY |
static java.lang.String |
DEBUG_OVERLAP_TEST_PROPERTY |
static java.lang.String |
DEBUG_OVERLAPS_PROPERTY |
static java.lang.String |
DEBUG_RETIREMENT_LIST_PROPERTY |
static java.lang.String |
DEBUG_SEASONAL_TEST_PROPERTY |
static java.lang.String |
DEBUG_TIMING |
static java.lang.String |
DEFAULT_CONFIGURATION_FILENAME |
static double |
DEFAULT_COORDINATE_BUFFER |
static int |
EXIT_COMMAND_LINE_SYNTAX_ERROR |
static int |
EXIT_CONFIGURATION_ERROR |
static int |
EXIT_DATABASE_CONNECT_ERROR |
static int |
EXIT_DATABASE_ERROR |
static int |
EXIT_IO_ERROR |
static int |
EXIT_NO_PARENT_SUGGESTION |
static int |
EXIT_QUERY_ERROR |
static int |
EXIT_SUCCESS |
static int |
EXIT_UNDEFINED_OBSERVATION_ID |
static java.lang.String |
ID |
Constructor and Description |
---|
Retire_Suggestions(PIRL.Configuration.Configuration Configuration)
Constructs a Retire_Suggestions object with a configuration, all operations
will be commited to the database.
|
Retire_Suggestions(PIRL.Configuration.Configuration Configuration,
boolean Noop)
Constructs a new Retire_Suggestions object based on a configuration.
|
Retire_Suggestions(PIRL.Database.Database database)
Constructs a Retire_Suggestions object using a
Database , all retirement
operations will be committed to the database. |
Retire_Suggestions(PIRL.Database.Database database,
boolean Noop)
Constructs a Retire_Suggestions object from a PIRL.Database object
|
Modifier and Type | Method and Description |
---|---|
java.util.Vector<java.lang.Integer> |
Get_Retired_Suggestions()
Get the list of suggestion ids retired by the input observation
ID.
|
java.lang.String |
Get_Status_Messages()
Gets any status messages that were generated during the retirement process.
|
java.util.Map<java.lang.Integer,Retire_Suggestions.Messages> |
Get_Suggestions_To_Retire(Observation_Record observation,
boolean includeAllOverlaps)
Get a list of target suggestions that will be retired by a given HiRISE
Observation.
|
java.util.Map<java.lang.Integer,Retire_Suggestions.Messages> |
Get_Suggestions_To_Retire(java.lang.String Observation_ID)
This is a wrapper method around the
Get_Suggestions_To_Retire(String, boolean)
method which only returns suggestions that will be retired by the default
retirement rules. |
java.util.Map<java.lang.Integer,Retire_Suggestions.Messages> |
Get_Suggestions_To_Retire(java.lang.String Observation_ID,
boolean includeAllOverlaps)
Get a list of target suggestions that may be retired by a given HiRISE
Observation ID.
|
java.lang.String |
Get_Warning_Messages()
Gets any warning messages that may have been generated
during the retirement process.
|
boolean |
getStage2RetirementStatus(java.lang.String observationID) |
static void |
main(java.lang.String[] arguments)
Retires Suggested Observations that overlap a planned or acquired
Observation.
|
static java.util.ArrayList<java.lang.Integer> |
parseSuggestionIds(java.lang.String id_list) |
boolean |
retire_suggestions(java.lang.String Observation_ID)
Retires suggestions that are associated with, or overlap the given
Observation ID.
|
java.util.Map<java.lang.Integer,Retire_Suggestions.Messages> |
retireSuggestions(java.lang.String Observation_ID,
java.util.Map<java.lang.Integer,Retire_Suggestions.Messages> suggestionsToForce)
This method of retiring targets will take the output hash map generated from
one of the
Get_Suggestions_To_Retire(String) methods and retire the
suggestions found in the map based on the return value of the
Retire_Suggestions.Messages.willRetire() method (if true the suggestion
will be retired, if false, the suggestion will not be retired). |
void |
Run_Geometry_Retirement(java.io.PrintWriter log)
This is utility method that will scan the Observation_Retirement_Status
and Observation_Geometry tables for observations that have not completed the
post-geometric processing retirement step, and run the retirement procedure
over these suggestions.
|
java.util.Vector<java.util.Vector<java.lang.String>> |
Stereo_Pair_Warnings(java.lang.String observation_id)
This method checks for pairs of stereo suggestions that have been retired by
the same input observation id.
|
static void |
Usage(int exit_status)
Prints the command line usage syntax.
|
public static final java.lang.String ID
public static final java.lang.String DEFAULT_CONFIGURATION_FILENAME
public static final int EXIT_SUCCESS
public static final int EXIT_COMMAND_LINE_SYNTAX_ERROR
public static final int EXIT_NO_PARENT_SUGGESTION
public static final int EXIT_QUERY_ERROR
public static final int EXIT_DATABASE_CONNECT_ERROR
public static final int EXIT_DATABASE_ERROR
public static final int EXIT_UNDEFINED_OBSERVATION_ID
public static final int EXIT_CONFIGURATION_ERROR
public static final int EXIT_IO_ERROR
public static final double DEFAULT_COORDINATE_BUFFER
public static final java.lang.String DEBUG_MAIN_PROPERTY
public static final java.lang.String DEBUG_INIT_PROPERTY
public static final java.lang.String DEBUG_METHODS_PROPERTY
public static final java.lang.String DEBUG_DATES_PROPERTY
public static final java.lang.String DEBUG_OVERLAPS_PROPERTY
public static final java.lang.String DEBUG_OVERLAP_TEST_PROPERTY
public static final java.lang.String DEBUG_GEOMETRY_PROPERTY
public static final java.lang.String DEBUG_RETIREMENT_LIST_PROPERTY
public static final java.lang.String DEBUG_SEASONAL_TEST_PROPERTY
public static final java.lang.String DEBUG_TIMING
public Retire_Suggestions(PIRL.Configuration.Configuration Configuration, boolean Noop) throws PIRL.Database.Database_Exception, PIRL.Configuration.Configuration_Exception
Configuration
- - A Configuration
containing database connection
parametersNoop
- Do not commit any retirements to the catalog.PIRL.Database.Database_Exception
- - if there is a problem establishing a connection
to the databasePIRL.Configuration.Configuration_Exception
- - if there is a problem reading parameters from
the configuration.public Retire_Suggestions(PIRL.Database.Database database, boolean Noop) throws PIRL.Database.Database_Exception, PIRL.Configuration.Configuration_Exception
database
- the database objectNoop
- the no operation flag, if set to true, no retirement operations
will be commited to the database.PIRL.Database.Database_Exception
- - if there is a problem establishing a connection
to the database, this would only occur if the database object is not
already connected to the database.PIRL.Configuration.Configuration_Exception
- - if there is a problem reading parameters from
the configuration.public Retire_Suggestions(PIRL.Configuration.Configuration Configuration) throws PIRL.Database.Database_Exception, PIRL.Configuration.Configuration_Exception
Configuration
- A Configuration
object containing database connection informationPIRL.Database.Database_Exception
- - if there is a problem establishing a connection
to the databasePIRL.Configuration.Configuration_Exception
- - if there is a problem reading parameters from
the configuration.public Retire_Suggestions(PIRL.Database.Database database) throws PIRL.Database.Database_Exception, PIRL.Configuration.Configuration_Exception
Database
, all retirement
operations will be committed to the database.database
- a Database
PIRL.Database.Database_Exception
- - if there is a problem establishing a connection
to the database, which would only occur if the database object is not
already connected to the database.PIRL.Configuration.Configuration_Exception
- - if there is a problem reading parameters from
the configuration.public java.util.Map<java.lang.Integer,Retire_Suggestions.Messages> Get_Suggestions_To_Retire(java.lang.String Observation_ID) throws PIRL.Database.Database_Exception, java.lang.IllegalArgumentException
Get_Suggestions_To_Retire(String, boolean)
method which only returns suggestions that will be retired by the default
retirement rules. It calls Get_Suggestions_To_Retire(String, boolean)
with the includeAllOverlaps parameter set to false.Observation_ID
- - A HiRISE observation IDPIRL.Database.Database_Exception
- if a database error occurs to the process.java.lang.IllegalArgumentException
- if the input observation id doesn't existGet_Suggestions_To_Retire(String, boolean)
public java.util.Map<java.lang.Integer,Retire_Suggestions.Messages> Get_Suggestions_To_Retire(java.lang.String Observation_ID, boolean includeAllOverlaps) throws PIRL.Database.Database_Exception, java.lang.IllegalArgumentException
Observation_ID
- - A HiRISE Observation ID in string formincludeAllOverlaps
- - If set to true the returned HashMap will include
overlapping suggestions that will *not* be retired by the default set of
retirement rules. These suggestions can be optionally included in case an
operator determines that the default retirement rules should be overridden.PIRL.Database.Database_Exception
java.lang.IllegalArgumentException
- if the input observation id does not existpublic java.util.Map<java.lang.Integer,Retire_Suggestions.Messages> Get_Suggestions_To_Retire(Observation_Record observation, boolean includeAllOverlaps) throws PIRL.Database.Database_Exception, java.lang.IllegalArgumentException
Get_Suggestions_To_Retire(String)
method except that it takes an
Observation_Record as an argument rather than an Observation_ID.
In order to get a complete list of all non-retired, overlapping suggestions,
the includeAllOverlaps parameter should be set to true. This setting should
also be used in cases where the desire to override the default retirement
rules may occur. In such cases, the willRetire() method of the associated
Messages object in the map will indicate the default operation to be performed
on the returned suggestion. Override the default operation, use the
willRetire(boolean) method on the Messages object to change the default setting.
The retireSuggestions(String, Map)
will retire suggestions based on
the setting of the return value of the willRetire() method of a suggestion's
associated Messages object.
observation
- - An Observation_Record generated from HiPlanincludeAllOverlaps
- - if true, all non-retired overlapping suggestions
will be returned, if false, only those suggestions that will be retired by
the standard retirement rules will be included.PIRL.Database.Database_Exception
java.lang.IllegalArgumentException
- if the input observation id does not existpublic boolean retire_suggestions(java.lang.String Observation_ID) throws PIRL.Database.Database_Exception
Get_Warning_Messages()
for how to get at the warning
messages.
Note: This method will be deprecated in the future. The Get_Suggestions_To_Retire() and retireSuggestions(String,Map) methods should be used instead.
Observation_ID
- The Observation ID to use for finding suggestions to
retire.PIRL.Database.Database_Exception
- - if one of the database operations fail while
attempting to retire a suggestion.java.lang.NullPointerException
- - If one of the MIN_LONGITUDE, MAX_LONGITUDE,
CENTER_LATITUDE, CENTER_LONGITUDE, or ROI fields is null for a suggestion
which overlaps the retiring observation. This would only occur for suggestions
which target Mars. It is expected that suggestions which do not target
Mars may not have all geometry fields populated.public java.util.Map<java.lang.Integer,Retire_Suggestions.Messages> retireSuggestions(java.lang.String Observation_ID, java.util.Map<java.lang.Integer,Retire_Suggestions.Messages> suggestionsToForce) throws PIRL.Database.Database_Exception
Get_Suggestions_To_Retire(String)
methods and retire the
suggestions found in the map based on the return value of the
Retire_Suggestions.Messages.willRetire()
method (if true the suggestion
will be retired, if false, the suggestion will not be retired).
Resetting the boolean value found in the messages object mapped to a given
suggestion id prior to calling this method will over-ride the
retirement decision made by the using the automated process. The
Retire_Suggestions.Messages.willRetire(boolean)
method can be used to override the automatically determined value.
Note: The Map returned by this method is not the same object as the HashMap used in calling this method. They are different instances of a Map<Integer,Messages> map. This is done to better facilitate detection of the before and after retirement state of suggestion list.
Observation_ID
- suggestionsToForce
- Get_Suggestions_To_Retire(String)
methods
with information about the retirement operation included in the Messages
objects.PIRL.Database.Database_Exception
- if an error occurs during the database update
processpublic java.util.Vector<java.lang.Integer> Get_Retired_Suggestions()
retire_suggestions(String)
method.public java.lang.String Get_Status_Messages()
public java.lang.String Get_Warning_Messages()
retire_suggestions(String)
has completed.public java.util.Vector<java.util.Vector<java.lang.String>> Stereo_Pair_Warnings(java.lang.String observation_id) throws PIRL.Database.Database_Exception
This method checks for pairs of stereo suggestions that have been retired by the same input observation id. For example, if suggestions 23 and 24 are a stereo pair and both of them were retired by observation PSP_123456_1234, then this stereo pair would be returned by this method.
Note: A stereo pair returned by this method does not necessarily indicate that the stereo pair was retired in error, it is only meant as a warning, and may indicate that some action should be taken givein additional information.
observation_id
- - An observation id to check for retired stereo pairs.PIRL.Database.Database_Exception
- if a problem with the database query this method runs occurs.public void Run_Geometry_Retirement(java.io.PrintWriter log) throws PIRL.Database.Database_Exception
log
- The printwriter to send the status messages to.PIRL.Database.Database_Exception
- if one of the database interactions failspublic boolean getStage2RetirementStatus(java.lang.String observationID) throws PIRL.Database.Database_Exception
PIRL.Database.Database_Exception
public static java.util.ArrayList<java.lang.Integer> parseSuggestionIds(java.lang.String id_list)
public static void main(java.lang.String[] arguments)
Usage
method.
Exit Status Values
0 - Success
1 - Command line syntax error
2 - No parent suggestion found
3 - Database Query Error
4 - Database Connect Error
5 - Undefined Observation ID
6 - Configuration Error
arguments
- Array of command line argumentspublic static void Usage(int exit_status)
Usage: Retire_Suggestions <Options> Options - [-All] [-Configuration <filename>] [-Force] [-Geometry] [-ID <Suggestion ID>] [-Log_file <log file name>] [-Reretirement_Test] [-Noop] [-Observation_ID <Observation ID>] [-Show (Same as Noop)] [-Help]
The command line retirement utility can be used as a batch retirement tool for non-interactive retirement, or as a means to query what suggestions might be retired by a given observation.
exit_status
- Copyright \ (C) Arizona Board of Regents on behalf of the \ Planetary Image Research Laboratory, Lunar and \ Planetary Laboratory at the University of Arizona