SuperNOVAS C++ API v1.6
High-precision C/C++ astrometry library
Loading...
Searching...
No Matches
supernovas::Track< CoordType > Class Template Referenceabstract

Approximate trajectory of a source in spherical coordinates, using a local quadratic approximation around a time instant, in some coordinate system. More...

#include <supernovas.h>

Inheritance diagram for supernovas::Track< CoordType >:

Public Member Functions

Coordinate distance_at (const Time &time) const
 Returns the momentary extrapolated distance (if valid), or else std::nullopt if the time is outside the range of validity.
const ScalarEvolutiondistance_evolution () const
 Returns the time evolution of radial distance in this trajectory.
bool is_valid_at (const Time &time) const
 Checks if the trajectory provides valid extrapolated data at a given astrometric time.
Angle latitude_at (const Time &time) const
 Returns the momentary extrapolated latitude angle (if valid), or else std::nullopt if the time is outside the range of validity.
const ScalarEvolutionlatitude_evolution () const
 Returns the latitudinal time evolution component of this trajectory.
Angle longitude_at (const Time &time) const
 Returns the momentary extrapolated longitude angle (if valid), or else std::nullopt if the time is outside the range of validity.
const ScalarEvolutionlongitude_evolution () const
 Returns the longitudinal time evolution component of this trajectory.
virtual CoordType projected_at (const Time &time) const =0
ScalarVelocity radial_velocity_at (const Time &time) const
 Returns the momentary extrapolated radial velocity (if valid), or else std::nullopt if the time is outside the range of validity.
const Intervalrange () const
 Returns the time range of validity for this trajectory.
double redshift_at (const Time &time) const
 Returns the momentary extrapolated redshift measure (if valid), or else NAN if the time is outside the range of validity.
const ScalarEvolutionredshift_evolution () const
 Returns the redshift evolution in this trajectory.
const Timereference_time () const
 Returns the astrometic time of reference, at which the (quadratic) trajectory has been defined.
Public Member Functions inherited from supernovas::Validating
bool is_valid () const
 Returns the previously set 'valid' stae of the implementing instance.
 operator bool () const
 Objects that implement Validating can be used in conditionals directly, without explicitly calling is_valid().

Protected Member Functions

 Track ()
 Track (const novas_track *track, const Interval &range)
 Instantiates a local trajectory estimate for a source on sky, which can be used to extrapolate positions around the specified reference time inside an interval of validity.
 Track (const Time &ref_time, const Interval &range, const ScalarEvolution &lon, const ScalarEvolution &lat, const ScalarEvolution &r, const ScalarEvolution &z)
 Instantiates a local trajectory estimate for a source on sky, which can be used to extrapolate positions around the specified reference time inside an interval of validity.
virtual ~Track ()
Coordinate unchecked_distance (const Time &time) const
 Returns the momentary extrapolated distance, without checking if the requested time is inside the range of validity.
Angle unchecked_latitude (const Time &time) const
 Returns the momentary extrapolated latitude angle, without checking if the requested time is inside the range of validity.
Angle unchecked_longitude (const Time &time) const
 Returns the momentary extrapolated longitude angle, without checking if the requested time is inside the range of validity.
double unchecked_redshift (const Time &time) const
 Returns the momentary extrapolated redshift, without checking if the requested time is inside the range of validity.
Protected Member Functions inherited from supernovas::Validating
 Validating ()
 dummy constructor;

Additional Inherited Members

Protected Attributes inherited from supernovas::Validating
bool _valid = false
 the state variable.

Detailed Description

template<class CoordType>
class supernovas::Track< CoordType >

Approximate trajectory of a source in spherical coordinates, using a local quadratic approximation around a time instant, in some coordinate system.

See also
HorizontalTrack, EquatorialTrack

Constructor & Destructor Documentation

◆ Track() [1/3]

template<class CoordType>
supernovas::Track< CoordType >::Track ( )
inlineprotected

◆ Track() [2/3]

template<class CoordType>
supernovas::Track< CoordType >::Track ( const Time & ref_time,
const Interval & range,
const ScalarEvolution & lon,
const ScalarEvolution & lat,
const ScalarEvolution & r,
const ScalarEvolution & z )
protected

Instantiates a local trajectory estimate for a source on sky, which can be used to extrapolate positions around the specified reference time inside an interval of validity.

Parameters
ref_timeastrometric time at which the momentary coordinates and their time evolutions are defined.
rangetime range of validity around the reference time. Attempts to extrapolate outside this interval will produce invalid data.
lonthe time evolution of the longitude (in whatever coordinate system)
latthe time evolution of the latitude (in whatever coordinate system)
rthe time evolution of distance (default: static 1 Gpc).
zthe time evolution of redshift, including gravitational effects. If it's kinetic only, then you can leave it undefined to let the distance evolution determine it automatically.

