HiRISE
 libHiRISE

Public Member Functions | Static Public Attributes

CCD_ID Class Reference

CCD_ID encapsulates the HiRISE CCD identification code. More...

#include <CCD_ID.hh>

Inheritance diagram for CCD_ID:
Inheritance graph
[legend]
Collaboration diagram for CCD_ID:
Collaboration graph
[legend]

List of all members.

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_IDcpmm_number (const unsigned int cpmm_value) throw (Out_of_Range)
 Sets the CPMM number for this CCD_ID object.
CCD_IDcpmm_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_IDccd_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_IDtext (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.

Detailed Description

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.

Author:
Christian Schaller, UA/PIRL
Version:
2.4
See also:
Observation_ID
Instrument

Constructor & Destructor Documentation

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.

Parameters:
observation_id_valueThe initial numeric value of the Observation_ID. Default: Observation_ID::DEFAULT_OBSERVATION_ID.
cpmm_valueThe 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.

Parameters:
mission_phase_valueThe pre-orbit mission phase.
time_valueThe value for the pre-orbit time component. If it is negative, the current system clock time will be used instead. Default: -1.
cpmm_valueThe 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.

Parameters:
mission_phase_valueThe in-orbit mission phase.
orbit_number_valueThe value for the orbit number component.
target_valueThe value for the target component.
cpmm_valueThe 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.

Parameters:
id_textA string that contains a text representation of the CCD_ID.
See also:
text(const string)

References Instrument::CCD_UNKNOWN.


Member Function Documentation

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.

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.

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.

Parameters:
cpmm_valueThe value for the CPMM number for this CCD_ID object.
Returns:
A reference back to this CCD_ID.
Exceptions:
Out_of_RangeIf 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.

Parameters:
cpmm_textThe text representation of the CPMM number or the corresponding CCD name.
Returns:
A reference back to this CCD_ID.
Exceptions:
Invalid_ArgumentIf 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_RangeIf 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.

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

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&).

Parameters:
ccd_textThe text representation of the CPMM number or the corresponding CCD name.
Returns:
A reference back to this CCD_ID.
Exceptions:
Invalid_ArgumentIf 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_RangeIf 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.
See also:
cpmm_number(const std::string&)
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.

Returns:
The text representation of the CCD_ID.

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.

Parameters:
id_textThe text to be parsed to obtain the value.
Returns:
This object.
See also:
parse(const std::string&)

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.

Parameters:
id_textThe text to be parsed.
Returns:
This text used to set the value. This will be empty if no valid text was found.

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.

Parameters:
streamThe output stream. Default: std::cout.
Returns:
A reference back to the output stream.

Reimplemented from Observation_ID.

Reimplemented in Channel_ID.


Member Data Documentation

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.


The documentation for this class was generated from the following files: