HiRISE

HiRISE.libHiRISE
Class CCD_ID

java.lang.Object
  extended by HiRISE.libHiRISE.Observation_ID
      extended by HiRISE.libHiRISE.CCD_ID
Direct Known Subclasses:
Channel_ID

public class CCD_ID
extends Observation_ID

CCD_ID encapsulates the HiRISE CCD identification code.

Formally, a CCD ID consists of the text representation of a HiRISE observation ID followed by an underscore mark ("_") and a four-character code identifying the CCD. This code, the CCD name, is defined in Instrument.CCD_NAMES[] and must match one of those 14 names. The names are indexed according to their CPMM (CCD Processing and Memory Module) number.

Version:
2.2
Author:
Michael Wendell, UA/PIRL
See Also:
Observation_ID, Instrument

Field Summary
static int DEFAULT_CPMM_NUMBER
           
static String ID
          Class identification name with source code version and date.
 
Fields inherited from class HiRISE.libHiRISE.Observation_ID
AEROBRAKING, APPROACH, ATLO, CALIBRATION, CPMM_AND_CHANNEL_PATTERN, CRUISE, DEFAULT_INORBIT_PHASE, DEFAULT_MISSION_PHASE, DEFAULT_OBSERVATION_ID, DEFAULT_ORBIT_NUMBER, DEFAULT_PREORBIT_PHASE, DEFAULT_TARGET, DEFAULT_TIME, DEFAULT_TIME_TEXT_FORMAT, DELIMITER_PATTERN, EPOCH, EXTENDED_SCIENCE_PHASE, EXTENSION_DELIMITER, EXTENSION_PATTERN, GAP_INDICATOR_PATTERN, INORBIT_MISSION_PHASE_GROUP, INORBIT_ORBIT_NUMBER_GROUP, INORBIT_PREFIX_GROUP, INORBIT_SUFFIX_GROUP, INORBIT_TARGET_GROUP, INSTRUMENT_ID_PATTERN, INTEGRATION_AND_TESTING, INVALID_OBSERVATION_ID, JPL_TIME_TEXT_FORMAT, KENNEDY_SPACE_CENTER, LAST_PREORBIT_PHASE, LAUNCH, MISSION_PHASE_ABBREVIATION, MISSION_PHASE_BIT_COUNT, MISSION_PHASE_MASK, MISSION_PHASE_MAX, MISSION_PHASE_MAX_ORBIT, MISSION_PHASE_MAX_TIME, MISSION_PHASE_NAME, MISSION_PHASE_PATTERN, MISSION_PHASE_START, OBSERVATION_ID_PATTERN, OPTIONAL_DELIMITER_PATTERN, ORBIT_NUMBER_BIT_COUNT, ORBIT_NUMBER_MASK, ORBIT_NUMBER_MAX, ORBIT_NUMBER_MIN, ORBIT_NUMBER_PATTERN, ORBIT_NUMBER_START, PDS_TIME_TEXT_FORMAT, PREFIX_PATTERN, PREORBIT_MISSION_PHASE_GROUP, PREORBIT_PREFIX_GROUP, PREORBIT_SUFFIX_GROUP, PREORBIT_TIME_GROUP, PRIMARY_SCIENCE_PHASE, RELAY, REQUIRED_DELIMITER_PATTERN, RESERVED_1, RESERVED_10, RESERVED_11, RESERVED_12, RESERVED_13, RESERVED_14, RESERVED_15, RESERVED_16, RESERVED_17, RESERVED_18, RESERVED_19, RESERVED_2, RESERVED_3, RESERVED_4, RESERVED_5, RESERVED_6, RESERVED_7, RESERVED_8, RESERVED_9, RSDS_OPS_CPMM_AND_CHANNEL_GROUP, RSDS_OPS_EXTENSION_GROUP, RSDS_OPS_GAP_GROUP, RSDS_OPS_INSTRUMENT_ID_GROUP, RSDS_OPS_OBSERVATION_ID_GROUP, RSDS_OPS_SPACECRAFT_ID_GROUP, RSDS_OPS_VERSION_GROUP, RSDS_TEST_CPMM_AND_CHANNEL_GROUP, RSDS_TEST_EXTENSION_GROUP, RSDS_TEST_GAP_GROUP, RSDS_TEST_ID_GROUP, RSDS_TEST_INSTRUMENT_ID_GROUP, RSDS_TEST_OBSERVATION_ID_GROUP, RSDS_TEST_SPACECRAFT_ID_GROUP, RSDS_TEST_VERSION_GROUP, RSDS_TIME_TEXT_FORMAT, SPACECRAFT_ID_PATTERN, SUFFIX_PATTERN, SVT, TARGET_BIT_COUNT, TARGET_MASK, TARGET_MAX, TARGET_PATTERN, TARGET_START, TEST_ID_PATTERN, TEXT_DELIMITER, TIME_BIT_COUNT, TIME_MASK, TIME_MAX, TIME_PATTERN, TIME_START, TOTAL_MISSION_PHASES, TRANSITION, VERSION_PATTERN
 