References range().

◆ Track() [3/3]

template<class CoordType>
supernovas::Track< CoordType >::Track ( const novas_track * track,
const Interval & range )
protected

Instantiates a local trajectory estimate for a source on sky, which can be used to extrapolate positions around the specified reference time inside an interval of validity.

Parameters
trackPointer to the C tajectory data structure
rangetime range of validity around the reference time. Attempts to extrapolate outside this interval will produce invalid data.
See also
HorizontalTrack(), EquatorialTrack()

References range().

◆ ~Track()

template<class CoordType>
virtual supernovas::Track< CoordType >::~Track ( )
inlineprotectedvirtual

Member Function Documentation

◆ distance_at()

template<class CoordType>
Coordinate supernovas::Track< CoordType >::distance_at ( const Time & time) const

Returns the momentary extrapolated distance (if valid), or else std::nullopt if the time is outside the range of validity.

It is best practice to check on its validity before use, e.g. as:

Coordinate d = track.distance_at(...);
if(!d) {
// Oops, not valid
return;
}
A scalar coordinate or distance between two points in space.
Definition supernovas.h:370
Parameters
Time of observation and astronomical timescalesastrometric time for which we want the extrapolated value.
Returns
the momentary extrapolated distance (if valid), or else std::nullopt.
See also
longitude_at(), latitude_at(), radial_velocity_at(), redshift_at()

References is_valid_at(), unchecked_distance(), and supernovas::Coordinate::undefined().

◆ distance_evolution()

template<class CoordType>
const ScalarEvolution & supernovas::Track< CoordType >::distance_evolution ( ) const

Returns the time evolution of radial distance in this trajectory.

Returns
the time evolution of distance.
See also
distance_at(), redshift_evolution(), longitude_evolution(), latitude_evolution()

◆ is_valid_at()

template<class CoordType>
bool supernovas::Track< CoordType >::is_valid_at ( const Time & time) const

Checks if the trajectory provides valid extrapolated data at a given astrometric time.

Parameters
Time of observation and astronomical timescalesastrometric time
Returns
true if this trajectory can provide valid extrapolated position / velocity data for the given time instant, or else false if the time is outside the range of validity for this trajectory.
See also
reference_time(), range()

Referenced by distance_at(), latitude_at(), longitude_at(), radial_velocity_at(), and redshift_at().

◆ latitude_at()

template<class CoordType>
Angle supernovas::Track< CoordType >::latitude_at ( const Time & time) const

Returns the momentary extrapolated latitude angle (if valid), or else std::nullopt if the time is outside the range of validity.

It is best practice to check on its validity before use, e.g. as:

Angle a = track.latitude_at(...);
if(!a) {
// Oops, not valid
return;
}
A representation of a regularized angle, which can be expressed in various commonly used angular unit...
Definition supernovas.h:479
Parameters
Time of observation and astronomical timescalesastrometric time for which we want the extrapolated value.
Returns
the momentary extrapolated latitude angle (if valid), or else std::nullopt.
See also
longitude_at(), distance_at(), radial_velocity_at(), redshift_at()

References is_valid_at(), unchecked_latitude(), and supernovas::Angle::undefined().

◆ latitude_evolution()

template<class CoordType>
const ScalarEvolution & supernovas::Track< CoordType >::latitude_evolution ( ) const

Returns the latitudinal time evolution component of this trajectory.

Returns
the latitudinal time evolution component.
See also
latitude_at(), longitude_evolution(), distance_evolution(), redshift_evolution()

◆ longitude_at()

template<class CoordType>
Angle supernovas::Track< CoordType >::longitude_at ( const Time & time) const

Returns the momentary extrapolated longitude angle (if valid), or else std::nullopt if the time is outside the range of validity.

It is best practice to check on its validity before use, e.g. as:

Angle a = track.longitude_at(...);
if(!a) {
// Oops, not valid
return;
}
Parameters
Time of observation and astronomical timescalesastrometric time for which we want the extrapolated value.
Returns
the momentary extrapolated longitude angle (if valid), or else std::nullopt.
See also
latitude_at(), distance_at(), radial_velocity_at(), redshift_at()

References is_valid_at(), unchecked_longitude(), and supernovas::Angle::undefined().

◆ longitude_evolution()

template<class CoordType>
const ScalarEvolution & supernovas::Track< CoordType >::longitude_evolution ( ) const

Returns the longitudinal time evolution component of this trajectory.

Returns
the longitudinal time evolution component.
See also
longitude_at(), latitude_evolution(), distance_evolution(), redshift_evolution()

◆ projected_at()

template<class CoordType>
virtual CoordType supernovas::Track< CoordType >::projected_at ( const Time & time) const
pure virtual

