CARMA C++
carma::services::SourceChecker Class Reference

Source checker returns info on the location in the sky of a source at a given time, e.g. More...

#include <carma/services/SourceChecker.h>

Public Member Functions

bool canBeTrackedOnNegativeWrap ()
 If the source azimuth can be represented by a value between negative wrap limit and zero, then it can be tracked on the negative wrap. More...
 
services::AzWrapType computeOptimumWrapValue (services::AntennaType antType, double antAzDegrees, double timeToTrack)
 
services::Neighbor createNeighbor (const Source &neighborSource, const coordSysType coordSys, Ephemeris &localEphemeris)
 Make a Neighbor object using the current object in this SourceChecker instance as the reference and the input object to the method. More...
 
carma::services::Angle getAzimuth ()
 
Angle getAzNegativeWrapLimit () const
 
Angle getAzPositiveWrapLimit () const
 
carma::services::Angle getElevation ()
 
Angle getElevLimit () const
 Get the current elevation limit for source rise and set times. More...
 
Angle getElevUpperLimit () const
 
double getMJD ()
 DEBUG. More...
 
services::NeighborSet getNearest (const ::std::set< ::std::string > &sourceList, bool include, unsigned short numReturn, bool ignoreNorthSouth, coordSysType coordSys, sourcePntType pType, float fluxLimit)
 Must be called after setSource, set elev limits, setFrequency, and setMJD. More...
 
TelescopeStatus getTelescopeStatus ()
 
std::string info ()
 
bool isUp ()
 
std::string localTime ()
 
double lst ()
 
double minutesSinceRise ()
 
double minutesSinceSet ()
 
double minutesUntilAzLimit ()
 
double minutesUntilAzWrapLimit ()
 
double minutesUntilBlind ()
 
double minutesUntilRise ()
 
double minutesUntilSet ()
 
double minutesUntilTransit ()
 
double riseTime ()
 
void setAzNegativeWrapLimit (const Angle &azimuth)
 Set the azimuth limit on the negative wrap. More...
 
void setAzPositiveWrapLimit (const Angle &azimuth)
 Set the azimuth limit on the positive wrap. More...
 
void setElevLimit (double elevDegrees)
 Set the elevation lower limit for source rise and set times. More...
 
void setElevLimit (const Angle &elevation)
 Set the elevation lower limit for source rise and set times. More...
 
void setElevUpperLimit (double elevDegrees)
 Set the upper elevation limit for azimuth wrap calculation If the limit is less than zero, it will be set to zero. More...
 
void setElevUpperLimit (const Angle &elevation)
 Set the elevation limit for azimuth wrap calculation If the limit is less than zero, it will be set to zero. More...
 
void setFrequency (double frequency)
 Set the frequency for the observation. More...
 
void setLocation (const Location &location)
 Set the location for source checking. More...
 
void setMJD (double mjd=carma::util::Time::MJD())
 Set the MJD for subsequent queries. More...
 
void setSource (const Source &source)
 Set the source to check. More...
 
void setSource (const std::string &source, const std::string &catalog="")
 Set the source from a catalog. More...
 
double setTime ()
 
void showHeader (bool showit)
 Call to toggle whether or not the info() command prints out the column headers. More...
 
bool slewWouldCrossNorthSouthBoundary (const Source &neighborSource)
 
 SourceChecker ()
 Default Constructor. More...
 
void useJ2000 (bool j2000)
 Use J2000 in when printing RA/DEC coordinates. More...
 
void useSexagesimal (bool sexa)
 Use sexagesimal in when printing angular data. More...
 
std::string ut ()
 
virtual ~SourceChecker ()
 Destructor. More...
 

Detailed Description

Source checker returns info on the location in the sky of a source at a given time, e.g.

rise and set times. Note all calculations are with respect to the date set in SourceChecker::setMJD(double)!

Definition at line 37 of file SourceChecker.h.

Constructor & Destructor Documentation

carma::services::SourceChecker::SourceChecker ( )

Default Constructor.

virtual carma::services::SourceChecker::~SourceChecker ( )
virtual

Destructor.

Member Function Documentation

bool carma::services::SourceChecker::canBeTrackedOnNegativeWrap ( )

If the source azimuth can be represented by a value between negative wrap limit and zero, then it can be tracked on the negative wrap.

services::AzWrapType carma::services::SourceChecker::computeOptimumWrapValue ( services::AntennaType  antType,
double  antAzDegrees,
double  timeToTrack 
)
Returns
the Wrap value that will optimize time on source without having to change antenna wrap.
Parameters
antType- antenna type, OVRO or BIMA (they have different azimuth and elevation wrap limits)
antAzDegrees- antenna current azimuth, degrees
timeToTrack- required minimum time to track without a wrap chage.
services::Neighbor carma::services::SourceChecker::createNeighbor ( const Source neighborSource,
const coordSysType  coordSys,
Ephemeris localEphemeris 
)