Constructor Summary
CCD_ID()
          Creates a default CCD_ID with the Observation_ID.DEFAULT_OBSERVATION_ID and DEFAULT_CPMM_NUMBER values.
CCD_ID(int observation_id_value, int cpmm_value)
          Creates a CCD_ID with the specified Observation_ID and CPMM number.
CCD_ID(int mission_phase_value, int time_value, int cpmm_value)
          Creates a pre-orbit CCD_ID from the specified pre-orbit mission phase, pre-orbit time component, and CPMM number.
CCD_ID(int mission_phase_value, int orbit_number_value, int target_value, int cpmm_value)
          Creates an in-orbit CCD_ID from the specified in-orbit mission phase, orbit number, target component, and CPMM number.
CCD_ID(String id_text)
          Creates a CCD_ID from a string.
 
Method Summary
 String ccd_name()
          Returns the CCD name corresponding to the CPMM number of this CCD_ID object.
 CCD_ID ccd_name(String ccd_text)
          Sets the CPMM number for this CCD_ID object based on a text string.
 CCD_ID ccd_name(String ccd_text, boolean use_defaults)
          Sets the CPMM number for this CCD_ID object based on a text string.
 int cpmm_number()
          Returns the CPMM number for this CCD_ID object.
 CCD_ID cpmm_number(int cpmm_value)
          Sets the CPMM number for this CCD_ID object.
 CCD_ID cpmm_number(String cpmm_text)
          Sets the CPMM number for this CCD_ID object based on a text string.
 CCD_ID cpmm_number(String cpmm_text, boolean use_defaults)
          Sets the CPMM number for this CCD_ID object based on a text string.
 String parse(String the_text)
          Sets the value of this CCD_ID using a text representation.
 String parse(String the_text, boolean use_defaults)
          Parses a string to obtain a value for the CPMM number.
 String text()
          Returns the text representation of the CCD_ID.
 CCD_ID text(String the_text)
          Sets the value of this CCD_ID using a text representation.
 CCD_ID text(String id_text, boolean use_defaults)
          Sets the value of this CCD_ID using a text representation.
 String toString()
          Produces the text representation of this CCD_ID.
 
Methods inherited from class HiRISE.libHiRISE.Observation_ID
extract_mission_phase, extract_mission_phase, extract_orbit_number, extract_orbit_number, extract_target, extract_target, extract_time, extract_time, hex_value, hex_value, is_preorbit, mission_phase_from_orbit_number, mission_phase_from_time, mission_phase, mission_phase, mission_phase, mission_phase, orbit_number, orbit_number, orbit_number, orbit_number, target, target, target, target, time_now, time_text_format, time_text_format, time_text, time_text, time, time, time, time, time, time, value, value, value, value, zero_pad_binary, zero_pad_hex, zero_pad_number, zero_pad_number
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ID

