World Ocean Simulation System (WOSS) library
woss::SSP Class Reference

SSP class offers multiple creation and manipulation capabilities for sound speed profile. More...

#include <ssp-definitions.h>

Collaboration diagram for woss::SSP:
Collaboration graph

Public Types

enum class  SSPEqType { SSP_EQ_CHEN_MILLERO = 0 , SSP_EQ_TEOS_10 = 1 , SSP_EQ_TEOS_10_EXACT = 2 , SSP_EQ_INVALID }
 

Public Member Functions

 SSP (long double depth_precision=SSP_CUSTOM_DEPTH_PRECISION)
 
 SSP (DepthMap &ssp_map, DepthMap &temp_map, DepthMap &sal_map, DepthMap &press_map, long double depth_precision=SSP_CUSTOM_DEPTH_PRECISION)
 
 SSP (DepthMap &ssp_map, long double depth_precision=SSP_CUSTOM_DEPTH_PRECISION)
 
 SSP (const SSP &copy)=default
 
 SSP (SSP &&tmp)=default
 
virtual ~SSP ()=default
 
virtual std::unique_ptr< SSPcreate (long double depth_precision=SSP_CUSTOM_DEPTH_PRECISION) const
 
virtual std::unique_ptr< SSPcreate (DepthMap &ssp_map, DepthMap &temp_map, DepthMap &sal_map, DepthMap &press_map, long double depth_precision=SSP_CUSTOM_DEPTH_PRECISION) const
 
virtual std::unique_ptr< SSPcreate (DepthMap &ssp_map, long double depth_precision=SSP_CUSTOM_DEPTH_PRECISION) const
 
virtual std::unique_ptr< SSPclone () const
 
int size () const
 
bool empty () const
 
void clear ()
 
DConstIter begin () const
 
DConstIter end () const
 
DConstRIter rbegin () const
 
DConstRIter rend () const
 
DConstIter lower_bound (const PDouble &depth) const
 
DConstIter upper_bound (const PDouble &depth) const
 
DConstIter at (const int i) const
 
DConstIter pressure_begin () const
 
DConstIter pressure_end () const
 
DConstRIter pressure_rbegin () const
 
DConstRIter pressure_rend () const
 
DConstIter pressure_lower_bound (const PDouble &depth) const
 
DConstIter pressure_upper_bound (const PDouble &depth) const
 
DConstIter pressure_find (const PDouble &depth) const
 
DConstIter temperature_begin () const
 
DConstIter temperature_end () const
 
DConstRIter temperature_rbegin () const
 
DConstRIter temperature_rend () const
 
DConstIter temperature_lower_bound (const PDouble &depth) const
 
DConstIter temperature_upper_bound (const PDouble &depth) const
 
DConstIter temperature_find (const PDouble &depth) const
 
DConstIter salinity_begin () const
 
DConstIter salinity_end () const
 
DConstRIter salinity_rbegin () const
 
DConstRIter salinity_rend () const
 
DConstIter salinity_lower_bound (const PDouble &depth) const
 
DConstIter salinity_upper_bound (const PDouble &depth) const
 
DConstIter salinity_find (const PDouble &depth) const
 
virtual bool isValid () const
 
virtual bool isTransformable () const
 
virtual bool isRandomizable () const
 
virtual std::unique_ptr< SSPtransform (const Coord &coordinates, double new_min_depth=-HUGE_VAL, double new_max_depth=HUGE_VAL, int total_depth_steps=SSP_CUSTOM_DEPTH_STEPS) const
 
virtual std::unique_ptr< SSPtruncate (double max_depth) const
 
virtual std::unique_ptr< SSPfullRandomize (double ratio_incr_value) const
 
virtual std::unique_ptr< SSPrandomize (double ratio_incr_value) const
 
virtual bool import (std::istream &stream_in)
 
virtual bool write (std::ostream &stream_out) const
 
SSPinsertValue (double depth, double ssp_value)
 
SSPinsertValue (double depth, double temperature, double salinity, const std::complex< double > &pressure, double ssp_value)
 
SSPinsertValue (double temperature, double salinity, const std::complex< double > &pressure, const Coord &coordinates=Coord(0.0, 0.0))
 
SSPinsertValue (double depth, double temperature, double salinity, const Coord &coordinates=Coord(0.0, 0.0))
 
DConstIter findValue (const double &depth) const
 
SSPeraseValue (const double &depth)
 
double getMaxDepthValue () const
 
double getMinDepthValue () const
 
double getMaxSSPValue () const
 
double getMinSSPValue () const
 
virtual void setDepthPrecision (long double prec)
 
long double getDepthPrecision () const
 
SSPsetSSPEqType (SSPEqType eq_type)
 
SSPEqType getSSPEqType () const
 
SSPoperator= (const SSP &x)=default
 
SSPoperator= (SSP &&tmp)=default
 

Static Public Member Functions

static void setDebug (bool flag)
 

Protected Attributes

SSPEqType ssp_eq_type
 
double min_ssp_value
 
double max_ssp_value
 
long double depth_precision
 
DepthMap ssp_map
 
DepthMap pressure_map
 
DepthMap salinity_map
 
DepthMap temperature_map
 

Static Protected Attributes

static bool debug = false
 

Private Member Functions

constexpr double calculateSSP (double temperature, double salinity, double pressure) const
 
constexpr bool isCanonOcean (const Coord &coordinates) const
 
constexpr bool isNEAtlanticOcean (const Coord &coordinates) const
 
constexpr bool isAntarcticOcean (const Coord &coordinates) const
 
constexpr bool isMediterraneanSea (const Coord &coordinates) const
 
constexpr bool isRedSea (const Coord &coordinates) const
 
constexpr bool isArcticOcean (const Coord &coordinates) const
 
constexpr bool isJapanSea (const Coord &coordinates) const
 
constexpr bool isSuluSea (const Coord &coordinates) const
 
constexpr bool isHalmaheraSea (const Coord &coordinates) const
 
