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

A physical pressure value, which can be instantiated, and then expressed, in different commonly used pressure units (kPa, mbar, torr, atm, and more). More...

#include <supernovas.h>

+ Inheritance diagram for supernovas::Pressure:

Public Member Functions

double atm () const
 Returns the atmospheric pressure value in atmospheres.
 
double bar () const
 Returns the atmospheric pressure value in bars.
 
double hPa () const
 Returns the atmospheric pressure value in hectopascals.
 
double kPa () const
 Returns the atmospheric pressure value in kilopascals.
 
double mbar () const
 Returns the atmospheric pressure value in millibars.
 
double Pa () const
 Returns the atmospheric pressure value in pascals.
 
std::string SI_unit () const override
 
std::string to_string (int decimals=3) const override
 Returns a human-readable string representation of this atmospheric pressure in millibars.
 
double torr () const
 Returns the atmospheric pressure value in millimeters of Hg (torr).
 
- Public Member Functions inherited from supernovas::Scalar
virtual ~Scalar ()
 
bool equals (const Scalar &other, double precision) const
 Checks if this scalar quantity is the same as another, within the specified precision.
 
double SI_value () const
 The value of this scalar quantity in S.I.
 
- 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 Pressure atm (double value)
 Returns a new pressure object, with the specified value defined in atmopsheres.
 
static Pressure bar (double value)
 Returns a new pressure object, with the specified value defined in bars.
 
static Pressure hPa (double value)
 Returns a new pressure object, with the specified value defined in hectopascals.
 
static Pressure kPa (double value)
 Returns a new pressure object, with the specified value defined in kilopascals.
 
static Pressure mbar (double value)
 Returns a new pressure object, with the specified value defined in millibars.
 
static Pressure Pa (double value)
 Returns a new pressure object, with the specified value defined in pascals.
 
static Pressure torr (double value)
 Returns a new pressure object, with the specified value defined in millimeters of Hg (torr).
 

Additional Inherited Members

- Protected Member Functions inherited from supernovas::Scalar
 Scalar ()
 Instantiates a standard undefined (invalid) scalar quantity with NAN value.
 
 Scalar (double SI_value)
 Instantiates a scalar quantity with an initializing value in standard S.I.
 
- Protected Member Functions inherited from supernovas::Validating
 Validating ()
 dummy constructor;
 
- Protected Attributes inherited from supernovas::Scalar
double _value
 The value in S.I. units.
 
- Protected Attributes inherited from supernovas::Validating
bool _valid = false
 the state variable.
 

Detailed Description

A physical pressure value, which can be instantiated, and then expressed, in different commonly used pressure units (kPa, mbar, torr, atm, and more).

Within SuperNOVAS it is normally used to express atmospheric pressure at an observing location, but users may utilize it in any other context also.

Since
1.6
See also
Weather

Member Function Documentation

◆ atm() [1/2]

double supernovas::Pressure::atm ( ) const

Returns the atmospheric pressure value in atmospheres.

Returns
[atm] the atmospheric pressure.
Since
1.6
See also
Pa(), hPa(), kPa(), mbar(), bar(), torr()

References supernovas::Scalar::_value, atm(), and supernovas::Unit::atm.

Referenced by atm(), and atm().

◆ atm() [2/2]

Pressure supernovas::Pressure::atm ( double value)
static

Returns a new pressure object, with the specified value defined in atmopsheres.

Parameters
value[atm] atmospheric pressure value
Returns
A new pressure object with the specified value.
Since
1.6
See also
Pa(), hPa(), kPa(), mbar(), bar(), torr()

References atm(), supernovas::Unit::atm, and supernovas::Validating::is_valid().

◆ bar() [1/2]

double supernovas::Pressure::bar ( ) const

Returns the atmospheric pressure value in bars.

Returns
[bar] the atmospheric pressure
Since
1.6
See also
Pa(), hPa(), kPa(), mbar(), torr(), atm()

References supernovas::Scalar::_value, bar(), and supernovas::Unit::bar.

Referenced by bar(), and bar().

◆ bar() [2/2]

Pressure supernovas::Pressure::bar ( double value)
static

Returns a new pressure object, with the specified value defined in bars.

Parameters
value[bar] atmospheric pressure value
Returns
A new pressure object with the specified value.
Since
1.6
See also
Pa(), hPa(), kPa(), mbar(), torr(), atm()

References bar(), supernovas::Unit::bar, and supernovas::Validating::is_valid().

◆ hPa() [1/2]

double supernovas::Pressure::hPa ( ) const

Returns the atmospheric pressure value in hectopascals.