public static final String ID
Class identification name with source code version and date.

See Also:
Constant Field Values

DEFAULT_CPMM_NUMBER

public static final int DEFAULT_CPMM_NUMBER
See Also:
Constant Field Values
Constructor Detail

CCD_ID

public CCD_ID()
Creates a default CCD_ID with the Observation_ID.DEFAULT_OBSERVATION_ID and DEFAULT_CPMM_NUMBER values.


CCD_ID

public CCD_ID(int observation_id_value,
              int cpmm_value)
Creates a CCD_ID with the specified Observation_ID and CPMM number. If cpmm_value is not less than Instrument.CCDS, or if it is equal to Instrument.CCD_UNKNOWN, then DEFAULT_CPMM_NUMBER will be used instead.

Parameters:
observation_id_value - The initial numeric value of the Observation_ID.
cpmm_value - The initial value for the CPMM number.

CCD_ID

public CCD_ID(int mission_phase_value,
              int time_value,
              int cpmm_value)
Creates a pre-orbit CCD_ID from the specified pre-orbit mission phase, pre-orbit time component, and CPMM number. If mission_phase_value is not a pre-orbit mission phase, then Observation_ID.DEFAULT_PREORBIT_PHASE will be used. If time_value is greater than Observation_ID.TIME_MAX, Observation_ID.DEFAULT_TIME will be used. If time_value is negative, however, then the current system clock time will be used to set the pre-orbit time component. Finally, if cpmm_value is not less than Instrument.CCDS, or if it is not equal to Instrument.CCD_UNKNOWN, then DEFAULT_CPMM_NUMBER will be used instead.

Parameters:
mission_phase_value - The pre-orbit mission phase.
time_value - The value for the pre-orbit time component. If it is negative, the current system clock time will be used instead.
cpmm_value - The initial value for the CPMM number.

CCD_ID

public CCD_ID(int mission_phase_value,
              int orbit_number_value,
              int target_value,
              int cpmm_value)
Creates an in-orbit CCD_ID from the specified in-orbit mission phase, orbit number, target component, and CPMM number. If mission_phase_value is not an in-orbit mission phase, then Observation_ID.DEFAULT_INORBIT_PHASE will be used. If orbit_number_value is greater than Observation_ID.ORBIT_NUMBER_MAX, then Observation_ID.DEFAULT_ORBIT_NUMBER will be used. If target_value is greater than Observation_ID.TARGET_MAX, then Observation_ID.DEFAULT_TARGET will be used. Finally, if cpmm_value is not less than Instrument.CCDS, or if it is not equal to Instrument.CCD_UNKNOWN, then DEFAULT_CPMM_NUMBER will be used instead.

Parameters:
mission_phase_value - The in-orbit mission phase.
orbit_number_value - The value for the orbit number component.
target_value - The value for the target component.
cpmm_value - The initial value for the CPMM number.

CCD_ID

public CCD_ID(String id_text)
Creates a CCD_ID from a string. If a valid CPMM number cannot be parsed from the string, then Instrument.CCD_UNKNOWN will be used. If a valid observation ID component cannot be parsed from the string, Observation_ID.INVALID_OBSERVATION_ID will be used.

Parameters:
id_text - A string that contains a text representation of the CCD_ID.
See Also:
text(String)
Method Detail

cpmm_number

public int cpmm_number()
Returns the CPMM number for this CCD_ID object. A value of Instrument.CCD_UNKNOWN indicates the CPMM number is not known for this CCD_ID. Note that CPMM number is not the same as CCD number, the latter of which is also called a "DCA (detector chip array) number." The CPMM number may be used as an index into the Instrument.CCD_NAMES array to obtain the corresponding CCD name for the CPMM number. There is currently no mechanism in place to map CPMM number to CCD/DCA number, however.

Returns:
The CPMM number for this CCD_ID object.

cpmm_number

public CCD_ID cpmm_number(int cpmm_value)
                   throws Out_of_Range_Exception
