QP  0.7-SNAPSHOT
Control software for the ??SRT telescope
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
Public Member Functions | List of all members
AstroTime Class Reference

Encapsulates a few time properties which are astronomically relevant. More...

#include <astrotime.h>

Public Member Functions

const double gmst_2pi (void) const
 The following calculates GMST of date, in radians. More...
 
const double lmst (void) const
 Returns the Local Mean Sidereal Time at the observatory.
 
const double ut1 (void) const
 Return UT1 as a number of hours. More...
 
const int mjd (void) const
 Return the MJD at time 00:00 on the indicated day. More...
 
 AstroTime ()
 The default constructor produces a valid, but largely useless structure, representing midnight on 1858 November 17 (MJD=0) at the meridian.
 
 AstroTime (const int year, const int month, const int day, const int hour, const int minute, const double second, const double obslong)
 Create a new time. More...
 
 AstroTime (const AstroTime &ref, const double extra_secs)
 Return a new astrotime, with the time given by the tm struct. More...
 
 AstroTime (const int year, const int month, const int day)
 Create a new time. More...
 
AstroTime move (double obs_lon)
 Return a new AstroTime representing the same UT as this one, but for a different observatory longitude. More...
 
char * str (char *, size_t)
 Format the current time into the given buffer. More...
 

Detailed Description

Encapsulates a few time properties which are astronomically relevant.

Constructor & Destructor Documentation

AstroTime::AstroTime ( const int  year,
const int  month,
const int  day,
const int  hour,
const int  minute,
const double  second,
const double  obslong 
)

Create a new time.

The time must be given in UT1.

Parameters
yearmust be after 1859 (ie, positive MJD)
monthmonth in [1, 12]
dayday in [1, 31]
hourUT1 hour, positive
minuteUT1 minute, positive
secondUT1 second, positive
obslongthe observatory east-longitude, in radians
AstroTime::AstroTime ( const AstroTime ref,
const double  extra_secs 
)

Return a new astrotime, with the time given by the tm struct.

Returns a new time, offset from the reference time by a number of UT1 seconds.

AstroTime::AstroTime ( const int  year,
const int  month,
const int  day 
)

Create a new time.

The time is given in LST on the supplied date. LST must be supplied in radians in the range [0,2pi). Create a new time, defaulting to noon.

Member Function Documentation

const double AstroTime::gmst_2pi ( void  ) const

The following calculates GMST of date, in radians.

This evaluates the expression for GMST in terms of UT, as given in Explanatory Supplement Eq.2.24-1, but with the resulting time normalised to be in [0,2pi)

const int AstroTime::mjd ( void  ) const

Return the MJD at time 00:00 on the indicated day.

This is a round number.

AstroTime AstroTime::move ( double  new_obs_lon)

Return a new AstroTime representing the same UT as this one, but for a different observatory longitude.

Parameters
new_obs_lonthe observatory east-longitude, in radians
char * AstroTime::str ( char *  buf,
size_t  buflen 
)

Format the current time into the given buffer.

Parameters
bufa buffer to receive the formatted string
buflenthe size of this buffer; if the string would be longer than this it is truncated
const double AstroTime::ut1 ( void  ) const

Return UT1 as a number of hours.

The result is always in the range [0, 24).


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