constexpr bool isCelebesSea (const Coord &coordinates) const
 
constexpr bool isBlackSea (const Coord &coordinates) const
 
constexpr bool isBalticSea (const Coord &coordinates) const
 
constexpr double thyh (double z) const
 
constexpr double g (double lat) const
 
constexpr double k (double z, double lat) const
 
constexpr double hq (double z) const
 
constexpr double h (double z, double lat) const
 
constexpr double getPressureCorreptions (const Coord &coordinates, double depth) const
 
constexpr double getPressureFromDepth (const Coord &coordinates, double depth) const
 
constexpr double g_z (double lat) const
 
constexpr double getDepthCorreptions (const Coord &coordinates, double pressure) const
 
constexpr double getDepthfromPressure (const Coord &coordinates, double pressure) const
 
constexpr double d (double t, double p) const
 
constexpr double b (double t, double p) const
 
constexpr double a (double t, double p) const
 
constexpr double cw (double t, double p) const
 
constexpr double gibbs (int ns, int nt, int np, double sa, double t, double p) const
 

Friends

bool operator== (const SSP &left, const SSP &right)
 
bool operator!= (const SSP &left, const SSP &right)
 
const SSP operator+ (const SSP &left, const SSP &right)
 
const SSP operator- (const SSP &left, const SSP &right)
 
const SSP operator* (const SSP &left, const SSP &right)
 
const SSP operator/ (const SSP &left, const SSP &right)
 
const SSP operator+ (const SSP &left, const double right)
 
const SSP operator- (const SSP &left, const double right)
 
const SSP operator/ (const SSP &left, const double right)
 
const SSP operator* (const SSP &left, const double right)
 
const SSP operator+ (const double left, const SSP &right)
 
const SSP operator- (const double left, const SSP &right)
 
const SSP operator/ (const double left, const SSP &right)
 
const SSP operator* (const double left, const SSP &right)
 
SSPoperator+= (SSP &left, const SSP &right)
 
SSPoperator-= (SSP &left, const SSP &right)
 
SSPoperator*= (SSP &left, const SSP &right)
 
SSPoperator/= (SSP &left, const SSP &right)
 
SSPoperator+= (SSP &left, const double right)
 
SSPoperator-= (SSP &left, const double right)
 
SSPoperator/= (SSP &left, const double right)
 
SSPoperator*= (SSP &left, const double right)
 
std::ostream & operator<< (std::ostream &os, const SSP &instance)
 
std::ostream & operator>> (std::istream &is, const SSP &instance)
 

Detailed Description

SSP class offers multiple creation and manipulation capabilities for sound speed profile.

SSP can store all information related to a sound speed profile: temperature [C°], pressure [bar], salinity [psu] and sound speed [m/s]. It offers capabilities for arithmetic computations, sound speed calculations (Chen and Millero equations), depth to pressure conversions (and viceversa) with coordinates corrections, sound speed profile transformations and random perturbation.

Member Enumeration Documentation

◆ SSPEqType

enum class woss::SSP::SSPEqType
strong

SSP EQ

Enumerator
SSP_EQ_CHEN_MILLERO 

UNESCO Chen & Miller, Wong Zu Eq.

SSP_EQ_TEOS_10 

TEOS-10 Eq (.

See also
reference [10])
SSP_EQ_TEOS_10_EXACT 

TEOS-10 Exact Eq (.

See also
reference [10])
SSP_EQ_INVALID 

Must always be the last.

Constructor & Destructor Documentation

◆ SSP() [1/5]

SSP::SSP ( long double  depth_precision = SSP_CUSTOM_DEPTH_PRECISION)

SSP default constructor. The object created is not valid

Parameters
depth_precisionprecision of PDouble objects representing depth.

◆ SSP() [2/5]

SSP::SSP ( DepthMap ssp_map,
DepthMap temp_map,
DepthMap sal_map,
DepthMap press_map,
long double  depth_precision = SSP_CUSTOM_DEPTH_PRECISION 
)

SSP constructor.

Parameters
ssp_mapmap linking a PDouble depth [m] (with precision depth_precision) to a sound speed [m/s]
temp_mapmap linking a PDouble depth [m] (with precision depth_precision) to a temperature [C°]
sal_mapmap linking a PDouble depth [m] (with precision depth_precision) to a salinity [ppu]
press_mapmap linking a PDouble depth [m] (with precision depth_precision) to a pressure [bar]
depth_precisiondepth precision of given maps [m]

References pressure_map, salinity_map, ssp_map, and temperature_map.

◆ SSP() [3/5]

SSP::SSP ( DepthMap ssp_map,
long double  depth_precision = SSP_CUSTOM_DEPTH_PRECISION 
)

SSP constructor.

Parameters
ssp_mapmap linking a PDouble depth [m] (with precision depth_precision) to a sound speed [m/s]
depth_precisiondepth precision of given maps [m]

References ssp_map.

◆ SSP() [4/5]

woss::SSP::SSP ( const SSP copy)
default

◆ SSP() [5/5]

woss::SSP::SSP ( SSP &&  tmp)
default

◆ ~SSP()

virtual woss::SSP::~SSP ( )
virtualdefault

Member Function Documentation

◆ a()

constexpr double woss::SSP::a ( double  t,
double  p 
) const
inlineconstexprprivate

UNESCO Chen and Millero Equation with Wong and Zu corrections for sound speed calculations

Parameters
ttemperature provided [C°]
ppressure provided [bar]

Referenced by calculateSSP().

◆ at()

DConstIter SSP::at ( const int  i) const

Returns a const iterator to the sound speed value at i-th position

Parameters
iinteger should be between 0 and size()
Returns
const iterator to end() if position i is not found

References ssp_map.

◆ b()

constexpr double woss::SSP::b ( double  t,
double  p 
) const
inlineconstexprprivate

UNESCO Chen and Millero Equation with Wong and Zu corrections for sound speed calculations

Parameters
ttemperature provided [C°]
ppressure provided [bar]