◆ radial_velocity_at()

template<class CoordType>
ScalarVelocity supernovas::Track< CoordType >::radial_velocity_at ( const Time & time) const

Returns the momentary extrapolated radial velocity (if valid), or else std::nullopt if the time is outside the range of validity.

It is best practice to check on its validity before use, e.g. as:

ScalarVelocity rv = track.radial_velocity_at(...);
if(!rv) {
// Oops, not valid
return;
}
A scalar velocity (if signed) or speed (unsigned).
Definition supernovas.h:732
Parameters
Time of observation and astronomical timescalesastrometric time for which we want the extrapolated value.
Returns
the momentary extrapolated radial velocity (if valid), or else std::nullopt.
See also
longitude(), latitude(), distance(), redshift_at()

References supernovas::Validating::is_valid(), is_valid_at(), supernovas::Unit::km, novas_z2v(), supernovas::Unit::s, unchecked_redshift(), and supernovas::ScalarVelocity::undefined().

◆ range()

template<class CoordType>
const Interval & supernovas::Track< CoordType >::range ( ) const

Returns the time range of validity for this trajectory.

The trajectory can only provide valid extrapolation within that time range around the reference time, for which the trajectory's paramteres have been defined.

Returns
the time range of validity around the reference time.
See also
reference_time(), is_valid()

Referenced by Track(), and Track().

◆ redshift_at()

template<class CoordType>
double supernovas::Track< CoordType >::redshift_at ( const Time & time) const

Returns the momentary extrapolated redshift measure (if valid), or else NAN if the time is outside the range of validity.

It is best practice to check on its validity before use, e.g. as:

double z = track.redshift_at(...);
if(!isfinite(z)) {
// Oops, not valid
return;
}
Parameters
Time of observation and astronomical timescalesastrometric time for which we want the extrapolated value.
Returns
the momentary extrapolated redshift measure (if valid), or else NAN.
See also
longitude_at(), latitude_at(), distance_at(), radial_velocity_at()

References is_valid_at(), and unchecked_redshift().

◆ redshift_evolution()

template<class CoordType>
const ScalarEvolution & supernovas::Track< CoordType >::redshift_evolution ( ) const

Returns the redshift evolution in this trajectory.

Returns
the time evolution of redshift.
See also
redshift_at(), radial_velocity_at(), longitude_evolution(), latitude_evolution(), distance_evolution()

◆ reference_time()

template<class CoordType>
const Time & supernovas::Track< CoordType >::reference_time ( ) const

Returns the astrometic time of reference, at which the (quadratic) trajectory has been defined.

Returns
the reference time for this trajectory.
See also
range(), is_valid()

◆ unchecked_distance()

template<class CoordType>
Coordinate supernovas::Track< CoordType >::unchecked_distance ( const Time & time) const
protected

Returns the momentary extrapolated distance, without checking if the requested time is inside the range of validity.

Parameters
Time of observation and astronomical timescalesastrometric time for which we want the extrapolated value.
Returns
the momentary extrapolated distance.
See also
unchecked_redshift(), unchecked_longitude(), unchecked_latitude()

References supernovas::Validating::is_valid().

Referenced by distance_at().

◆ unchecked_latitude()

template<class CoordType>
Angle supernovas::Track< CoordType >::unchecked_latitude ( const Time & time) const
protected

Returns the momentary extrapolated latitude angle, without checking if the requested time is inside the range of validity.

Parameters
Time of observation and astronomical timescalesastrometric time for which we want the extrapolated value.
Returns
the momentary extrapolated latitude angle.
See also
unchecked_longitude(), unchecked_distance(), unchecked_redshift()

References supernovas::Validating::is_valid().

Referenced by latitude_at().

◆ unchecked_longitude()

template<class CoordType>
Angle supernovas::Track< CoordType >::unchecked_longitude ( const Time & time) const
protected

Returns the momentary extrapolated longitude angle, without checking if the requested time is inside the range of validity.

Parameters
Time of observation and astronomical timescalesastrometric time for which we want the extrapolated value.
Returns
the momentary extrapolated longitude angle.
See also
unchecked_latitude(), unchecked_distance(), unchecked_redshift()

References supernovas::Validating::is_valid().

Referenced by longitude_at().

◆ unchecked_redshift()

template<class CoordType>
double supernovas::Track< CoordType >::unchecked_redshift ( const Time & time) const
protected

Returns the momentary extrapolated redshift, without checking if the requested time is inside the range of validity.

Parameters
Time of observation and astronomical timescalesastrometric time for which we want the extrapolated value.
Returns
the momentary extrapolated redshift.
See also
unchecked_distance(), unchecked_longitude(), unchecked_latitude()

Referenced by radial_velocity_at(), and redshift_at().