Loading...
Searching...
No Matches
supernovas::Weather Class Reference
Atmospheric refraction

Weather data, mainly for atmospheric 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 Pressure & | pressure () const
| Returns a reference to the the atmpspheric pressure value in this weather dataset.
const Temperature & | temperature () 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' state 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 Weather & | standard ()
| 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 atmospheric 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.:

Weather weather(Temperature::celsius(12.0), Pressure::mbar(984.3), 33.2 * Unit::percent);
supernovas::Pressure::mbar
double mbar() const
Returns the atmospheric pressure value in millibars.
Definition Pressure.cpp:80
supernovas::Temperature::celsius
double celsius() const
Returns the temperature value in degrees Celsius.
Definition Temperature.cpp:46
supernovas::Unit::percent
static constexpr double percent
[u] 1 percent as a fraction.
Definition supernovas.h:190
supernovas::Weather::Weather
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);
supernovas::Unit::mbar
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.