Referenced by calculateSSP().

◆ begin()

DConstIter woss::SSP::begin ( ) const
inline

Returns a const iterator to the beginning of the sound speed map

Returns
const iterator

References ssp_map.

Referenced by woss::BellhopWoss::writeNormalizedSSP().

◆ calculateSSP()

constexpr double woss::SSP::calculateSSP ( double  temperature,
double  salinity,
double  pressure 
) const
inlineconstexprprivate

Calculates sound speed from temperature, salinity, pressure with UNESCO Chen and Millero equations and with Wong and Zu corrections

Parameters
temperaturetemperature value [C°]
salinitysalinity value [ppu]
pressurepressure value [bar]

References a(), b(), cw(), d(), gibbs(), SSP_EQ_CHEN_MILLERO, SSP_EQ_TEOS_10, SSP_EQ_TEOS_10_EXACT, and ssp_eq_type.

Referenced by fullRandomize(), insertValue(), insertValue(), and transform().

Here is the call graph for this function:

◆ clear()

void woss::SSP::clear ( )
inline

Erase all values of sound speed, temperature, pressure and salinity. The object therefore is not valid

References pressure_map, salinity_map, ssp_map, and temperature_map.

◆ clone()

virtual std::unique_ptr< SSP > woss::SSP::clone ( ) const
inlinevirtual

SSP virtual factory method

Returns
std::unique_ptr to a heap-created copy of this instance

Referenced by woss::WossDbManager::setCustomSSP(), and truncate().

◆ create() [1/3]

virtual std::unique_ptr< SSP > woss::SSP::create ( DepthMap ssp_map,
DepthMap temp_map,
DepthMap sal_map,
DepthMap press_map,
long double  depth_precision = SSP_CUSTOM_DEPTH_PRECISION 
) const
inlinevirtual

SSP virtual factory method

Parameters
ssp_mapmap linking a PDouble depth [m] (with precision depth_precision) to a sound speed [m/s]
temp_mapmap linking a PDouble depth [m] (with precision depth_precision) to a temperature [C°]
sal_mapmap linking a PDouble depth [m] (with precision depth_precision) to a salinity [ppu]
press_mapmap linking a PDouble depth [m] (with precision depth_precision) to a pressure [bar]
depth_precisiondepth precision of given maps [m]
Returns
std::unique_ptr to a heap-created SSP object

References depth_precision, and ssp_map.

◆ create() [2/3]

virtual std::unique_ptr< SSP > woss::SSP::create ( DepthMap ssp_map,
long double  depth_precision = SSP_CUSTOM_DEPTH_PRECISION 
) const
inlinevirtual

SSP virtual factory method

Parameters
ssp_mapmap linking a PDouble depth [m] (with precision depth_precision) to a sound speed [m/s]
depth_precisiondepth precision of given maps [m]
Returns
std::unique_ptr to a heap-created SSP object

References depth_precision, and ssp_map.

◆ create() [3/3]

virtual std::unique_ptr< SSP > woss::SSP::create ( long double  depth_precision = SSP_CUSTOM_DEPTH_PRECISION) const
inlinevirtual

SSP virtual factory method

Parameters
depth_precisionprecision of PDouble objects representing depth.
Returns
std::unique_ptr to a heap-created SSP object

References depth_precision.

Referenced by fullRandomize(), randomize(), transform(), and truncate().

◆ cw()

constexpr double woss::SSP::cw ( double  t,
double  p 
) const
inlineconstexprprivate

UNESCO Chen and Millero Equation with Wong and Zu corrections for sound speed calculations

Parameters
ttemperature provided [C°]
ppressure provided [bar]

Referenced by calculateSSP().

◆ d()

constexpr double woss::SSP::d ( double  t,
double  p 
) const
inlineconstexprprivate

UNESCO Chen and Millero Equation with Wong and Zu corrections for sound speed calculations

Parameters
ttemperature provided [C°]
ppressure provided [bar]

Referenced by calculateSSP().

◆ empty()

bool woss::SSP::empty ( ) const
inline

Checks if the instance has stored values

Returns
true if condition applies, false otherwise

References ssp_map.

◆ end()

DConstIter woss::SSP::end ( ) const
inline

Returns a const iterator to the end of the sound speed map

Returns
const iterator

References ssp_map.

Referenced by woss::BellhopWoss::writeNormalizedSSP().

◆ eraseValue()

SSP & woss::SSP::eraseValue ( const double &  depth)
inline

Erase the sound speed value with key == of depth parameter

Parameters
depthconst reference to a PDouble depth value
Returns
reference to *this

References ssp_map.

◆ findValue()

DConstIter woss::SSP::findValue ( const double &  depth) const
inline

Returns a const iterator to the sound speed value with key == of depth parameter

Parameters
depthconst reference to a PDouble depth value
Returns
const iterator to end() if depth is not found

References ssp_map.

◆ fullRandomize()

std::unique_ptr< SSP > SSP::fullRandomize ( double  ratio_incr_value) const
virtual

Performs a random perturbation of temperature, salinity, pressure with given ratio Sound speed values are then calculated from this new data

Parameters
ratio_incr_valueperturbation ratio
Returns
a std::unique_ptr to a heap allocated woss::SSP object

References calculateSSP(), create(), depth_precision, woss::Singleton< T >::instance(), isRandomizable(), pressure_map, salinity_map, ssp_map, and temperature_map.

Here is the call graph for this function:

◆ g()

constexpr double woss::SSP::g ( double  lat) const
inlineconstexprprivate

Equation for pressure from depth conversion ( Leroy and Parthiot )

Parameters
latlatitude [decimal degree]

Referenced by k().

◆ g_z()

constexpr double woss::SSP::g_z ( double  lat) const
inlineconstexprprivate

Equation for depth from pressure conversion ( Leroy and Parthiot )

Parameters
latlatitude [decimal degree]

Referenced by getDepthfromPressure().

◆ getDepthCorreptions()