Make a Neighbor object using the current object in this SourceChecker instance as the reference and the input object to the method.

Parameters
neighborSourceThe neighboring object
coordSysThis parameter tells the method how to do the distance computation. COORDSYS_RADEC - spherical trigonometric distance, COORDSYS_AZEL - slew-based distance, e.g. if the spherical trig distance went 'over the top' in elevation, the slewing distance would actually be longer since the antennas can't go over the top.
localEphemerisAn ephemeris created solely for Neighbor creation. This is to speed up creation of many Neighbors in loops. Do NOT use SourceChecker's internal Ephemeris ephem_ here!!
carma::services::Angle carma::services::SourceChecker::getAzimuth ( )
Returns
the azimuth of the source at the time set by setMJD().
Angle carma::services::SourceChecker::getAzNegativeWrapLimit ( ) const
Returns
Azimuth limit on negative wrap
Angle carma::services::SourceChecker::getAzPositiveWrapLimit ( ) const
Returns
Azimuth limit on positive wrap
carma::services::Angle carma::services::SourceChecker::getElevation ( )
Returns
the elevation of the source at the time set by setMJD(). regardless of elevation limit
Angle carma::services::SourceChecker::getElevLimit ( ) const

Get the current elevation limit for source rise and set times.

Returns
the elevation limit as an Angle
See Also
carma::services::Angle
Angle carma::services::SourceChecker::getElevUpperLimit ( ) const
Returns
the upper elevation limit for azimuth wrap calculation
double carma::services::SourceChecker::getMJD ( )

DEBUG.

services::NeighborSet carma::services::SourceChecker::getNearest ( const ::std::set< ::std::string > &  sourceList,
bool  include,
unsigned short  numReturn,
bool  ignoreNorthSouth,
coordSysType  coordSys,
sourcePntType  pType,
float  fluxLimit 
)

Must be called after setSource, set elev limits, setFrequency, and setMJD.

Parameters
sourceList- must be all UPPER case
Exceptions
util::IllegalStateExceptionif setSource not called first.
TelescopeStatus carma::services::SourceChecker::getTelescopeStatus ( )
Returns
the status of the telescope with respect to limits and blind spot for the give source at the given time.
std::string carma::services::SourceChecker::info ( )
Returns
info about source location in sky at preset time given time
bool carma::services::SourceChecker::isUp ( )
Returns
true if the source is above the current elevation limit at the time given in setMJD, false otherwise
std::string carma::services::SourceChecker::localTime ( )
Returns
the local time set in this object as string
double carma::services::SourceChecker::lst ( )
Returns
lst in hours currently set in this object
double carma::services::SourceChecker::minutesSinceRise ( )
Returns
the number of minutes this source has been above the elevation limit; zero if the source has set; 1440 if the source never sets
double carma::services::SourceChecker::minutesSinceSet ( )
Returns
the number of minutes this source has been below the elevation limit; zero if the source has risen; 1440 if the source never rises
double carma::services::SourceChecker::minutesUntilAzLimit ( )
Returns
number of minutes until the source hits the azimuth wrap limit

NOTE: For BIMA antennas, using only this method for determining if a source can be tracked for a given period of time is insufficient because those antennas can wrap past az=360. For such a limit, this method essentially treats the limit as (limit-360) because trigonometric functions can't tell the difference. Specifically, tan(theta) == tan(theta+PI). So for antennas with azPositiveWrapLimit > 360, the test must be ( minutesUntilAzLimit() < timeLimit && posLimit - currentAz < 180 . )

double carma::services::SourceChecker::minutesUntilAzWrapLimit ( )
Returns
the time in minutes until a telescope tracking the current source will encounter the positive azimuth wrap limit. (Under normal sidereal tracking it would never encounter the negative wrap limit). NB: comets might go the other way, but for such sources the utility of this class is in question. If the telescope will never hit the az limit, then the time to the elevation (horizon) limit is returned. @ see minutesUntilSet() If the source never rises or is always above the horizon, then the value from minutesUntilRise() is returned (1440 or 0, respectively). If the source is already past the wrap limit, then a negative number is returned.
double carma::services::SourceChecker::minutesUntilBlind ( )
Returns
the time in minutes until the source enters/exits the zenith blind spot.

If (getTelescopeStatus().isInZenithBlindSpot() == false ) then the return value is the time until enter. If (getTelescopeStatus().isInZenithBlindSpot() == true) then the return value is the time until exit,

Calling this method only makes sense if ( getTelescopeStatus().canEnterZenithBlindSpot() == true ). if that value is false, this method returns zero.

