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), which may be invalid if the time is outside the range of validity.
const ScalarEvolution & | distance_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), which may be invalid if the time is outside the range of validity.
const ScalarEvolution & | latitude_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), which may be invalid if the time is outside the range of validity.
const ScalarEvolution & | longitude_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), which may be invalid if the time is outside the range of validity.
const Interval & | range () 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 ScalarEvolution & | redshift_evolution () const
| Returns the redshift evolution in this trajectory.
const Time & | reference_time () const
| Returns the astrometric 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' state 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.

Since
  1.6

See also
  HorizontalTrack, EquatorialTrack

## Constructor & Destructor Documentation

## Track() [1/3]

template<class CoordType>

supernovas::Track< CoordType >::Track | ( |  | ) |

inline protected

## 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_time | astrometric time at which the momentary coordinates and their time evolutions are defined.
  range | time range of validity around the reference time. Attempts to extrapolate outside this interval will produce invalid data.
  lon | the time evolution of the longitude (in whatever coordinate system)
  lat | the time evolution of the latitude (in whatever coordinate system)
  r | the time evolution of distance (default: static 1 Gpc).
  z | the 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.

Since
  1.6

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

  track | Pointer to the C trajectory data structure
  range | time range of validity around the reference time. Attempts to extrapolate outside this interval will produce invalid data.

Since
  1.6

See also
  HorizontalTrack(), EquatorialTrack()

References range().

## ~Track()

template<class CoordType>

virtual supernovas::Track< CoordType >::~Track | ( |  | ) |

inline protected virtual

## 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), which may be invalid 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;
}
supernovas::Coordinate
A scalar coordinate or distance between two points in space.
Definition supernovas.h:451

Parameters

  time | astrometric time for which we want the extrapolated value.

Returns
  the momentary extrapolated distance (if valid), or else an undefined (invalid) coordinate.

Since
  1.6

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.

Since
  1.6

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 | astrometric 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.

Since
  1.6

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), which may be invalid 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;
}
supernovas::Angle
A representation of a regularized angle, which can be expressed in various commonly used angular unit...
Definition supernovas.h:565

Parameters

  time | astrometric time for which we want the extrapolated value.

Returns
  the momentary extrapolated latitude angle (if valid), or else an undefined (invalid) angle.

Since
  1.6

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.

Since
  1.6

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), which may be invalid 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 | astrometric time for which we want the extrapolated value.

Returns
  the momentary extrapolated longitude angle (if valid), or else an undefined (invalid) angle.

Since
  1.6

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.

Since
  1.6

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

Implemented in supernovas::EquatorialTrack, and supernovas::HorizontalTrack.

## 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), which may be invalid 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;
}
supernovas::ScalarVelocity
A scalar velocity (if signed) or speed (if unsigned).
Definition supernovas.h:882

Parameters

  time | astrometric time for which we want the extrapolated value.

Returns
  the momentary extrapolated radial velocity (if valid), or else an undefined (invalid) scalar velocity instance.

Since
  1.6

See also
  longitude(), latitude(), distance(), redshift_at()

References supernovas::Validating::is_valid(), is_valid_at(), supernovas::Unit::km_per_s, novas_z2v(), 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 parameters have been defined.

Returns
  the time range of validity around the reference time.

Since
  1.6

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 | astrometric time for which we want the extrapolated value.

Returns
  the momentary extrapolated redshift measure (if valid), or else NAN.

Since
  1.6

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.

Since
  1.6

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 astrometric time of reference, at which the (quadratic) trajectory has been defined.

Returns
  the reference time for this trajectory.

Since
  1.6

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 | astrometric time for which we want the extrapolated value.

Returns
  the momentary extrapolated distance.

Since
  1.6

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 | astrometric time for which we want the extrapolated value.

Returns
  the momentary extrapolated latitude angle.

Since
  1.6

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 | astrometric time for which we want the extrapolated value.

Returns
  the momentary extrapolated longitude angle.

Since
  1.6

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 | astrometric time for which we want the extrapolated value.

Returns
  the momentary extrapolated redshift.

Since
  1.6

See also
  unchecked_distance(), unchecked_longitude(), unchecked_latitude()

Referenced by radial_velocity_at(), and redshift_at().