CppEphem
Public Member Functions | Private Member Functions | Private Attributes | List of all members
CEObservation Class Reference

The CEObservation class serves as a constant link between an observer, a specified time, and a celestial body. This makes for a more convenient way of getting the current observed coordinates of an object. It also makes it easier when using a CERunningDate object as the input "date" object.

Definition at line 33 of file CEObservation.h.

Public Member Functions

CEBodyBody ()
 Access underlying CEBody object. More...
 
 CEObservation ()
 Default constructor. More...
 
 CEObservation (CEObserver *observer, CEBody *body, CEDate *date)
 Constructor from a known observer, object, and date. More...
 
 CEObservation (const CEObservation &other)
 Copy constructor. More...
 
CEDateDate ()
 Access underlying CEDate object. More...
 
virtual double GetAltitude_Deg ()
 
virtual double GetAltitude_Rad ()
 
virtual double GetApparentXCoordinate_Deg ()
 
virtual double GetApparentXCoordinate_Rad ()
 
virtual void GetApparentXYCoordinate_Deg (double *apparent_X, double *apparent_Y)
 Returns both the observed x,y coordinates of a given 'body_' as observed by 'observer_' on the date given by 'date_'. More...
 
virtual void GetApparentXYCoordinate_Rad (double *apparent_X, double *apparent_Y)
 Returns both the observed x,y coordinates of a given 'body_' as observed by 'observer_' on the date given by 'date_'. More...
 
virtual double GetApparentYCoordinate_Deg ()
 
virtual double GetApparentYCoordinate_Rad ()
 
virtual double GetAzimuth_Deg ()
 
virtual double GetAzimuth_Rad ()
 
virtual void GetAzimuthZenith_Deg (double *azimuth, double *zenith)
 Returns both the azimuth and zenith angle of a given 'body_' as observed by 'observer_' on the date given by 'date_'. More...
 
virtual void GetAzimuthZenith_Rad (double *azimuth, double *zenith)
 Returns both the azimuth and zenith angle of a given 'body_' as observed by 'observer_' on the date given by 'date_'. More...
 
virtual double GetHourAngle_Deg ()
 
virtual double GetHourAngle_Rad ()
 
virtual double GetZenith_Deg ()
 
virtual double GetZenith_Rad ()
 
CEObserverObserver ()
 Access the underlying objects. More...
 
CEObservationoperator= (const CEObservation &other)
 Copy assignment operator. More...
 
virtual void SetBody (CEBody *new_body)
 Set underlying CEBody object. More...
 
virtual void SetDate (CEDate *new_date)
 Set underlying CEDate object. More...
 
virtual void SetObserver (CEObserver *new_observer)
 Set underlying CEObserver object. More...
 
bool UpdateCoordinates ()
 Update the stored coordinates. More...
 
virtual ~CEObservation ()
 Destructor. More...
 

Private Member Functions

void copy_members (const CEObservation &other)
 Copy data members from another object. More...
 
void free_members (void)
 Deallocate memory. More...
 
void init_members (void)
 Initialize the data members. More...
 