See Also
TelescopeStatus
double carma::services::SourceChecker::minutesUntilRise ( )
Returns
the time until the source rises above the elevation limit, in minutes, zero if the source is already risen If the source never rises then 1440 = 1 day is returned.
double carma::services::SourceChecker::minutesUntilSet ( )
Returns
the time until the source sets below the elevation limit, in minutes, zero if the source is already set.
double carma::services::SourceChecker::minutesUntilTransit ( )
Returns
The number of minutes until the source transits. Positive value indicates the source has not yet transited. Negative value indicates the source has already transited and abs(value) is the minutes since transit.
double carma::services::SourceChecker::riseTime ( )
Returns
LST in hours at which source is above elevation limit or a number < 0 if source never rises above limit. If the source is always above the limit, a number greater than 24 (hr) is returned.
void carma::services::SourceChecker::setAzNegativeWrapLimit ( const Angle azimuth)

Set the azimuth limit on the negative wrap.

void carma::services::SourceChecker::setAzPositiveWrapLimit ( const Angle azimuth)

Set the azimuth limit on the positive wrap.

void carma::services::SourceChecker::setElevLimit ( double  elevDegrees)

Set the elevation lower limit for source rise and set times.

If the limit is less than zero, it will be set to zero. If the limit is greater than 180, it will be set to (180 - elevDegrees).

Parameters
elevDegreesThe elevation limit in degrees.
void carma::services::SourceChecker::setElevLimit ( const Angle elevation)

Set the elevation lower limit for source rise and set times.

If the limit is less than zero, it will be set to zero. If the limit is greater than 180, it will be set to (180 - elevDegrees).

Parameters
elevationThe elevation limit as an Angle
See Also
carma::services::Angle
void carma::services::SourceChecker::setElevUpperLimit ( double  elevDegrees)

Set the upper elevation limit for azimuth wrap calculation If the limit is less than zero, it will be set to zero.

Parameters
elevDegreesThe elevation limit in degrees.
void carma::services::SourceChecker::setElevUpperLimit ( const Angle elevation)

Set the elevation limit for azimuth wrap calculation If the limit is less than zero, it will be set to zero.

Parameters
elevationThe elevation limit as an Angle
See Also
carma::services::Angle
void carma::services::SourceChecker::setFrequency ( double  frequency)

Set the frequency for the observation.

This is used to calculate the refraction correction. The default frequency is 100 GHz, which is good enough for most uses. You only need call this method if you want to use optical refraction.

Parameters
frequencyThe frequency in Hertz
void carma::services::SourceChecker::setLocation ( const Location location)

Set the location for source checking.

Parameters
Locationobject indicating latitude, longitude and altitude for source checking computation. The default location if this method is never called is CARMA's reference position.
See Also
carma::services::Location
carma::services::Observatory
void carma::services::SourceChecker::setMJD ( double  mjd = carma::util::Time::MJD())

Set the MJD for subsequent queries.

If this method has not been called queries will default to the current time.

Parameters
mjdThe time of interest, expressed as Modified Julian Day
See Also
carma::util::Time::MJD()
void carma::services::SourceChecker::setSource ( const Source source)

Set the source to check.

Parameters
sourceSource object to represent
void carma::services::SourceChecker::setSource ( const std::string &  source,
const std::string &  catalog = "" 
)

Set the source from a catalog.

Parameters
sourceNamesource name
catalogNamecatalog name, defaults to CARMA/conf/catalogs/SystemSource.cat
double carma::services::SourceChecker::setTime ( )
Returns
LST in hours at which source sets below elevation limit or a number < 0 if source never rises above limit. If the source is always above the limit, a number greater than 24 (hr) is returned.
Todo:
rename this settingTime?.
void carma::services::SourceChecker::showHeader ( bool  showit)

Call to toggle whether or not the info() command prints out the column headers.

If using info() in loops you generally want the header off after the first time.

Parameters
showittrue to show the header.
bool carma::services::SourceChecker::slewWouldCrossNorthSouthBoundary ( const Source neighborSource)
Returns
true if a slew between the reference source and the neighbor source would be the long way around.
void carma::services::SourceChecker::useJ2000 ( bool  j2000)

Use J2000 in when printing RA/DEC coordinates.

Parameters
j2000True to use sexagesimal, false for decimal.

Definition at line 131 of file SourceChecker.h.

void carma::services::SourceChecker::useSexagesimal ( bool  sexa)

Use sexagesimal in when printing angular data.

Parameters
sexTrue to use sexagesimal, false for decimal.

Definition at line 122 of file SourceChecker.h.

std::string carma::services::SourceChecker::ut ( )
Returns
the Universal Time set in this object as string

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