HiRISE

HiRISE.libHiRISE
Class Channel_ID

java.lang.Object
  extended by HiRISE.libHiRISE.Observation_ID
      extended by HiRISE.libHiRISE.CCD_ID
          extended by HiRISE.libHiRISE.Channel_ID

public class Channel_ID
extends CCD_ID

Channel_ID encapsulates the HiRISE channel identification code. Each HiRISE CCD has two data channels. During image readout from the CCD into solid-state storage, each channel is read out separately. Formally, a channel ID consists of a CCD ID followed by an underscore mark ("_") and a single digit, 0 or 1, identifying the particular channel of the CCD identified by the CCD ID.

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

Field Summary
static int DEFAULT_CHANNEL_NUMBER
           
static String ID
          Class identification name with source code version and date.
 
Fields inherited from class HiRISE.libHiRISE.CCD_ID
DEFAULT_CPMM_NUMBER
 
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
Channel_ID()
          Creates a default CCD_ID with the Observation_ID.DEFAULT_OBSERVATION_ID, CCD_ID.DEFAULT_CPMM_NUMBER and DEFAULT_CHANNEL_NUMBER values.
Channel_ID(int observation_id_value, int cpmm_value, int channel_value)
          Creates a Channel_ID with the specified Observation_ID, CPMM number, and channel number.
Channel_ID(int mission_phase_value, int time_value, int cpmm_value, int channel_value)
          Creates a pre-orbit Channel_ID with the specified pre-orbit mission phase, pre-orbit time component, CPMM number, and channel number.
Channel_ID(int mission_phase_value, int orbit_number_value, int target_value, int cpmm_value, int channel_value)
          Creates an in-orbit Channel_ID with the specified in-orbit mission phase, orbit number, target component, CPMM number, and channel number.
Channel_ID(String id_text)
          Creates a Channel_ID from a string.
 
Method Summary
 String channel_name()
          Returns the text version of the channel number of this Channel_ID object.
 Channel_ID channel_name(String channel_text)
          Sets the channel number for this Channel_ID object based on a text string.
 Channel_ID channel_name(String channel_text, boolean use_defaults)
          Sets the channel number for this Channel_ID object based on a text string.
 int channel_number()
          Returns the channel number for this Channel_ID object.
 Channel_ID channel_number(int channel_value)
          Sets the channel number for this Channel_ID object.
 Channel_ID channel_number(String channel_text)
          Sets the channel number for this Channel_ID object based on a text string.
 Channel_ID channel_number(String channel_text, boolean use_defaults)
          Sets the channel number for this Channel_ID object based on a text string.
 String parse(String the_text)
          Sets the value of this Channel_ID using a text representation.
 String parse(String the_text, boolean use_defaults)
          Parses a string to obtain a value for the channel number.
 String text()
          Returns the text representation of this Channel_ID.
 Channel_ID text(String id_text)
          Sets the value of this Channel_ID using a text representation.
 Channel_ID text(String id_text, boolean use_defaults)
          Sets the value of this Channel_ID using a text representation.
 String toString()
          Produces the text representation of this Channel_ID.
 
Methods inherited from class HiRISE.libHiRISE.CCD_ID
ccd_name, ccd_name, ccd_name, cpmm_number, cpmm_number, cpmm_number, cpmm_number
 
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_CHANNEL_NUMBER

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

Channel_ID

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


Channel_ID

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

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

Channel_ID

public Channel_ID(int mission_phase_value,
                  int time_value,
                  int cpmm_value,
                  int channel_value)
Creates a pre-orbit Channel_ID with the specified pre-orbit mission phase, pre-orbit time component, CPMM number, and channel 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. If cpmm_value is not less than Instrument.CCDS, or if it is not equal to Instrument.CCD_UNKNOWN, then CCD_ID.DEFAULT_CPMM_NUMBER will be used instead. Finally, if channel_value is not less than Instrument.CCD_CHANNELS, or if it is not equal to Instrument.CCD_CHANNEL_UNKNOWN, then DEFAULT_CHANNEL_NUMBER will be used.

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.
channel_value - The initial value for the channel number.

Channel_ID

public Channel_ID(int mission_phase_value,
                  int orbit_number_value,
                  int target_value,
                  int cpmm_value,
                  int channel_value)
Creates an in-orbit Channel_ID with the specified in-orbit mission phase, orbit number, target component, CPMM number, and channel 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. If cpmm_value is not less than Instrument.CCDS, or if it is not equal to Instrument.CCD_UNKNOWN, then CCD_ID.DEFAULT_CPMM_NUMBER will be used instead. Finally, if channel_value is not less than Instrument.CCD_CHANNELS, or if it is not equal to Instrument.CCD_CHANNEL_UNKNOWN, then DEFAULT_CHANNEL_NUMBER will be used.

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.
channel_value - The initial value for the channel number.

Channel_ID

public Channel_ID(String id_text)
Creates a Channel_ID from a string. If a valid channel number cannot be parsed from the string, then Instrument.CCD_CHANNEL_UNKNOWN will be used. 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 Channel_ID.
See Also:
text(String)
Method Detail

channel_number

public int channel_number()
Returns the channel number for this Channel_ID object. A value of Instrument.CCD_CHANNEL_UNKNOWN indiciates the channel number is not know for this Channel_ID.

Returns:
The channel number for this Channel_ID.

channel_number