Sets the CPMM number for this CCD_ID object. If cpmm_value is greater than or equal to Instrument.CCDS, the CPMM number will be set to DEFAULT_CPMM_NUMBER and an Out_of_Range_Exception will be thrown, unless it is set to Instrument.CCD_UNKNOWN, which indicates that the CPMM number is not known.

Parameters:
cpmm_value - The value for the CPMM number for this CCD_ID object.
Returns:
A reference back to this CCD_ID.
Throws:
Out_of_Range - If cpmm_value is greater than or equal to Instrument.CCDS. The CPMM number will be set to DEFAULT_CPMM_NUMBER in this case.
Out_of_Range_Exception

cpmm_number

public CCD_ID cpmm_number(String cpmm_text,
                          boolean use_defaults)
                   throws Invalid_Argument_Exception,
                          Out_of_Range_Exception
Sets the CPMM number for this CCD_ID object based on a text string. The string can contain either the text form of the CPMM number or a valid CCD name from which the CPMM number can be derived. If a CPMM number cannot be derived from the string, the CPMM number will be set to Instrument.CCD_UNKNOWN and an Invalid_Argument_Exception will be thrown. If a value greater than or equal to Instrument.CCDS is derived, the CPMM number will be set to DEFAULT_CPMM_NUMBER and an Out_of_Range_Exception will be thrown. If use_defaults is true the DEFAULT_CPMM_NUMBER will be used instead.

Parameters:
cpmm_text - The text representation of the CPMM number or the corresponding CCD name.
use_defaults - If true, DEFAULT_CPMM_NUMBER will be used if the CPMM number cannot be parsed or if the parsed value is out of range; otherwise, an Invalid_Argument_Exception or Out_of_Range_Exception will be thrown.
Returns:
A reference back to this CCD_ID.
Throws:
Invalid_Argument_Exception - If cpmm_text cannot be parsed for a valid CPMM number. The CPMM number will be set to Instrument.CCD_UNKNOWN in this case.
Out_of_Range_Exception - If cpmm_text indicates a value greater than or equal to Instrument.CCDS. The CPMM number will be set to DEFAULT_CPMM_NUMBER in this case.

cpmm_number

public CCD_ID cpmm_number(String cpmm_text)
Sets the CPMM number for this CCD_ID object based on a text string. The string can contain either the text form of the CPMM number or a valid CCD name from which the CPMM number can be derived. If a CPMM number cannot be derived from the string, or if a value greater than or equal to Instrument.CCDS is derived, the CPMM number will be set to DEFAULT_CPMM_NUMBER. This method calls cpmm_number(String,boolean) with use_defaults set to true.

Parameters:
cpmm_text - The text representation of the CPMM number or the corresponding CCD name.
Returns:
A reference back to this CCD_ID.

ccd_name

public String ccd_name()
Returns the CCD name corresponding to the CPMM number of this CCD_ID object. If the CPMM number is unknown then Instrument.CCD_UNKNOWN is returned instead, as a string.

Returns:
The CCD name for this CCD_ID or Instrument.CCD_UNKNOWN.

ccd_name

public CCD_ID ccd_name(String ccd_text,
                       boolean use_defaults)
                throws Invalid_Argument_Exception,
                       Out_of_Range_Exception
Sets the CPMM number for this CCD_ID object based on a text string. This method simply calls cpmm_number(String,boolean).

Parameters:
ccd_text - The text representation of the CPMM number or the corresponding CCD name.
use_defaults - If true, DEFAULT_CPMM_NUMBER will be used if the CPMM number cannot be parsed or if the parsed value is out of range; otherwise, an Invalid_Argument_Exception or Out_of_Range_Exception will be thrown.
Returns:
A reference back to this CCD_ID.
Throws:
Invalid_Argument_Exception - If cpmm_text cannot be parsed for a valid CPMM number. The CPMM number will be set to Instrument.CCD_UNKNOWN in this case.
Out_of_Range_Exception - If cpmm_text indicates a value greater than or equal to Instrument.CCDS. The CPMM number will be set to DEFAULT_CPMM_NUMBER in this case.
See Also:
cpmm_number(String,boolean)

