libHiRISE
|
Channel_ID encapsulates the HiRISE channel identification code. More...
#include <Channel_ID.hh>
Public Member Functions | |
Channel_ID (const u_int_32 observation_id_value=DEFAULT_OBSERVATION_ID, const unsigned int cpmm_value=DEFAULT_CPMM_NUMBER, const unsigned int channel_value=DEFAULT_CHANNEL_NUMBER) | |
Creates a Channel_ID from a numeric representation of its Observation_ID, its CPMM number, and its channel number. | |
Channel_ID (const Mission_Phase mission_phase_value, const int time_value=-1, const unsigned int cpmm_value=DEFAULT_CPMM_NUMBER, const unsigned int channel_value=DEFAULT_CHANNEL_NUMBER) | |
Creates a pre-orbit Channel_ID from a pre-orbit mission phase, an integer value for the pre-orbit time component, a CPMM number, and a channel number. | |
Channel_ID (const Mission_Phase mission_phase_value, const unsigned int orbit_number_value, const unsigned int target_value, const unsigned int cpmm_value=DEFAULT_CPMM_NUMBER, const unsigned int channel_value=DEFAULT_CHANNEL_NUMBER) | |
Creates an in-orbit Channel_ID from an in-orbit mission phase, an orbit number value, a targe component value, a CPMM number, and a channel number. | |
Channel_ID (const std::string &id_text) | |
Creates a Channel_ID from a string. | |
unsigned int | channel_number () const |
Returns the channel number for this Channel_ID number. | |
Channel_ID & | channel_number (const unsigned int channel_value) throw (Out_of_Range) |
Sets the channel number for this Channel_ID object. | |
Channel_ID & | channel_number (const std::string &channel_text) throw (Invalid_Argument, Out_of_Range) |
Sets the channel number for this Channel_ID object based on a text string. | |
std::string | channel_name () const |
Returns the text version of the channel number of this Channel_ID object. | |
Channel_ID & | channel_name (const std::string &channel_text) throw (Invalid_Argument, Out_of_Range) |
Sets the channel number for this Channel_ID object based on a text string. | |
std::string | text () const |
Returns the text representation of this Channel_ID. | |
Channel_ID & | text (const std::string &id_text) throw (Invalid_Argument, Out_of_Range) |
Sets the object value from a text representation. | |
std::string | parse (const std::string &id_text) |
Parses a string to obtain a value for the channel number. | |
std::ostream & | print (std::ostream &stream=std::cout) const |
Prints the Channel_ID's text representation to an output stream. | |
Static Public Attributes | |
static const char * | ID = "UA::HiRISE::Channel_ID (2.6 2020/05/21 17:36:23)" |
Class identification name with source code version and date. | |
static const unsigned int | DEFAULT_CHANNEL_NUMBER = 0 |
Default channel number. |
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.
Channel_ID | ( | const u_int_32 | observation_id_value = DEFAULT_OBSERVATION_ID , |
const unsigned int | cpmm_value = DEFAULT_CPMM_NUMBER , |
||
const unsigned int | channel_value = DEFAULT_CHANNEL_NUMBER |
||
) |
Creates a Channel_ID from a numeric representation of its Observation_ID, its CPMM number, and its channel number.
This constructor is guaranteed not to throw an exception. 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 Channel_ID::DEFAULT_CHANNEL_NUMBER will be used.
observation_id_value | The initial numeric value of the Observation_ID. Default: Observation_ID::DEFAULT_OBSERVATION_ID. |
cpmm_value | The initial value for the CPMM number. Default: CCD_ID::DEFAULT_CPMM_NUMBER. |
channel_value | The initial value for the channel number. Default: Channel_ID::DEFAULT_CHANNEL_NUMBER. |
Channel_ID | ( | const Mission_Phase | mission_phase_value, |
const int | time_value = -1 , |
||
const unsigned int | cpmm_value = DEFAULT_CPMM_NUMBER , |
||
const unsigned int | channel_value = DEFAULT_CHANNEL_NUMBER |
||
) |
Creates a pre-orbit Channel_ID from a pre-orbit mission phase, an integer value for the pre-orbit time component, a CPMM number, and a channel number.
This constructor is guaranteed not to throw an exception. 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 Channel_ID::DEFAULT_CHANNEL_NUMBER will be used.
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. Default: -1. |
cpmm_value | The initial value for the CPMM number. Default: CCD_ID::DEFAULT_CPMM_NUMBER. |
channel_value | The initial value for the channel number. Default: Channel_ID::DEFAULT_CHANNEL_NUMBER. |
Channel_ID | ( | const Mission_Phase | mission_phase_value, |
const unsigned int | orbit_number_value, | ||
const unsigned int | target_value, | ||
const unsigned int | cpmm_value = DEFAULT_CPMM_NUMBER , |
||
const unsigned int | channel_value = DEFAULT_CHANNEL_NUMBER |
||
) |
Creates an in-orbit Channel_ID from an in-orbit mission phase, an orbit number value, a targe component value, a CPMM number, and a channel number.
This constructor is guaranteed not to throw an exception. 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 Channel_ID::DEFAULT_CHANNEL_NUMBER will be used.
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. Default: CCD_ID::DEFAULT_CPMM_NUMBER. |
channel_value | The initial value for the channel number. Default: Channel_ID::DEFAULT_CHANNEL_NUMBER. |
Channel_ID | ( | const std::string & | id_text ) | [explicit] |
Creates a Channel_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 channel number cannot be parsed from the string, then Instrument::CCD_CHANNEL_UNKNOWN will be used. If a valid observation ID component cannot be parsed from the string, Observation_ID::INVALID_OBSERVATION_ID will be used.
id_text | A string that contains a text representation of the Channel_ID. |
References Instrument::CCD_CHANNEL_UNKNOWN, and Instrument::CCD_UNKNOWN.
unsigned int channel_number | ( | ) | const [inline] |
Returns the channel number for this Channel_ID number.
A value of Instrument::CCD_CHANNEL_UNKNOWN indiciates the channel number is not know for this Channel_ID.
Channel_ID & channel_number | ( | const unsigned int | channel_value ) | throw (Out_of_Range) |
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 Channel_ID::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.
channel_value | The value for the channel number for this Channel_ID object. |
Out_of_Range | If channel_value is greater than or equal to Instrument::CCD_CHANNELS. The channel number will be set to Channel_ID::DEFAULT_CHANNEL_NUMBER in this case. |
References Instrument::CCD_CHANNEL_UNKNOWN, Instrument::CCD_CHANNELS, and ID.
Channel_ID & channel_number | ( | const std::string & | channel_text ) | throw (Invalid_Argument, Out_of_Range) |
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 Channel_ID::DEFAULT_CHANNEL_NUMBER and an Out_of_Range exception will be thrown.
channel_text | The text representation of the channel number. |
Invalid_Argument | 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 | If channel_text indicates a value greater than or equal to Instrument::CCD_CHANNELS. The channel number will be set to Channel_ID::DEFAULT_CHANNEL_NUMBER in this case. |
References Instrument::CCD_CHANNEL_UNKNOWN, Instrument::CCD_CHANNELS, and ID.
std::string channel_name | ( | ) | const |
Returns the text version of the channel number of this Channel_ID object.
If the channel number is unknown, (Instrument::CCD_CHANNEL_UNKNOWN), then Instrument::CCD_CHANNEL_UNKNOWN is returned instead, as a string.
References Instrument::CCD_CHANNEL_UNKNOWN.
Referenced by Channel_ID::text().
Channel_ID & channel_name | ( | const std::string & | channel_text ) | throw (Invalid_Argument, Out_of_Range) |
Sets the channel number for this Channel_ID object based on a text string.
This method simply calls channel_number(const std::string&).
channel_text | The text representation of the channel number. |
Invalid_Argument | 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 | If channel_text indicates a value greater than or equal to Instrument::CCD_CHANNELS. The channel number will be set to Channel_ID::DEFAULT_CHANNEL_NUMBER in this case. |
std::string text | ( | ) | const |
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 and the CCD_ID are separated by an underscore ("_") delimiter.
Reimplemented from CCD_ID.
References Channel_ID::channel_name(), and Observation_ID::TEXT_DELIMITER.
Channel_ID & text | ( | const std::string & | id_text ) | throw (Invalid_Argument, Out_of_Range) |
Sets the object value from a text representation.
id_text | The text to be parsed to obtain the value. |
Reimplemented from CCD_ID.
std::string parse | ( | const std::string & | id_text ) |
Parses a string to obtain a value for the channel number.
id_text | The text to be parsed. |
Reimplemented from CCD_ID.
References Instrument::CCD_CHANNEL_UNKNOWN, and CCD_ID::parse().
std::ostream & print | ( | std::ostream & | stream = std::cout ) |
const |
Prints the Channel_ID's text representation to an output stream.
stream | The output stream. Default: std::cout. |
Reimplemented from CCD_ID.
const char * ID = "UA::HiRISE::Channel_ID (2.6 2020/05/21 17:36:23)" [static] |
Class identification name with source code version and date.
Reimplemented from CCD_ID.
const unsigned int DEFAULT_CHANNEL_NUMBER = 0 [static] |
Default channel number.