public Channel_ID channel_number(int channel_value)
                          throws Out_of_Range_Exception
Sets the channel number for this Channel_ID object. If channel_value is greater than or equal to Instrument.CCD_CHANNELS, the channel number will be set to DEFAULT_CHANNEL_NUMBER and an Out_of_Range_Exception will be thrown, unless it is set to Instrument.CCD_CHANNEL_UNKNOWN, which indicates that channel number is not known.

Parameters:
channel_value - The value for the channel number for this Channel_ID object.
Returns:
A reference back to this Channel_ID.
Throws:
Out_of_Range_Exception - If channel_value is greater than or equal to Instrument.CCD_CHANNELS. The channel number will be set to

channel_number

public Channel_ID channel_number(String channel_text,
                                 boolean use_defaults)
                          throws Invalid_Argument_Exception,
                                 Out_of_Range_Exception
Sets the channel number for this Channel_ID object based on a text string. If a channel number cannot be derived from the string, the channel number will be set to Instrument.CCD_CHANNEL_UNKNOWN and an Invalid_Argument_Exception will be thrown. If a value greater than or equal to Instrument.CCD_CHANNELS is derived, the channel number will be set to DEFAULT_CHANNEL_NUMBER and an Out_of_Range_Exception will be thrown. If use_defaults is true the DEFAULT_CHANNEL_NUMBER will be used instead.

Parameters:
channel_text - The text representation of the channel number.
use_defaults - If true, DEFAULT_CHANNEL_NUMBER will be used if the channel 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 Channel_ID.
Throws:
Invalid_Argument_Exception - If channel_text cannot be parsed for a valid channel number. The channel number will be set to Instrument.CCD_CHANNEL_UNKNOWN in this case.
Out_of_Range_Exception - If channel_text indicates a value greater than or equal to Instrument.CCD_CHANNELS. The channel number will be set to DEFAULT_CHANNEL_NUMBER in this case.

channel_number

public Channel_ID channel_number(String channel_text)
Sets the channel number for this Channel_ID object based on a text string. If a channel number cannot be derived from the string or if a value greater than or equal to Instrument.CCD_CHANNELS is derived, the channel number will be set to DEFAULT_CHANNEL_NUMBER. This method calls channel_number(String,boolean) with use_defaults set to true.

Parameters:
channel_text - The text representation of the Channel number.
Returns:
A reference back to this Channel_ID.

channel_name

public String channel_name()
Returns the text version of the channel number of this Channel_ID object. If the channel number is unknown, Instrument.CCD_CHANNEL_UNKNOWN is returned instead, as a string.

Returns:
The channel text for this Channel_ID or Instrument.CCD_CHANNEL_UNKNOWN.

channel_name

public Channel_ID channel_name(String channel_text,
                               boolean use_defaults)
                        throws Invalid_Argument_Exception,
                               Out_of_Range_Exception
Sets the channel number for this Channel_ID object based on a text string. This method simply calls channel_number(String,boolean).

Parameters:
channel_text - The text representation of the channel number.
use_defaults - If true, DEFAULT_CHANNEL_NUMBER will be used if the channel 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 Channel_ID.
Throws:
Invalid_Argument_Exception - If channel_text cannot be parsed for a valid channel number. The channel number will be set to Instrument.CCD_CHANNEL_UNKNOWN in this case.
Out_of_Range_Exception - If channel_text indicates a value greater than or equal to Instrument.CCD_CHANNELS. The channel number will be set to DEFAULT_CHANNEL_NUMBER in this case.
See Also:
channel_number(String)

channel_name

public Channel_ID channel_name(String channel_text)
Sets the channel number for this Channel_ID object based on a text string. This method calls channel_name(String,boolean) with use_defaults set to true.

Parameters:
channel_text - The text representation of the channel number.
Returns:
A reference back to this Channel_ID.
See Also:
channel_name(String,boolean)

text

public String text()
Returns the text representation of this Channel_ID. The text representation consists of the text representation of its CCD_ID followed by the channel text that corresponds to its channel number. If the channel number is unknown Instrument.CCD_CHANNEL_UNKNOWN, then Instrument.CCD_CHANNEL_UNKNOWN replaces the channel text in the text representation. Regardless, the name, CCD_ID and Channel_ID are separated by an underscore ("_") delimiter.

Overrides:
text in class CCD_ID
Returns:
The text representation of this Channel_ID.

text

public Channel_ID text(String id_text,
                       boolean use_defaults)
                throws Invalid_Argument_Exception,
                       Out_of_Range_Exception
Sets the value of this Channel_ID using a text representation. If the id_text cannot be parsed for a valid channel 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 CCD_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 Channel_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 Channel_ID.
Throws:
Invalid_Argument_Exception - If a Channel 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 Channel_ID text(String id_text)
Sets the value of this Channel_ID using a text representation. If the_text cannot be parsed for a valid Channel 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 CCD_ID
Parameters:
id_text - The text to be parsed to obtain the value.
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 channel number.

Overrides:
parse in class CCD_ID
Parameters:
the_text - The text to be parsed.
use_defaults - If true, default values for the various components of a Channel_ID will be used when they cannot be determined from the 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:
channel_number()

parse

public String parse(String the_text)
Sets the value of this Channel_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 CCD_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 Channel_ID.

Overrides:
toString in class CCD_ID
Returns:
the text representation of this Channel_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