bool NeedsUpdate (void)
 Check whether the date has changed since the last time all of the parameters were updated (i.e. More...
 

Private Attributes

CEBodybody_
 
double cached_apparentxcoord_
 
double cached_apparentycoord_
 
CESkyCoord cached_coords_
 
double cached_date_
 
double cached_hour_angle_
 
CEDatedate_
 
CEObserverobserver_
 

#include <CEObservation.h>

Collaboration diagram for CEObservation:
Collaboration graph
[legend]

Constructor & Destructor Documentation

◆ CEObservation() [1/3]

CEObservation::CEObservation ( )

Default constructor.

Definition at line 36 of file CEObservation.cpp.

◆ CEObservation() [2/3]

CEObservation::CEObservation ( CEObserver observer,
CEBody body,
CEDate date 
)

Constructor from a known observer, object, and date.

If no date is provided, the date of the observer will be used instead.

Parameters
observerCEObserver linked with these coordinates
bodyCEBody being observed
dateCEDate object linked with these coordinates.

Definition at line 48 of file CEObservation.cpp.

◆ CEObservation() [3/3]

CEObservation::CEObservation ( const CEObservation other)

Copy constructor.

Parameters
[in]otherCEObservation object to be copied

Definition at line 64 of file CEObservation.cpp.

◆ ~CEObservation()

CEObservation::~CEObservation ( )
virtual

Destructor.

Definition at line 74 of file CEObservation.cpp.

Member Function Documentation

◆ Body()

CEBody * CEObservation::Body ( )
inline

Access underlying CEBody object.

Returns
Pointer to current CEBody object

Definition at line 113 of file CEObservation.h.

◆ copy_members()

void CEObservation::copy_members ( const CEObservation other)
private

Copy data members from another object.

Parameters
[in]otherCEObservation object to copy from

Definition at line 179 of file CEObservation.cpp.

◆ Date()

CEDate * CEObservation::Date ( )
inline

Access underlying CEDate object.

Returns
Pointer to current CEDate object

Definition at line 124 of file CEObservation.h.

◆ free_members()

void CEObservation::free_members ( void  )
private

Deallocate memory.

Definition at line 219 of file CEObservation.cpp.

◆ GetAltitude_Deg()

double CEObservation::GetAltitude_Deg ( )
inlinevirtual
Returns
altitude angle in degrees

Definition at line 220 of file CEObservation.h.

◆ GetAltitude_Rad()

double CEObservation::GetAltitude_Rad ( )
inlinevirtual
Returns
altitude angle in radians

Definition at line 209 of file CEObservation.h.

◆ GetApparentXCoordinate_Deg()

double CEObservation::GetApparentXCoordinate_Deg ( )
inlinevirtual
Returns
apparent x-coordinate value as observed by 'observer_' in degrees

Definition at line 261 of file CEObservation.h.

◆ GetApparentXCoordinate_Rad()

double CEObservation::GetApparentXCoordinate_Rad ( )
inlinevirtual

Definition at line 250 of file CEObservation.h.

◆ GetApparentXYCoordinate_Deg()

void CEObservation::GetApparentXYCoordinate_Deg ( double *  apparent_X,
double *  apparent_Y 
)
virtual

Returns both the observed x,y coordinates of a given 'body_' as observed by 'observer_' on the date given by 'date_'.

This method is the safest way of obtaining these values when using a CERunningDate object for 'date_'.

Parameters
[out]apparent_XObserved value of 'body_' x-coordinate (degrees)
[out]apparent_YObserved value of 'body_' y-coordinate (degrees)

Definition at line 150 of file CEObservation.cpp.

◆ GetApparentXYCoordinate_Rad()

void CEObservation::GetApparentXYCoordinate_Rad ( double *  apparent_X,
double *  apparent_Y 
)
virtual

Returns both the observed x,y coordinates of a given 'body_' as observed by 'observer_' on the date given by 'date_'.

This method is the safest way of obtaining these values when using a CERunningDate object for 'date_'.

Parameters
[out]apparent_XObserved value of 'body_' x-coordinate (radians)
[out]apparent_YObserved value of 'body_' y-coordinate (radians)

Definition at line 135 of file CEObservation.cpp.

◆ GetApparentYCoordinate_Deg()

double CEObservation::GetApparentYCoordinate_Deg ( )
inlinevirtual
Returns
apparent y-coordinate value as observed by 'observer_' in degrees

Definition at line 282 of file CEObservation.h.

◆ GetApparentYCoordinate_Rad()

double CEObservation::GetApparentYCoordinate_Rad ( )
inlinevirtual
Returns
apparent y-coordinate value as observed by 'observer_' in radians

Definition at line 271 of file CEObservation.h.

◆ GetAzimuth_Deg()

double CEObservation::GetAzimuth_Deg ( )
inlinevirtual
Returns
azimuth in degrees

Definition at line 178 of file CEObservation.h.

◆ GetAzimuth_Rad()

double CEObservation::GetAzimuth_Rad ( )
inlinevirtual
Returns
azimuth in radians

Definition at line 167 of file CEObservation.h.

◆ GetAzimuthZenith_Deg()

void CEObservation::GetAzimuthZenith_Deg ( double *  azimuth,
double *  zenith 
)
virtual

Returns both the azimuth and zenith angle of a given 'body_' as observed by 'observer_' on the date given by 'date_'.

This method is the safest way of obtaining the azimuth,zenith coordinates when using a CERunningDate object for 'date_'.

Parameters
[out]azimuthAzimuth in degrees (degrees)
[out]zenithZenith in degrees (degrees)

Definition at line 119 of file CEObservation.cpp.

◆ GetAzimuthZenith_Rad()

void CEObservation::GetAzimuthZenith_Rad ( double *  azimuth,
double *  zenith 
)
virtual

Returns both the azimuth and zenith angle of a given 'body_' as observed by 'observer_' on the date given by 'date_'.

This method is the safest way of obtaining the azimuth,zenith coordinates when using a CERunningDate object for 'date_'.

Parameters
[out]azimuthAzimuth in degrees (radians)
[out]zenithZenith in degrees (radians)

Definition at line 105 of file CEObservation.cpp.

◆ GetHourAngle_Deg()

double CEObservation::GetHourAngle_Deg ( )
inlinevirtual
Returns
hour angle in degrees

Definition at line 241 of file CEObservation.h.

◆ GetHourAngle_Rad()

double CEObservation::GetHourAngle_Rad ( )
inlinevirtual
Returns
hour angle in radians

Definition at line 230 of file CEObservation.h.

◆ GetZenith_Deg()

double CEObservation::GetZenith_Deg ( )
inlinevirtual
Returns
zenith angle in degrees

Definition at line 199 of file CEObservation.h.

◆ GetZenith_Rad()

double CEObservation::GetZenith_Rad ( )
inlinevirtual
Returns
zenith angle in radians

Definition at line 188 of file CEObservation.h.

◆ init_members()

void CEObservation::init_members ( void  )
private

Initialize the data members.

Definition at line 198 of file CEObservation.cpp.

◆ NeedsUpdate()

bool CEObservation::NeedsUpdate ( void  )
private

Check whether the date has changed since the last time all of the parameters were updated (i.e.

since the last time UpdateCoordinates() was called)

Definition at line 230 of file CEObservation.cpp.

◆ Observer()

CEObserver * CEObservation::Observer ( )
inline

Access the underlying objects.

Returns
Pointer to current observer object

Definition at line 103 of file CEObservation.h.

◆ operator=()

CEObservation & CEObservation::operator= ( const CEObservation other)

Copy assignment operator.

Parameters
[in]otherCEObservation object to be copied
Returns
Pointer to this object post copy

Definition at line 86 of file CEObservation.cpp.

◆ SetBody()

void CEObservation::SetBody ( CEBody new_body)
inlinevirtual

Set underlying CEBody object.

Parameters
[in]new_bodyPointer to new CEBody object

Definition at line 146 of file CEObservation.h.

◆ SetDate()

void CEObservation::SetDate ( CEDate new_date)
inlinevirtual

Set underlying CEDate object.

Parameters
[in]new_datePointer to new CEDate object

Definition at line 157 of file CEObservation.h.

◆ SetObserver()

void CEObservation::SetObserver ( CEObserver new_observer)
inlinevirtual

Set underlying CEObserver object.

Parameters
[in]new_observerPointer to new CEObserver object

Definition at line 135 of file CEObservation.h.

◆ UpdateCoordinates()

bool CEObservation::UpdateCoordinates ( )

Update the stored coordinates.

Since all values need to be computed at the same time, it only makes sense to update all of the values every time they need updating.

Definition at line 163 of file CEObservation.cpp.

Member Data Documentation

◆ body_

CEBody* CEObservation::body_
private

Definition at line 99 of file CEObservation.h.

◆ cached_apparentxcoord_

double CEObservation::cached_apparentxcoord_
private

Definition at line 111 of file CEObservation.h.

◆ cached_apparentycoord_

double CEObservation::cached_apparentycoord_
private

Definition at line 112 of file CEObservation.h.

◆ cached_coords_

CESkyCoord CEObservation::cached_coords_
private

Definition at line 107 of file CEObservation.h.

◆ cached_date_

double CEObservation::cached_date_
private

Definition at line 106 of file CEObservation.h.

◆ cached_hour_angle_

double CEObservation::cached_hour_angle_
private

Definition at line 110 of file CEObservation.h.

◆ date_

CEDate* CEObservation::date_
private

Definition at line 100 of file CEObservation.h.

◆ observer_

CEObserver* CEObservation::observer_
private

Definition at line 101 of file CEObservation.h.


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