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_fraction)
 Instantiates a weather dataset with the specified parameters.
 Weather (double celsius, double pascal, double humidity_fraction)
 Instantiates a weather dataset with the specified parameters.
double humidity () 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 const Weatherstandard ()
 Returns a reference to a fixed standard weather instance (10°C, 1 atm, 50% humidity).

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.

Since
1.6
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_fraction )

Instantiates a weather dataset with the specified parameters.

E.g.:

double mbar() const
Returns the atmospheric pressure value in millibars.
Definition Pressure.cpp:80
double celsius() const
Returns the temperature value in degrees Celsius.
Definition Temperature.cpp:46
static constexpr double percent
[u] 1 percent as a fraction.
Definition supernovas.h:190
Weather(const Temperature &T, const Pressure &p, double humidity_fraction)
Instantiates a weather dataset with the specified parameters.
Definition Weather.cpp:47
Parameters
T[C] outside air temperature
p[Pa] atmospheric pressure
humidity_fraction[0:1] relative humidity
Since
1.6
See also
Site::average_weather()

Referenced by standard().

◆ Weather() [2/2]

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

Instantiates a weather dataset with the specified parameters.

E.g.:

// 12 C, 983.3 mbar, 33.2% humidity
Weather weather(12.0, 984.3 * Unit::mbar, 33.2 * Unit::percent);
static constexpr double mbar
[Pa] 1 millibar in pascals
Definition supernovas.h:182
Parameters
celsius[C] ambient air temperature
pascal[Pa] atmospheric pressure
humidity_fraction[0:1] relative humidity
Since
1.6
See also
Site::average_weather()

Member Function Documentation

◆ humidity()

double supernovas::Weather::humidity ( ) const

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

To express the returned value to a percentage, you might use Unit::percent e.g. as:

double humidity_percent = weather.humidity() / Unit::percent;
Returns
relative humidity [0.0:1.0]
Since
1.6
See also
Unit::percent, temperature(), pressure()

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

◆ pressure()

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

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

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

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

◆ standard()

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

Returns a reference to a fixed standard weather instance (10°C, 1 atm, 50% humidity).

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

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

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
Since
1.6
See also
pressure(), humidity()

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.
Since
1.6

References humidity(), and supernovas::Unit::percent.