ccd_name

public CCD_ID ccd_name(String ccd_text)
Sets the CPMM number for this CCD_ID object based on a text string. This method calls ccd_name(String,boolean) with use_defaults set to true.

Parameters:
ccd_text - The text representation of the CPMM number or the corresponding CCD name.
Returns:
A reference back to this CCD_ID.
See Also:
ccd_name(String,boolean)

text

public String text()
Returns the text representation of the CCD_ID. The text representation consists of the text representation of its observation ID followed by the CCD name that corresponds to its CPMM number. If the CPMM number is unknown InstrumentCCD_UNKNOWN}, then Instrument.CCD_UNKNOWN replaces the CCD name in the text representation. Regardless, the CCD name and the observation ID text are separated by an underscore ("_") delimiter.

Overrides:
text in class Observation_ID
Returns:
The text representation of the CCD_ID.

text

public CCD_ID text(String id_text,
                   boolean use_defaults)
            throws Invalid_Argument_Exception,
                   Out_of_Range_Exception
Sets the value of this CCD_ID using a text representation. If the id_text cannot be parsed for a valid CCD ID, an Invalid_Argument_Exception is thrown. If use_defaults is true, appropriate default values will be used as needed instead.

Overrides:
text in class Observation_ID
Parameters:
id_text - The text to be parsed to obtain the value.
use_defaults - If true, default values for the various components of a CCD_ID will be used when they cannot be determined from the id_text. If false, an Invalid_Argument_Exception will be thrown instead.
Returns:
A reference back to this CCD_ID.
Throws:
Invalid_Argument_Exception - If a CCD ID cannot be parsed from the_text and use_defaults is false.
Out_of_Range_Exception - If a one of the parsed values is out of range and use_defaults is false.
See Also:
parse(String)

text

public CCD_ID text(String the_text)
Sets the value of this CCD_ID using a text representation. If the_text cannot be parsed for a valid CCD ID, appropriate default values will be used as needed instead. This method calls parse(String,boolean) with use_defaults set to true.

Overrides:
text in class Observation_ID
Parameters:
the_text - The text from which to parse a CCD ID.
Returns:
A reference to this CCD_ID.
See Also:
parse(String,boolean)

parse

public String parse(String the_text,
                    boolean use_defaults)
             throws Invalid_Argument_Exception,
                    Out_of_Range_Exception
Parses a string to obtain a value for the CPMM number.

Overrides:
parse in class Observation_ID
Parameters:
the_text - The text to be parsed.
use_defaults - If true, default values for the various components of a CCD_ID will be used when they cannot be determined from the_text. If false, an Invalid_Argument_Exception will be thrown instead.
Returns:
This text used to set the value. This will be empty if no valid text was found.
Throws:
Invalid_Argument_Exception - If a CCD ID cannot be parsed from the_text and use_defaults is false.
Out_of_Range_Exception - If a one of the parsed values is out of range and use_defaults is false.
See Also:
cpmm_number()

parse

public String parse(String the_text)
Sets the value of this CCD_ID using a text representation. If the_text cannot be parsed for a valid observation ID, appropriate default values will be used as needed instead. This method calls parse(String,boolean) with use_defaults set to true.

This method returns the text that was not used in the interpretation of an observation ID. Subclasses of Observation_ID can use this returned text to parse additional information.

Overrides:
parse in class Observation_ID
Parameters:
the_text - The text from which to parse an observation ID.
Returns:
Text not used in the interpretation of an observation ID.
See Also:
text(String, boolean)

toString

public String toString()
Produces the text representation of this CCD_ID.

Overrides:
toString in class Observation_ID
Returns:
the text representation of this CCD_ID.
See Also:
text()

HiRISE

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