constexpr double woss::SSP::getDepthCorreptions ( const Coord coordinates,
double  pressure 
) const
constexprprivate

Returns depth correction for given coordinates and pressure ( Leroy and Parthiot )

Parameters
coordinatescoordinates provided
pressurepressure provided [bar]

References isAntarcticOcean(), isBalticSea(), isBlackSea(), isCanonOcean(), isCelebesSea(), isHalmaheraSea(), isJapanSea(), isMediterraneanSea(), isNEAtlanticOcean(), isRedSea(), and isSuluSea().

Referenced by getDepthfromPressure().

Here is the call graph for this function:

◆ getDepthfromPressure()

constexpr double woss::SSP::getDepthfromPressure ( const Coord coordinates,
double  pressure 
) const
inlineconstexprprivate

Returns depth for given coordinates and pressure ( Leroy and Parthiot )

Parameters
coordinatescoordinates provided
pressurepressure provided [bar]
Returns
depth [m]

References g_z(), getDepthCorreptions(), and woss::Coord::getLatitude().

Referenced by insertValue().

Here is the call graph for this function:

◆ getDepthPrecision()

long double woss::SSP::getDepthPrecision ( ) const
inline

Returns the sound speed profile depth precision

Returns
depth precision [m]

References depth_precision.

◆ getMaxDepthValue()

double woss::SSP::getMaxDepthValue ( ) const
inline

Returns the maximum depth value

Returns
maximum depth [m]

References ssp_map.

◆ getMaxSSPValue()

double woss::SSP::getMaxSSPValue ( ) const
inline

Returns the maximum sound speed value

Returns
maximum sound speed [m/s]

References max_ssp_value.

◆ getMinDepthValue()

double woss::SSP::getMinDepthValue ( ) const
inline

Returns the minimum depth value

Returns
minimum depth [m]

References ssp_map.

◆ getMinSSPValue()

double woss::SSP::getMinSSPValue ( ) const
inline

Returns the maximum depth value

Returns
maximum sound speed [m/s]

References min_ssp_value.

◆ getPressureCorreptions()

constexpr double woss::SSP::getPressureCorreptions ( const Coord coordinates,
double  depth 
) const
constexprprivate

Returns pressure correction for given coordinates and depth ( Leroy and Parthiot )

Parameters
coordinatescoordinates provided
depthdepth provided [m]

References isAntarcticOcean(), isBalticSea(), isBlackSea(), isCanonOcean(), isCelebesSea(), isHalmaheraSea(), isJapanSea(), isMediterraneanSea(), isNEAtlanticOcean(), isRedSea(), and isSuluSea().

Referenced by getPressureFromDepth().

Here is the call graph for this function:

◆ getPressureFromDepth()

constexpr double woss::SSP::getPressureFromDepth ( const Coord coordinates,
double  depth 
) const
inlineconstexprprivate

Returns pressure for given coordinates and depth ( Leroy and Parthiot )

Parameters
coordinatescoordinates provided
depthdepth provided [m]
Returns
pressure [bar]

References woss::Coord::getLatitude(), getPressureCorreptions(), h(), and thyh().

Referenced by insertValue(), and transform().

Here is the call graph for this function:

◆ getSSPEqType()

SSPEqType woss::SSP::getSSPEqType ( ) const
inline

Gets the current SSPEqType

Returns
current SSPEqType

References ssp_eq_type.

◆ gibbs()

constexpr double woss::SSP::gibbs ( int  ns,
int  nt,
int  np,
double  sa,
double  t,
double  p 
) const
inlineconstexprprivate

Seawater specific Gibbs free energy and derivatives up to order 2

Parameters
nsorder of salinity derivative
ntorder of temperature derivative
nporder of pressure derivative
sasalinity [ppu]
ttemperature [C°]
ppressure [dbar]

Referenced by calculateSSP().

◆ h()

constexpr double woss::SSP::h ( double  z,
double  lat 
) const
inlineconstexprprivate

Equation for pressure from depth conversion ( Leroy and Parthiot )

Parameters
zdepth [m]
latlatitude [decimal degree]

References hq(), and k().

Referenced by getPressureFromDepth().

Here is the call graph for this function:

◆ hq()

constexpr double woss::SSP::hq ( double  z) const
inlineconstexprprivate

Equation for pressure from depth conversion ( Leroy and Parthiot )

Parameters
zdepth [m]

Referenced by h().

◆ import()

bool SSP::import ( std::istream &  stream_in)
virtual

Imports values in from the given stream

Parameters
stream_inconst reference to an istream instance
Returns
true if method was successful, false otherwise

References debug, and insertValue().

Referenced by woss::operator>>().

Here is the call graph for this function:

◆ insertValue() [1/4]

SSP & SSP::insertValue ( double  depth,
double  ssp_value 
)

Inserts and doesn't replace a sound speed value at given depth

Parameters
depthdepth value [m]. The corresponding PDouble will take SSP::depth_precision as precision
ssp_valuesound speed value [m/s]
Returns
reference to *this

References depth_precision, max_ssp_value, min_ssp_value, and ssp_map.

Referenced by import().

◆ insertValue() [2/4]

SSP & SSP::insertValue ( double  depth,
double  temperature,
double  salinity,
const Coord coordinates = Coord(0.0, 0.0) 
)

Calculates and doesn't replace sound speed from given temperature, pressure and salinity value at given depth, with pressure converted from depth.

Parameters
coordinatescoordinates for depth-to-pressure conversion corrections (defaults to CanonOcean)
depthdepth value [m]
temperaturetemperature value [C°]
salinitysalinity value [ppu]
Returns
reference to *this

References calculateSSP(), depth_precision, getPressureFromDepth(), woss::Coord::isValid(), max_ssp_value, min_ssp_value, pressure_map, salinity_map, ssp_map, and temperature_map.

Here is the call graph for this function:

◆ insertValue() [3/4]

SSP & SSP::insertValue ( double  depth,
double  temperature,
double  salinity,
const std::complex< double > &  pressure,
double  ssp_value 
)

