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