HiRISE

HiRISE.HiCat.Utilities
Class Cycle

java.lang.Object
  extended by HiRISE.HiCat.Utilities.Cycle

public class Cycle
extends Object

A class for working with cycle information. Essentially this class is just a structure for holding different pieces of information related to an MRO planning cycle. In addition, the utility has the ability to load cycle information from a state file or from the database given a cycle. And finally, the class has a method for "incrementing" from one cycle to the next based on the settings of the current cycle object. It should be noted that the incremented values are only estimates and should not be used in cases where it is critical for these values to be precise.

Note: The methods related to the use of state files have been deprecated. There is no longer a need to use the state file as a source of cycle information, this has been replaced with the use of the Cycle_Lister and Cycle_Editor classes.

Version:
1.8
Author:
Rodney Heyd UA/HIRISE/PIRL

Field Summary
static String DEFAULT_CIPP_VALUE
           
static int DEFAULT_CYCLE_ID
          Default values used when creating a new cycle object.
static double DEFAULT_END_LSUBS
           
static int DEFAULT_END_ORBIT
          Default values used when creating a new cycle object.
static double DEFAULT_END_TIME
           
static String DEFAULT_HITS_VALUE
           
static double DEFAULT_START_LSUBS
           
static int DEFAULT_START_ORBIT
          Default values used when creating a new cycle object.
static double DEFAULT_START_TIME
           
static int DEFAULT_STATE_FILE_VERSION
          Default values used when creating a new cycle object.
static String ID
          Class identifier
static String SPICE_TO_DB_TIME_FORMAT_STRING
          This is the format string passed to JSPICE to convert ephemeris time into a time format recognized by the database server.
 
Constructor Summary
Cycle()
          Create a new cycle object with default values.
Cycle(int cycle_id)
          Create a new cycle given a cycle id.
 
Method Summary
 String CIPP()
          Get the CIPP supporting this cycle.
 void CIPP(String cipp_id)
          Set the CIPP supporting this cycle.
 boolean Cycle_Data_Confirmed()
           
 void Cycle_Data_Confirmed(boolean confirmation)
           
 int Cycle_ID()
          Retrieve the cycle id of the cycle
 void Cycle_ID(int cycle_id)
          Sets the cycle id of the cycle object
 double End_LsubS()
          Retrieve the solar longitude (LS) at the end of the cycle.
 void End_LsubS(double lsubs)
          Set the solar longitude at the end of the cycle.
 int End_Orbit()
          Retrieve the ending orbit of the cycle
 void End_Orbit(int end_orbit)
          Set the ending orbit of the cycle.
 double End_Time()
          Deprecated.  
 void End_Time(double end_time)
          Deprecated.  
 String Ephem_Time_To_DB_Time(double ephemeris_time)
          Convert ephemeris time to a format suitable for ingestion into a database.
 Database Get_Database()
           
 String HiTS()
          Get the HiTS setting for this cycle.
 void HiTS(String hits_id)
          Set the HiTS for this cycle.
 Cycle Increment_Cycle()
          Increment the current cycle to the next successive cycle.
 boolean Is_Preliminary()
          Indicates if the cycle information is "preliminary." Essentially a cycle is considered preliminary if the state file has been designated preliminary or if the cycle information was derived from a previous cycle via the Increment_Cycle() method.
 void Load_Cycle_Data_From_Database(int cycle_id)
          Load information about a give a cycle from a database.
 void Load_Cycle_Data_From_State_File(String state_filename)
          Deprecated. There is no longer a need to work with state files in this class
 void Load_Data_From_State_File()
          Deprecated. All methods involving state files are deprecated since the Orbits table in the database now contains the information that would be retrieved from a state file.
 void Set_Database(Database database, String catalog)
           
 double Start_LsubS()
          Retrieve the solar longitude (LS) at the start of the cycle.
 void Start_LsubS(double lsubs)
          Set the solar longitude (LS) at the beginning of the cycle.
 int Start_Orbit()
          Retrieve the starting orbit of the cycle
 void Start_Orbit(int start_orbit)
          Set the starting orbit of the cycle
 Date Start_Time()
          Deprecated.  
 void Start_Time(double start_time)
          Deprecated.  
 int State_File_Version()
          Deprecated.  
 void State_File_Version(int version)
          Deprecated.  
 String State_File()
          Deprecated.  
 void State_File(String filename)
          Deprecated.  
 void Update_DB()
          Given a Database object and a catalog, this method with write the parameters for a cycle to a database containing a Cycle_map table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID

public static final String ID
Class identifier

See Also:
Constant Field Values