Inserts and doesn't replace a sound speed value at given depth

Parameters
depthdepth value [m]. The corresponding PDouble will take SSP::depth_precision as precision
temperaturetemperature value [C°]
salinitysalinity value [ppu]
pressurepressure value [bar]
ssp_valuesound speed value [m/s]
Returns
reference to *this

References depth_precision, max_ssp_value, min_ssp_value, pressure_map, salinity_map, ssp_map, and temperature_map.

◆ insertValue() [4/4]

SSP & SSP::insertValue ( double  temperature,
double  salinity,
const std::complex< double > &  pressure,
const Coord coordinates = Coord( 0.0, 0.0) 
)

Calculates and doesn't replace sound speed from given temperature, pressure and salinity value at depth converted from pressure.

Parameters
coordinatescoordinates for pressure-to-depth conversion corrections (defaults to CanonOcean)
temperaturetemperature value [C°]
salinitysalinity value [ppu]
pressurepressure value [bar]
Returns
reference to *this

References calculateSSP(), depth_precision, getDepthfromPressure(), woss::Coord::isValid(), max_ssp_value, min_ssp_value, pressure_map, salinity_map, ssp_map, and temperature_map.

Here is the call graph for this function:

◆ isAntarcticOcean()

constexpr bool woss::SSP::isAntarcticOcean ( const Coord coordinates) const
inlineconstexprprivate

Checks if coordinates provided are in Antarctic Ocean

Parameters
coordinatescoordinates value
Returns
true if condition holds, false otherwise

References woss::Coord::getLatitude().

Referenced by getDepthCorreptions(), and getPressureCorreptions().

Here is the call graph for this function:

◆ isArcticOcean()

constexpr bool woss::SSP::isArcticOcean ( const Coord coordinates) const
inlineconstexprprivate

Checks if coordinates provided are in Arctic Ocean

Parameters
coordinatescoordinates value
Returns
true if condition holds, false otherwise

References woss::Coord::getLatitude().

Here is the call graph for this function:

◆ isBalticSea()

constexpr bool woss::SSP::isBalticSea ( const Coord coordinates) const
inlineconstexprprivate

Checks if coordinates provided are in Baltic Sea

Parameters
coordinatescoordinates value
Returns
true if condition holds, false otherwise

References woss::Coord::getLatitude(), and woss::Coord::getLongitude().

Referenced by getDepthCorreptions(), and getPressureCorreptions().

Here is the call graph for this function:

◆ isBlackSea()

constexpr bool woss::SSP::isBlackSea ( const Coord coordinates) const
inlineconstexprprivate

Checks if coordinates provided are in Black Sea

Parameters
coordinatescoordinates value
Returns
true if condition holds, false otherwise

References woss::Coord::getLatitude(), and woss::Coord::getLongitude().

Referenced by getDepthCorreptions(), and getPressureCorreptions().

Here is the call graph for this function:

◆ isCanonOcean()

constexpr bool woss::SSP::isCanonOcean ( const Coord coordinates) const
inlineconstexprprivate

Checks if coordinates provided are in canon ocean

Parameters
coordinatescoordinates value
Returns
true if condition holds, false otherwise

References woss::Coord::getLatitude().

Referenced by getDepthCorreptions(), and getPressureCorreptions().

Here is the call graph for this function:

◆ isCelebesSea()

constexpr bool woss::SSP::isCelebesSea ( const Coord coordinates) const
inlineconstexprprivate

Checks if coordinates provided are in Celebes Sea

Parameters
coordinatescoordinates value
Returns
true if condition holds, false otherwise

References woss::Coord::getLatitude(), and woss::Coord::getLongitude().

Referenced by getDepthCorreptions(), and getPressureCorreptions().

Here is the call graph for this function:

◆ isHalmaheraSea()

constexpr bool woss::SSP::isHalmaheraSea ( const Coord coordinates) const
inlineconstexprprivate

Checks if coordinates provided are in Halmahera Sea

Parameters
coordinatescoordinates value
Returns
true if condition holds, false otherwise

References woss::Coord::getLatitude(), and woss::Coord::getLongitude().

Referenced by getDepthCorreptions(), and getPressureCorreptions().

Here is the call graph for this function:

◆ isJapanSea()

constexpr bool woss::SSP::isJapanSea ( const Coord coordinates) const
inlineconstexprprivate

Checks if coordinates provided are in Japan Sea

Parameters
coordinatescoordinates value
Returns
true if condition holds, false otherwise

References woss::Coord::getLatitude(), and woss::Coord::getLongitude().

Referenced by getDepthCorreptions(), and getPressureCorreptions().

Here is the call graph for this function:

◆ isMediterraneanSea()

constexpr bool woss::SSP::isMediterraneanSea ( const Coord coordinates) const
inlineconstexprprivate

Checks if coordinates provided are in Mediterranean Sea

Parameters
coordinatescoordinates value
Returns
true if condition holds, false otherwise

References woss::Coord::getLatitude(), and woss::Coord::getLongitude().

Referenced by getDepthCorreptions(), and getPressureCorreptions().

Here is the call graph for this function:

◆ isNEAtlanticOcean()

constexpr bool woss::SSP::isNEAtlanticOcean ( const Coord coordinates) const
inlineconstexprprivate

Checks if coordinates provided are in north eastern Atlantic Ocean

Parameters
coordinatescoordinates value
Returns
true if condition holds, false otherwise

References woss::Coord::getLatitude(), and woss::Coord::getLongitude().

Referenced by getDepthCorreptions(), and getPressureCorreptions().

Here is the call graph for this function:

◆ isRandomizable()

virtual bool woss::SSP::isRandomizable ( ) const
inlinevirtual

Checks if the sound speed profile provided can be randomly perturbated

Returns
true if it can, false otherwise

References isValid(), pressure_map, salinity_map, and temperature_map.

Referenced by fullRandomize(), and transform().

Here is the call graph for this function:

◆ isRedSea()

