HiRISE
 libHiRISE

Classes | Typedefs | Functions

UA::HiRISE Namespace Reference

High Resolution Imaging Science Experiment. More...

Classes

class  CCD_ID
 CCD_ID encapsulates the HiRISE CCD identification code. More...
class  Channel_ID
 Channel_ID encapsulates the HiRISE channel identification code. More...
class  Exception
 An exception thrown by UA::HiRISE classes. More...
struct  Error
 Error exception. More...
struct  Invalid_Argument
 Invalid_Argument exception. More...
struct  Out_of_Range
 Out_of_Range exception. More...
class  Instrument
 The Instrument defines constants and static functions used to characterize the MRO HiRISE instrument. More...
class  Observation_ID
 Observation_ID encapsulates the HiRISE observation identification number. More...

Typedefs

typedef unsigned int u_int_32

Functions

std::ostream & operator<< (std::ostream &stream, const CCD_ID &ccd_id)
 Prints the text representation of a CCD_ID to an output stream.
std::ostream & operator<< (std::ostream &stream, const Channel_ID &channel_id)
 Prints the text representation of a Channel_ID to an output stream.
void sync_to_day_of_year (struct tm *time_struct)
 Synchronizes a ctime time struct's month and day-of-month components to its day-of-year component.
std::string time_text (const int time=0, const std::string &format=Observation_ID::STANDARD_TIME_TEXT_FORMAT, const int epoch=Observation_ID::EPOCH)
 Returns a text representation of a particular time.
std::ostream & operator<< (std::ostream &stream, const Observation_ID &obs_id)
 Prints the text representation of an Observation_ID to an output stream.

Detailed Description

High Resolution Imaging Science Experiment.


Typedef Documentation

typedef unsigned int u_int_32

Function Documentation

std::ostream & operator<< ( std::ostream &  stream,
const CCD_ID &  ccd_id 
)

Prints the text representation of a CCD_ID to an output stream.

Parameters:
streamThe output stream.
ccd_idThe CCD_ID.
Returns:
A reference back to the output stream.
std::ostream & operator<< ( std::ostream &  stream,
const Channel_ID &  channel_id 
)

Prints the text representation of a Channel_ID to an output stream.

Parameters:
streamthe output stream.
channel_idthe Channel_ID.
Returns:
a reference back to the output stream.
void sync_to_day_of_year ( struct tm *  time_struct )

Synchronizes a ctime time struct's month and day-of-month components to its day-of-year component.

Some implementations of the strptime() function do not correctly sync the month and day-of-month components after parsing a day-of-year token from a string, instead relying on additional time-related functions to do so. Unfortunately, these additional functions explicitly ignore the day-of-year component, since they have no mechanism for identifying whether the day-of-year component is to be trusted or whether the month and day-of-month components are correct. Affected implementations include, but may not be limited to, the Darwin (Mac OS X) and FreeBSD strptime() functions.

This function treats a time struct's day-of-year component as correct, and it syncs the month and day-of-month components to that value, overwriting whatever values were previously held in those components. It should only be used when it is certain that the day-of-year component is the correct one.

Parameters:
time_structA pointer to a ctime-style time struct. The month and day-of-month (tm_mon, tm_mday) fields will be overwritten based on the value of the day-of-year (tm_yday) field.

Referenced by Observation_ID::time().

std::string time_text ( const int  time = 0,
const std::string &  format = Observation_ID::STANDARD_TIME_TEXT_FORMAT,
const int  epoch = Observation_ID::EPOCH 
)

Returns a text representation of a particular time.

The time is specified as the number of seconds from a particular epoch. The format is managed by a pair of static Observation_ID class methods; the format specification is identical to that used by the C-library function strftime, which is the underlying function used by this function.

By default, the epoch used is the HiRISE Observation_ID::EPOCH, but any other epoch may be specified. This epoch must be the number of seconds since the Unix epoch, which is January 1, 1970, 00:00:00 UTC. (Thus, to specify the Unix epoch, set epoch to 0.)

Parameters:
timeThe number of seconds elapsed since the specified epoch. Default: 0.
formatThe C-library strftime pattern to use to format the time text. Default: Observation_ID::STANDARD_TIME_TEXT_FORMAT
epochThe epoch from which time_in_seconds is based. Default: Observation_ID::EPOCH.
Returns:
A text representation of the time.

Referenced by Observation_ID::text(), and Observation_ID::time().

std::ostream & operator<< ( std::ostream &  stream,
const Observation_ID &  obs_id 
)

Prints the text representation of an Observation_ID to an output stream.

Parameters:
streamthe output stream.
obs_idthe Observation_ID.
Returns:
a reference back to the output stream.