SPICE_TO_DB_TIME_FORMAT_STRING

public static final String SPICE_TO_DB_TIME_FORMAT_STRING
This is the format string passed to JSPICE to convert ephemeris time into a time format recognized by the database server.

See Also:
Constant Field Values

DEFAULT_CIPP_VALUE

public static final String DEFAULT_CIPP_VALUE
See Also:
Constant Field Values

DEFAULT_HITS_VALUE

public static final String DEFAULT_HITS_VALUE
See Also:
Constant Field Values

DEFAULT_CYCLE_ID

public static final int DEFAULT_CYCLE_ID
Default values used when creating a new cycle object.

See Also:
Constant Field Values

DEFAULT_START_ORBIT

public static final int DEFAULT_START_ORBIT
Default values used when creating a new cycle object.

See Also:
Constant Field Values

DEFAULT_END_ORBIT

public static final int DEFAULT_END_ORBIT
Default values used when creating a new cycle object.

See Also:
Constant Field Values

DEFAULT_STATE_FILE_VERSION

public static final int DEFAULT_STATE_FILE_VERSION
Default values used when creating a new cycle object.

See Also:
Constant Field Values

DEFAULT_START_TIME

public static final double DEFAULT_START_TIME
See Also:
Constant Field Values

DEFAULT_END_TIME

public static final double DEFAULT_END_TIME
See Also:
Constant Field Values

DEFAULT_START_LSUBS

public static final double DEFAULT_START_LSUBS
See Also:
Constant Field Values

DEFAULT_END_LSUBS

public static final double DEFAULT_END_LSUBS
See Also:
Constant Field Values
Constructor Detail

Cycle

public Cycle()
Create a new cycle object with default values. Eg. The cycle ID will be -1, the state file will be null, all times will be zero'd and LS ranges will be set to 999. See the default field values for more information.


Cycle

public Cycle(int cycle_id)
Create a new cycle given a cycle id. Note all cycle parameters will be default values unless a call is made to Load_Cycle_Data_From_Database(int) or Load_Cycle_Data_From_State_File(String), in which case the input cycle_id will be over-written by the load operation.

Parameters:
cycle_id -
Method Detail

Load_Data_From_State_File

public void Load_Data_From_State_File()
                               throws FileNotFoundException,
                                      Invalid_Argument_Exception,
                                      IOException,
                                      State_File.Validation_Exception
Deprecated. All methods involving state files are deprecated since the Orbits table in the database now contains the information that would be retrieved from a state file.

Load cycle information from the State_File set using the State_File(String) method.

Throws:
FileNotFoundException
Invalid_Argument_Exception
IOException
State_File.Validation_Exception
See Also:
Load_Cycle_Data_From_State_File(String state_filename)

Load_Cycle_Data_From_State_File

public void Load_Cycle_Data_From_State_File(String state_filename)
                                     throws FileNotFoundException,
                                            IOException,
                                            State_File.Validation_Exception
Deprecated. There is no longer a need to work with state files in this class

Load cycle information from the given state file. When this method is called, all cycle parameters will be overridden by the values found in the state file.

Parameters:
state_filename - - the state file containing the cycle information.
Throws:
FileNotFoundException - if the state file does not exist
IOException - if the state file can not be read
State_File.Validation_Exception - if the information in the state file can't be validated

Load_Cycle_Data_From_Database

public void Load_Cycle_Data_From_Database(int cycle_id)
                                   throws Database_Exception
Load information about a give a cycle from a database. All cycle parameters within the instance of the cycle object will be overriddin in favor of the values retrieved from the database when this method is called.

Parameters:
cycle_id - - the cycle number to retrieve information for.
Throws:
Database_Exception - - if a problem with retrieving database information occurs.
SPICE_Exception - - if a problem occurs doing any of the time conversions

Increment_Cycle

public Cycle Increment_Cycle()
Increment the current cycle to the next successive cycle. This method "predicts" the cycle parameters of the next cycle by incrementing the Cycle_ID() by one, and then extrapolating the ranges of the next cycle based on the ranges of the current cycle.

Returns:
a new cycle with parameters extrapolated from the current cycle.

Ephem_Time_To_DB_Time

public String Ephem_Time_To_DB_Time(double ephemeris_time)
Convert ephemeris time to a format suitable for ingestion into a database.

Parameters:
ephemeris_time - - the ephemeris time to convert
Returns:
- a date-time String of the format 'YYYY-MM-DD HH:MM:SS'

Update_DB

public void Update_DB()
               throws Database_Exception
Given a Database object and a catalog, this method with write the parameters for a cycle to a database containing a Cycle_map table.

Throws:
Database_Exception - - if an error occurrs trying to access the database.

Is_Preliminary

public boolean Is_Preliminary()
Indicates if the cycle information is "preliminary." Essentially a cycle is considered preliminary if the state file has been designated preliminary or if the cycle information was derived from a previous cycle via the Increment_Cycle() method.

Returns:
true if the cycle is prelimenary, false otherwise.

Cycle_ID

public int Cycle_ID()
Retrieve the cycle id of the cycle

Returns:
an integer number designating the cycle.

Cycle_ID

public void Cycle_ID(int cycle_id)
Sets the cycle id of the cycle object

Parameters:
cycle_id - - an integer

Start_Time

public Date Start_Time()
Deprecated. 

Retrieve the start time as an ephemeris time.

Returns:
the ephemeris time as a double

Start_Time

public void Start_Time(double start_time)
Deprecated. 

Set the starting ephemeris time of the cycle.

Parameters:
start_time - the value of the ephemeris time at the start of the cycle.

End_Time

public double End_Time()
Deprecated. 

Retrieve the End Time of the cycle in ephemeris time

Returns:
a double

End_Time

public void End_Time(double end_time)
Deprecated. 

Set the end time for the cycle in ephemeris time

Parameters:
end_time - the double value of the ephemeris time

Start_Orbit

public int Start_Orbit()
Retrieve the starting orbit of the cycle

Returns:
an integer representing the starting orbit number of the cycle

Start_Orbit

public void Start_Orbit(int start_orbit)
Set the starting orbit of the cycle

Parameters:
start_orbit - the integer value of the starting orbit

End_Orbit

public int End_Orbit()
Retrieve the ending orbit of the cycle

Returns:
an integer representing the ending orbit of the cycle.

End_Orbit

public void End_Orbit(int end_orbit)
Set the ending orbit of the cycle.

Parameters:
end_orbit - an integer value indicating the orbit the cycle ends on.

Start_LsubS

public double Start_LsubS()
Retrieve the solar longitude (LS) at the start of the cycle.

Returns:
the solar longitude as a double precision value

Start_LsubS

public void Start_LsubS(double lsubs)
Set the solar longitude (LS) at the beginning of the cycle.

Parameters:
lsubs - the solar longitude should be a double precision value

End_LsubS

public double End_LsubS()
Retrieve the solar longitude (LS) at the end of the cycle.

Returns:
the solar longitude as a double precision value

End_LsubS

public void End_LsubS(double lsubs)
Set the solar longitude at the end of the cycle.

Parameters:
lsubs - the solar longitude should be a double precision number

State_File

public String State_File()
Deprecated. 

Retrieve the name of the state file (including the full path to the file on the local file system) from which the cycle information was derived. The state file may be null if the cycle information was not derived from a state file, (eg. the parameters for a cycle were extrapolated from another cycle, see the Increment_Cycle() method).

Returns:
the state file name or null if the cycle information was not derived from a state file.

State_File

public void State_File(String filename)
Deprecated. 

Set the state file from which the information was derived. The string should contain the full path to the file on the local file system.

Parameters:
filename - the state file, including the full path on the file system.

State_File_Version

public int State_File_Version()
Deprecated. 

Get the version of the state file. Note: this version may not be as useful as it seems, as the versions are incremented in a rather adhoc fashion, and may even be reset for different weeks within the same cycle. As a result, the highest versioned state file for a cycle may not necessarily be the latest and most accurate version.

Returns:
the integer version of the state file.

State_File_Version

public void State_File_Version(int version)
Deprecated. 

Set the version of the state file. This version can be found in the name of the state file.

Parameters:
version -

HiTS

public void HiTS(String hits_id)
Set the HiTS for this cycle.

Parameters:
hits_id - - An identifier of the HiTS supporting this cycle.

HiTS

public String HiTS()
Get the HiTS setting for this cycle.

Returns:
Get the identifier of the HiTS supporting this cycle.

CIPP

public void CIPP(String cipp_id)
Set the CIPP supporting this cycle.

Parameters:
cipp_id - - An identifier of the CIPP supporting this cycle.

CIPP

public String CIPP()
Get the CIPP supporting this cycle.

Returns:
A string identifying the CIPP for this cycle.

Cycle_Data_Confirmed

public boolean Cycle_Data_Confirmed()

Cycle_Data_Confirmed

public void Cycle_Data_Confirmed(boolean confirmation)

Set_Database

public void Set_Database(Database database,
                         String catalog)

Get_Database

public Database Get_Database()

HiRISE

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