constexpr bool woss::SSP::isRedSea ( const Coord coordinates) const
inlineconstexprprivate

Checks if coordinates provided are in Red Sea

Parameters
coordinatescoordinates value
Returns
true if condition holds, false otherwise

References woss::Coord::getLatitude(), and woss::Coord::getLongitude().

Referenced by getDepthCorreptions(), and getPressureCorreptions().

Here is the call graph for this function:

◆ isSuluSea()

constexpr bool woss::SSP::isSuluSea ( const Coord coordinates) const
inlineconstexprprivate

Checks if coordinates provided are in Sulu Sea

Parameters
coordinatescoordinates value
Returns
true if condition holds, false otherwise

References woss::Coord::getLatitude(), and woss::Coord::getLongitude().

Referenced by getDepthCorreptions(), and getPressureCorreptions().

Here is the call graph for this function:

◆ isTransformable()

virtual bool woss::SSP::isTransformable ( ) const
inlinevirtual

Checks if the sound speed profile provided can be transformed

Returns
true if it can, false otherwise

References isValid().

Referenced by transform().

Here is the call graph for this function:

◆ isValid()

virtual bool woss::SSP::isValid ( ) const
inlinevirtual

Checks the validity of sound speed profile provided

Returns
true if it has at least one value, false otherwise

References ssp_map.

Referenced by isRandomizable(), isTransformable(), and randomize().

◆ k()

constexpr double woss::SSP::k ( double  z,
double  lat 
) const
inlineconstexprprivate

Equation for pressure from depth conversion ( Leroy and Parthiot )

Parameters
zdepth [m]
latlatitude [decimal degree]

References g().

Referenced by h().

Here is the call graph for this function:

◆ lower_bound()

DConstIter woss::SSP::lower_bound ( const PDouble depth) const
inline

Returns a const iterator to the sound speed value with key >= of depth parameter

Parameters
depthconst reference to a PDouble depth value
Returns
const iterator to end() if depth is not found

References ssp_map.

◆ operator=() [1/2]

SSP & woss::SSP::operator= ( const SSP x)
default

Assignment operator

Parameters
copyconst reference to a SSP object to be copied
Returns
SSP reference to this

◆ operator=() [2/2]

SSP & woss::SSP::operator= ( SSP &&  tmp)
default

Move Assignment operator

Parameters
tmprvalue reference to a SSP object to be copied
Returns
SSP reference to this

◆ pressure_begin()

DConstIter woss::SSP::pressure_begin ( ) const
inline

Returns a const iterator to the begin of the pressure map

Returns
const iterator

References pressure_map.

◆ pressure_end()

DConstIter woss::SSP::pressure_end ( ) const
inline

Returns a const iterator to the end of the pressure map

Returns
const iterator

References pressure_map.

◆ pressure_find()

DConstIter woss::SSP::pressure_find ( const PDouble depth) const
inline

Returns a const iterator to the pressure value with key == depth parameter

Parameters
depthconst reference to a PDouble depth value
Returns
const iterator to pressure_end() if depth is not found

References pressure_map.

◆ pressure_lower_bound()

DConstIter woss::SSP::pressure_lower_bound ( const PDouble depth) const
inline

Returns a const iterator to the pressure value with key >= of depth parameter

Parameters
depthconst reference to a PDouble depth value
Returns
const iterator to pressure_end() if depth is not found

References pressure_map.

◆ pressure_rbegin()

DConstRIter woss::SSP::pressure_rbegin ( ) const
inline

Returns a const reverse iterator to the reverse begin of the pressure map

Returns
const reverse iterator

References pressure_map.

◆ pressure_rend()

DConstRIter woss::SSP::pressure_rend ( ) const
inline

Returns a const reverse iterator to the reverse end of the pressure map

Returns
const reverse iterator

References pressure_map.

◆ pressure_upper_bound()

DConstIter woss::SSP::pressure_upper_bound ( const PDouble depth) const
inline

Returns a const iterator to the pressure value with key > of depth parameter

Parameters
depthconst reference to a PDouble depth value
Returns
const iterator to pressure_end() if depth is not found

References pressure_map.

◆ randomize()

std::unique_ptr< SSP > SSP::randomize ( double  ratio_incr_value) const
virtual

Performs a random perturbation of sound speed values with given ratio

Parameters
ratio_incr_valueperturbation ratio
Returns
a std::unique_ptr to a heap allocated woss::SSP object

References create(), depth_precision, woss::Singleton< T >::instance(), isValid(), and ssp_map.

Referenced by woss::BellhopWoss::writeNormalizedSSP().

Here is the call graph for this function:

◆ rbegin()

DConstRIter woss::SSP::rbegin ( ) const
inline

Returns a const reverse iterator to the reverse beginning of the sound speed map

Returns
const reverse iterator

References ssp_map.

◆ rend()

DConstRIter woss::SSP::rend ( ) const
inline

Returns a const reverse iterator to the reverse end of the sound speed map

Returns
const reverse iterator

References ssp_map.

◆ salinity_begin()

DConstIter woss::SSP::salinity_begin ( ) const
inline

Returns a const iterator to the beginning of the salinity map

Returns
const reverse iterator

References salinity_map.

◆ salinity_end()

DConstIter woss::SSP::salinity_end ( ) const
inline

Returns a const iterator to the end of the salinity map

Returns
const reverse iterator

References salinity_map.

◆ salinity_find()

DConstIter woss::SSP::salinity_find ( const PDouble depth) const
inline

Returns a const iterator to the salinity value with key > of depth parameter

Parameters
depthconst reference to a PDouble depth value
Returns
const iterator to salinity_end() if depth is not found

References salinity_map.

◆ salinity_lower_bound()

DConstIter woss::SSP::salinity_lower_bound ( const PDouble depth) const
inline

Returns a const iterator to the salinity value with key >= of depth parameter

Parameters
depthconst reference to a PDouble depth value
Returns
const iterator to salinity_end() if depth is not found

References salinity_map.

◆ salinity_rbegin()

DConstRIter woss::SSP::salinity_rbegin ( ) const
inline

Returns a const reverse iterator to the reverse beginning of the salinity map

Returns
const reverse iterator

References salinity_map.

◆ salinity_rend()

DConstRIter woss::SSP::salinity_rend ( ) const
inline

Returns a const reverse iterator to the reverse end of the salinity map

Returns
const reverse iterator

References salinity_map.

◆ salinity_upper_bound()

DConstIter woss::SSP::salinity_upper_bound ( const PDouble depth) const
inline

Returns a const iterator to the salinity value with key > of depth parameter

Parameters
depthconst reference to a PDouble depth value
Returns
const iterator to salinity_end() if depth is not found

References salinity_map.

◆ setDebug()

static void woss::SSP::setDebug ( bool  flag)
inlinestatic

Sets debug flag for all instances

Parameters
flagdebug bool

References debug.

◆ setDepthPrecision()

void SSP::setDepthPrecision ( long double  prec)
virtual

Sets the sound speed profile depth precision for all PDouble depth values. If the given precision is different from current value, the profile will be modified accordingly

Parameters
precdepth precision [m]

References depth_precision, pressure_map, salinity_map, ssp_map, and temperature_map.

◆ setSSPEqType()

SSP & woss::SSP::setSSPEqType ( SSPEqType  eq_type)
inline

Sets the SSP EQ that should be used by when inserting data

Parameters
eq_typevalid SSPEqType
Returns
reference to *this

References ssp_eq_type.

◆ size()

int woss::SSP::size ( ) const
inline

Returns the number of sound speed values stored

Returns
number of sound speed values stored

References ssp_map.

◆ temperature_begin()

DConstIter woss::SSP::temperature_begin ( ) const
inline

Returns a const iterator to the beginning of the temperature map

Returns
const reverse iterator

References temperature_map.

◆ temperature_end()

DConstIter woss::SSP::temperature_end ( ) const
inline

Returns a const iterator to the end of the temperature map

Returns
const reverse iterator

References temperature_map.

◆ temperature_find()

DConstIter woss::SSP::temperature_find ( const PDouble depth) const
inline

Returns a const iterator to the temperature value with key == of depth parameter

Parameters
depthconst reference to a PDouble depth value
Returns
const iterator to temperature_end() if depth is not found

References temperature_map.

◆ temperature_lower_bound()

DConstIter woss::SSP::temperature_lower_bound ( const PDouble depth) const
inline

Returns a const iterator to the temperature value with key >= of depth parameter

Parameters
depthconst reference to a PDouble depth value
Returns
const iterator to temperature_end() if depth is not found

References temperature_map.

◆ temperature_rbegin()

DConstRIter woss::SSP::temperature_rbegin ( ) const
inline

Returns a const reverse iterator to the reverse beginning of the temperature map

Returns
const reverse iterator

References temperature_map.

◆ temperature_rend()

DConstRIter woss::SSP::temperature_rend ( ) const
inline

Returns a const reverse iterator to the reverse end of the temperature map

Returns
const reverse iterator

References temperature_map.

◆ temperature_upper_bound()

DConstIter woss::SSP::temperature_upper_bound ( const PDouble depth) const
inline

Returns a const iterator to the temperature value with key > of depth parameter

Parameters
depthconst reference to a PDouble depth value
Returns
const iterator to temperature_end() if depth is not found

References temperature_map.

◆ thyh()

constexpr double woss::SSP::thyh ( double  z) const
inlineconstexprprivate

Equation for pressure from depth conversion ( Leroy and Parthiot )

Parameters
zdepth [m]

Referenced by getPressureFromDepth().

◆ transform()

std::unique_ptr< SSP > SSP::transform ( const Coord coordinates,
double  new_min_depth = -HUGE_VAL,
double  new_max_depth = HUGE_VAL,
int  total_depth_steps = SSP_CUSTOM_DEPTH_STEPS 
) const
virtual

Transform the sound speed profile. If the current ssp can't be transformed it returns a not valid SSP. If both depth are not changed while depth steps is increased, all data will be linearly interpolated. If the SSP is extended in depth, sound speed will be calculated from last known temperature and salinity, while pressure will be calculated from depth conversion.

Parameters
coordinatescoordinates for pressure, depth conversion corrections
new_min_depthmiminum depth [m] of the new SSP
new_max_depthmaximum depth [m] of the new SSP
total_depth_stepsnumber of depths of the new SSP
Returns
a std::unique_ptr to a heap allocated woss::SSP object

References calculateSSP(), create(), debug, depth_precision, getPressureFromDepth(), isRandomizable(), isTransformable(), woss::Coord::isValid(), pressure_map, salinity_map, ssp_map, and temperature_map.

Here is the call graph for this function:

◆ truncate()

std::unique_ptr< SSP > SSP::truncate ( double  max_depth) const
virtual

It returns a new SSP object, truncated at the input depth. If the current ssp can't be truncated it returns a not valid SSP.

Parameters
max_depthtruncation depth [m]
Returns
a std::unique_ptr to a heap allocated woss::SSP object

References clone(), create(), and debug.

Here is the call graph for this function:

◆ upper_bound()

DConstIter woss::SSP::upper_bound ( const PDouble depth) const
inline

Returns a const iterator to the sound speed value with key > of depth parameter

Parameters
depthconst reference to a PDouble depth value
Returns
const iterator to end() if depth is not found

References ssp_map.

◆ write()

bool SSP::write ( std::ostream &  stream_out) const
virtual

Write values out to the given stream

Parameters
stream_outconst reference to an ostream instance
Returns
true if method was successful, false otherwise

References pressure_map, salinity_map, ssp_map, and temperature_map.

Friends And Related Symbol Documentation

◆ operator!=

bool operator!= ( const SSP left,
const SSP right 
)
friend

Inequality operator

Parameters
leftleft operand const reference
rightright operand const reference
Returns
true if left == right, false otherwise

◆ operator* [1/3]

const SSP operator* ( const double  left,
const SSP right 
)
friend

Multiplication operator

Parameters
leftleft operand const reference
rightright operand const reference
Returns
a new const instance holding the operation result

◆ operator* [2/3]

const SSP operator* ( const SSP left,
const double  right 
)
friend

Multiplication operator

Parameters
leftleft operand const reference
rightright operand const reference
Returns
a new const instance holding the operation result

◆ operator* [3/3]

const SSP operator* ( const SSP left,
const SSP right 
)
friend

Multiplication operator

Parameters
leftleft operand const reference
rightright operand const reference
Returns
a new const instance holding the operation result

◆ operator*= [1/2]

SSP & operator*= ( SSP left,
const double  right 
)
friend

Compound assignment multiplication operator

Parameters
leftleft operand reference
rightright operand const reference
Returns
left reference after the operation

◆ operator*= [2/2]

SSP & operator*= ( SSP left,
const SSP right 
)
friend

Compound assignment multiplication operator

Parameters
leftleft operand reference
rightright operand const reference
Returns
left reference after the operation

◆ operator+ [1/3]

const SSP operator+ ( const double  left,
const SSP right 
)
friend

Sum operator

Parameters
leftleft operand const reference
rightright operand const reference
Returns
a new const instance holding the operation result

◆ operator+ [2/3]

const SSP operator+ ( const SSP left,
const double  right 
)
friend

Sum operator

Parameters
leftleft operand const reference
rightright operand const reference
Returns
a new const instance holding the operation result

◆ operator+ [3/3]

const SSP operator+ ( const SSP left,
const SSP right 
)
friend

Sum operator

Parameters
leftleft operand const reference
rightright operand const reference
Returns
a const instance holding the operation result

◆ operator+= [1/2]

SSP & operator+= ( SSP left,
const double  right 
)
friend

Compound assignment sum operator

Parameters
leftleft operand reference
rightright operand const reference
Returns
left reference after the operation

◆ operator+= [2/2]

SSP & operator+= ( SSP left,
const SSP right 
)
friend

Compound assignment sum operator

Parameters
leftleft operand reference
rightright operand const reference
Returns
left reference after the operation

◆ operator- [1/3]

const SSP operator- ( const double  left,
const SSP right 
)
friend

Subtraction operator

Parameters
leftleft operand const reference
rightright operand const reference
Returns
a new const instance holding the operation result

◆ operator- [2/3]

const SSP operator- ( const SSP left,
const double  right 
)
friend

Subtraction operator

Parameters
leftleft operand const reference
rightright operand const reference
Returns
a new const instance holding the operation result

◆ operator- [3/3]

const SSP operator- ( const SSP left,
const SSP right 
)
friend

Subtraction operator

Parameters
leftleft operand const reference
rightright operand const reference
Returns
a new const instance holding the operation result

◆ operator-= [1/2]

SSP & operator-= ( SSP left,
const double  right 
)
friend

Compound assignment subtraction operator

Parameters
leftleft operand reference
rightright operand const reference
Returns
left reference after the operation

◆ operator-= [2/2]

SSP & operator-= ( SSP left,
const SSP right 
)
friend

Compound assignment subtraction operator

Parameters
leftleft operand reference
rightright operand const reference
Returns
left reference after the operation

◆ operator/ [1/3]

const SSP operator/ ( const double  left,
const SSP right 
)
friend

Division operator

Parameters
leftleft operand const reference
rightright operand const reference
Returns
a new const instance holding the operation result

◆ operator/ [2/3]

const SSP operator/ ( const SSP left,
const double  right 
)
friend

Division operator

Parameters
leftleft operand const reference
rightright operand const reference
Returns
a new const instance holding the operation result

◆ operator/ [3/3]

const SSP operator/ ( const SSP left,
const SSP right 
)
friend

Division operator

Parameters
leftleft operand const reference
rightright operand const reference
Returns
a new const instance holding the operation result

◆ operator/= [1/2]

SSP & operator/= ( SSP left,
const double  right 
)
friend

Compound assignment division operator

Parameters
leftleft operand reference
rightright operand const reference
Returns
left reference after the operation

◆ operator/= [2/2]

SSP & operator/= ( SSP left,
const SSP right 
)
friend

Compound assignment division operator

Parameters
leftleft operand reference
rightright operand const reference
Returns
left reference after the operation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const SSP instance 
)
friend

<< operator

Parameters
osleft operand ostream reference
instanceright operand const SSP reference
Returns
os reference after the operation

◆ operator==

bool operator== ( const SSP left,
const SSP right 
)
friend

Equality operator

Parameters
leftleft operand const reference
rightright operand const reference
Returns
true if left == right, false otherwise

◆ operator>>

std::ostream & operator>> ( std::istream &  is,
const SSP instance 
)
friend

‍operator

Parameters
osleft operand ostream reference
instanceright operand const SSP reference
Returns
os reference after the operation

Member Data Documentation

◆ debug

bool SSP::debug = false
staticprotected

Stores the common debug flag

Referenced by import(), setDebug(), transform(), and truncate().

◆ depth_precision

long double woss::SSP::depth_precision
protected

◆ max_ssp_value

double woss::SSP::max_ssp_value
protected

Stores the maximum sound speed value [m/s]

Referenced by getMaxSSPValue(), insertValue(), insertValue(), insertValue(), and insertValue().

◆ min_ssp_value

double woss::SSP::min_ssp_value
protected

Stores the miminum sound speed value [m/s]

Referenced by getMinSSPValue(), insertValue(), insertValue(), insertValue(), and insertValue().

◆ pressure_map

◆ salinity_map

◆ ssp_eq_type

SSPEqType woss::SSP::ssp_eq_type
protected

Stores the SSP eq type that should be used

Referenced by calculateSSP(), getSSPEqType(), and setSSPEqType().

◆ ssp_map

◆ temperature_map


The documentation for this class was generated from the following files: