Parallel Analog Ensemble
Public Member Functions | Static Public Attributes | Private Member Functions | Friends | List of all members
ForecastsPointer Class Reference

ForecastsPointer is an implementation of the abstract class Forecasts. It also inherits from Array4DPointer so that the underlying data structure is handled by a pointer which is optimized for performance. More...

#include <ForecastsPointer.h>

Inheritance diagram for ForecastsPointer:
Forecasts Array4DPointer Array4D BasicData Array4D

Public Member Functions

 ForecastsPointer ()
 
 ForecastsPointer (const ForecastsPointer &orig)
 
 ForecastsPointer (const Parameters &, const Stations &, const Times &, const Times &)
 
virtual ~ForecastsPointer ()
 
virtual void setDimensions (const Parameters &parameters, const Stations &stations, const Times &times, const Times &flts) override
 
virtual void windTransform (const std::string &name_u, const std::string &name_v, const std::string &name_spd, const std::string &name_dir) override
 
virtual void subset (Forecasts &forecasts_subset) const override
 
virtual void subset (const Parameters &, const Stations &, const Times &, const Times &, Forecasts &) const override
 
virtual void print (std::ostream &) const override
 
- Public Member Functions inherited from Forecasts
 Forecasts ()
 
 Forecasts (Forecasts const &orig)
 
 Forecasts (const Parameters &, const Stations &, const Times &, const Times &)
 
virtual ~Forecasts ()
 
Times const & getFLTs () const
 
TimesgetFLTs ()
 
std::size_t getFltTimeStamp (std::size_t index) const
 
std::size_t getFltTimeIndex (std::size_t timestamp) const
 
std::size_t getFltTimeIndex (const Time &) const
 
const GridgetGrid () const
 
void setGrid (const std::string &grid_file, Verbose verbose=Verbose::Warning)
 
Forecastsoperator= (const Forecasts &)
 
- Public Member Functions inherited from Array4D
 Array4D ()=default
 
 Array4D (const Array4D &orig)=default
 
virtual ~Array4D ()=default
 
- Public Member Functions inherited from BasicData
 BasicData ()
 
 BasicData (const Parameters &, const Stations &, const Times &)
 
 BasicData (const BasicData &orig)
 
virtual ~BasicData ()
 
void setMembers (const Parameters &, const Stations &, const Times &)
 
const ParametersgetParameters () const
 
const StationsgetStations () const
 
const TimesgetTimes () const
 
ParametersgetParameters ()
 
StationsgetStations ()
 
TimesgetTimes ()
 
std::size_t getTimeStamp (std::size_t index) const
 
std::size_t getTimeIndex (std::size_t timestamp) const
 
std::size_t getTimeIndex (const Time &) const
 
BasicDataoperator= (const BasicData &)
 
- Public Member Functions inherited from Array4DPointer
 Array4DPointer ()
 
 Array4DPointer (const Array4DPointer &orig)
 
 Array4DPointer (std::size_t, std::size_t, std::size_t, std::size_t)
 
virtual ~Array4DPointer ()
 
virtual const std::size_t * shape () const override
 
virtual std::size_t num_elements () const override
 
virtual const double * getValuesPtr () const override
 
virtual double * getValuesPtr () override
 
virtual void resize (std::size_t, std::size_t, std::size_t, std::size_t) override
 
virtual void resize (const Array4D &) override
 
virtual void initialize (double value) override
 
virtual double getValue (std::size_t, std::size_t, std::size_t, std::size_t) const override
 
virtual void setValue (double val, std::size_t, std::size_t, std::size_t, std::size_t) override
 
virtual void subset (const std::vector< std::size_t > &, const std::vector< std::size_t > &, const std::vector< std::size_t > &, const std::vector< std::size_t > &, Array4D &) const override
 
Array4DPointeroperator= (const Array4DPointer &)
 
bool operator== (const Array4DPointer &) const
 

Static Public Attributes

static const size_t _DIM_PARAMETER = 0
 
static const size_t _DIM_STATION = 1
 
static const size_t _DIM_TIME = 2
 
static const size_t _DIM_FLT = 3
 
- Static Public Attributes inherited from Array4DPointer
static const double _DEFAULT_VALUE = NAN
 

Private Member Functions

void subset_data_ (const Parameters &, const Stations &, const Times &, const Times &, Forecasts &) const
 

Friends

std::ostream & operator<< (std::ostream &, const ForecastsPointer &)
 

Additional Inherited Members

- Protected Member Functions inherited from Array4DPointer
std::size_t toIndex_ (std::size_t, std::size_t, std::size_t, std::size_t) const
 
void allocateMemory_ ()
 
- Protected Attributes inherited from Forecasts
Times flts_
 
Grid grid_
 
- Protected Attributes inherited from BasicData
Parameters parameters_
 
Stations stations_
 
Times times_
 
- Protected Attributes inherited from Array4DPointer
vector4 dims_
 
double * data_
 
bool allocated_
 

Detailed Description

ForecastsPointer is an implementation of the abstract class Forecasts. It also inherits from Array4DPointer so that the underlying data structure is handled by a pointer which is optimized for performance.

Constructor & Destructor Documentation

◆ ForecastsPointer() [1/3]

ForecastsPointer::ForecastsPointer ( )

◆ ForecastsPointer() [2/3]

ForecastsPointer::ForecastsPointer ( const ForecastsPointer orig)

◆ ForecastsPointer() [3/3]

ForecastsPointer::ForecastsPointer ( const Parameters parameters,
const Stations stations,
const Times times,
const Times flts 
)

◆ ~ForecastsPointer()

ForecastsPointer::~ForecastsPointer ( )
virtual

Member Function Documentation

◆ print()

void ForecastsPointer::print ( std::ostream &  ) const
overridevirtual

Reimplemented from Array4DPointer.

◆ setDimensions()

void ForecastsPointer::setDimensions ( const Parameters parameters,
const Stations stations,
const Times times,
const Times flts 
)
overridevirtual

Sets the dimensions of forecasts and allocates memory for data values.

Parameters
parametersThe Parameters container.
stationsThe Stations container.
timesThe Times container.
fltsThe FLTs container.

Implements Forecasts.

◆ subset() [1/2]

void ForecastsPointer::subset ( const Parameters parameters,
const Stations stations,
const Times times,
const Times flts,
Forecasts forecasts_subset 
) const
overridevirtual

Implements Forecasts.

◆ subset() [2/2]

void ForecastsPointer::subset ( Forecasts forecasts_subset) const
overridevirtual

Implements Forecasts.

◆ subset_data_()

void ForecastsPointer::subset_data_ ( const Parameters parameters,
const Stations stations,
const Times times,
const Times flts,
Forecasts forecasts_subset 
) const
private

◆ windTransform()

void ForecastsPointer::windTransform ( const std::string &  name_u,
const std::string &  name_v,
const std::string &  name_spd,
const std::string &  name_dir 
)
overridevirtual

In some forecast model output, wind components U and V are available, but not wind speed and direction. This function is used to calculate wind speed and direction from U and V components.

Note that U will be replaced by wind speed and V will be replaced by wind direction.

Parameters
name_uParameter name for U component of wind
name_vParameter name for V component of wind
name_spdParameter name for wind speed
name_dirParameter name for wind direction

Implements Forecasts.

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  ,
const ForecastsPointer  
)
friend

Member Data Documentation

◆ _DIM_FLT

const size_t ForecastsPointer::_DIM_FLT = 3
static

◆ _DIM_PARAMETER

const size_t ForecastsPointer::_DIM_PARAMETER = 0
static

◆ _DIM_STATION

const size_t ForecastsPointer::_DIM_STATION = 1
static

◆ _DIM_TIME

const size_t ForecastsPointer::_DIM_TIME = 2
static

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