SuperNOVAS C++ API v1.6
High-precision C/C++ astrometry library
Loading...
Searching...
No Matches
supernovas::Weather Class Reference

Weather data, mainly for atmopsheric refraction correction for Earth-based (geodetic) observers. More...

#include <supernovas.h>

Inheritance diagram for supernovas::Weather:

Public Member Functions

 Weather (const Temperature &T, const Pressure &p, double humidity_percent)
 Instantiates a weather dataset with the specified parameters.
 Weather (double celsius, double pascal, double humidity_percent)
 Instantiates a weather dataset with the specified parameters.
double humidity () const
 Returns the humidity value, as a percentage, from this weather dataset.
double humidity_fraction () const
 Returns the humidity value, as a fraction, from this weather dataset.
const Pressurepressure () const
 Returns a reference to the the atmpspheric pressure value in this weather dataset.
const Temperaturetemperature () const
 Returns a reference to the temperature value in this weather dataset.
std::string to_string () const
 Returns a string representation of this weather dataset.
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().

Static Public Member Functions

static Weather guess (const Site &site)
 Returns a new weather dataset populated with typical annual average weather parameters for the given observing site, based on a simple global weather model.
static const Weatherstandard ()
 Returns a reference to a fixed standard weather instance (T = 10deg;C, p = 1 atm, humidity = 50%).

Additional Inherited Members

Protected Member Functions inherited from supernovas::Validating
 Validating ()
 dummy constructor;
Protected Attributes inherited from supernovas::Validating
bool _valid = false
 the state variable.

Detailed Description

Weather data, mainly for atmopsheric refraction correction for Earth-based (geodetic) observers.

See also
Horizontal::to_refracted(), Horizontal::to_unrefracted(), Site

Constructor & Destructor Documentation

◆ Weather() [1/2]

supernovas::Weather::Weather ( const Temperature & T,
const Pressure & p,
double humidity_percent )

Instantiates a weather dataset with the specified parameters.

Parameters
T[C] outside air temperature
p[Pa] atmospheric pressure
humidity_percent[%] relative humidity
See also
guess()

Referenced by guess(), and standard().

◆ Weather() [2/2]

supernovas::Weather::Weather ( double celsius,
double pascal,
double humidity_percent )

Instantiates a weather dataset with the specified parameters.

Parameters
celsius[C] ambient air temperature
pascal[Pa] atmospheric pressure
humidity_percent[%] relative humidity
See also
guess()

Member Function Documentation

◆ guess()

Weather supernovas::Weather::guess ( const Site & site)
static

Returns a new weather dataset populated with typical annual average weather parameters for the given observing site, based on a simple global weather model.

This provides a very crude educated guess for the weather at the site. For any precision application (e.g. refraction calculation) you should always use measured weather values instead.

Parameters
siteThe observing site
Returns
The typical annual average weather at the site, based on a simple global weather model.
See also
Weather()

References Weather(), supernovas::Site::_on_surface(), novas_on_surface::humidity, supernovas::Unit::mbar, novas_set_default_weather(), novas_on_surface::pressure, and novas_on_surface::temperature.

◆ humidity()

double supernovas::Weather::humidity ( ) const

Returns the humidity value, as a percentage, from this weather dataset.

Returns
[%] relative humidity [0:100]
See also
humidity_fraction(), temperature(), pressure()

Referenced by supernovas::Source::horizontal_track(), and to_string().

◆ humidity_fraction()

double supernovas::Weather::humidity_fraction ( ) const

Returns the humidity value, as a fraction, from this weather dataset.

Returns
relative humidity [0.0:1.0]
See also
humidity(), temperature(), pressure()

◆ pressure()

const Pressure & supernovas::Weather::pressure ( ) const

Returns a reference to the the atmpspheric pressure value in this weather dataset.

Returns
[Pa] atmospheric pressure
See also
temperature(), humidity(), humidity_fraction()

Referenced by supernovas::Source::horizontal_track().

◆ standard()

const Weather & supernovas::Weather::standard ( )
static

Returns a reference to a fixed standard weather instance (T = 10deg;C, p = 1 atm, humidity = 50%).

Returns
a static reference to a site-independent standard default weather.

References Weather(), and supernovas::Unit::atm.

Referenced by supernovas::Source::copy().

◆ temperature()

const Temperature & supernovas::Weather::temperature ( ) const

Returns a reference to the temperature value in this weather dataset.

Returns
[C] outside air temperature
See also
pressure(), humidity(), humidity_fraction()

Referenced by supernovas::Source::horizontal_track().

◆ to_string()

std::string supernovas::Weather::to_string ( ) const

Returns a string representation of this weather dataset.

Returns
A human-readable string representation of this weather data.

References humidity().