Returns
[hPa] the atmospheric pressure
Since
1.6
See also
Pa(), kPa(), mbar(), bar(), torr(), atm()

References supernovas::Scalar::_value, and hPa().

Referenced by hPa(), and hPa().

◆ hPa() [2/2]

Pressure supernovas::Pressure::hPa ( double value)
static

Returns a new pressure object, with the specified value defined in hectopascals.

Parameters
value[hPa] atmospheric pressure value
Returns
A new pressure object with the specified value.
Since
1.6
See also
Pa(), kPa(), mbar(), bar(), torr(), atm()

References hPa(), and supernovas::Validating::is_valid().

◆ kPa() [1/2]

double supernovas::Pressure::kPa ( ) const

Returns the atmospheric pressure value in kilopascals.

Returns
[kPa] the atmospheric pressure
Since
1.6
See also
Pa(), hPa(), mbar(), bar(), torr(), atm()

References supernovas::Scalar::_value, and kPa().

Referenced by kPa(), and kPa().

◆ kPa() [2/2]

Pressure supernovas::Pressure::kPa ( double value)
static

Returns a new pressure object, with the specified value defined in kilopascals.

Parameters
value[kPa] atmospheric pressure value
Returns
A new pressure object with the specified value.
Since
1.6
See also
Pa(), hPa(), mbar(), bar(), torr(), atm()

References supernovas::Validating::is_valid(), and kPa().

◆ mbar() [1/2]

double supernovas::Pressure::mbar ( ) const

Returns the atmospheric pressure value in millibars.

Returns
[mbar] the atmospheric pressure
Since
1.6
See also
Pa(), hPa(), kPa(), bar(), torr(), atm()

References supernovas::Scalar::_value, mbar(), and supernovas::Unit::mbar.

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

◆ mbar() [2/2]

Pressure supernovas::Pressure::mbar ( double value)
static

Returns a new pressure object, with the specified value defined in millibars.

Parameters
value[mbar] atmospheric pressure value
Returns
A new pressure object with the specified value.
Since
1.6
See also
Pa(), hPa(), kPa(), bar(), torr(), atm()

References supernovas::Validating::is_valid(), mbar(), and supernovas::Unit::mbar.

◆ Pa() [1/2]

double supernovas::Pressure::Pa ( ) const

Returns the atmospheric pressure value in pascals.

Returns
[Pa] the atmospheric pressure
Since
1.6
See also
hPa(), kPa(), mbar(), bar(), torr(), atm()

References supernovas::Scalar::_value, and Pa().

Referenced by Pa(), and Pa().

◆ Pa() [2/2]

Pressure supernovas::Pressure::Pa ( double value)
static

Returns a new pressure object, with the specified value defined in pascals.

Parameters
value[Pa] atmospheric pressure value
Returns
A new pressure object with the specified value.
Since
1.6
See also
hPa(), kPa(), mbar(), bar(), torr(), atm()

References supernovas::Validating::is_valid(), and Pa().

◆ SI_unit()

std::string supernovas::Pressure::SI_unit ( ) const
overridevirtual

Implements supernovas::Scalar.

References SI_unit().

Referenced by SI_unit().

◆ to_string()

std::string supernovas::Pressure::to_string ( int decimals = 3) const
overridevirtual

Returns a human-readable string representation of this atmospheric pressure in millibars.

Parameters
decimals(optional) [0:16] decimal places to print (default: 3).
Returns
a new string representation of this pressure in millibars.
Since
1.6

Reimplemented from supernovas::Scalar.

References supernovas::Scalar::_value, supernovas::Unit::mbar, and to_string().

Referenced by to_string().

◆ torr() [1/2]

double supernovas::Pressure::torr ( ) const

Returns the atmospheric pressure value in millimeters of Hg (torr).

Returns
[torr] the atmospheric pressure (millimeters of Hg).
Since
1.6
See also
Pressure::Pa(), Pressure::hPa(), Pressure::kPa(), Pressure::mbar(), Pressure::bar(), Pressure::atm()

References supernovas::Scalar::_value, torr(), and supernovas::Unit::torr.

Referenced by torr(), and torr().

◆ torr() [2/2]

Pressure supernovas::Pressure::torr ( double value)
static

Returns a new pressure object, with the specified value defined in millimeters of Hg (torr).

Parameters
value[torr] atmospheric pressure value in millimeters of Hg.
Returns
A new pressure object with the specified value.
Since
1.6
See also
Pa(), hPa(), kPa(), mbar(), bar(), atm()

References supernovas::Validating::is_valid(), torr(), and supernovas::Unit::torr.