Parallel Analog Ensemble
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
AnEnReadNcdf Class Reference

AnEnReadNcdf provides the functionality to read the NetCDF format. The recognized NetCDF file structure is below. More...

#include <AnEnReadNcdf.h>

Public Types

enum class  FileType { Forecasts , Observations , Analogs }
 

Public Member Functions

 AnEnReadNcdf ()
 
 AnEnReadNcdf (Verbose verbose)
 
 AnEnReadNcdf (const AnEnReadNcdf &orig)
 
virtual ~AnEnReadNcdf ()
 
void readForecasts (const std::string &file_path, Forecasts &forecasts) const
 
void readForecasts (const std::string &file_path, Forecasts &forecasts, int station_start, int station_count) const
 
void readForecasts (const std::string &file_path, Forecasts &forecasts, std::vector< size_t > start, std::vector< size_t > count) const
 
void readObservations (const std::string &file_path, Observations &observations) const
 
void readObservations (const std::string &file_path, Observations &observations, int station_start, int station_count) const
 
void readObservations (const std::string &file_path, Observations &observations, std::vector< size_t > start, std::vector< size_t > count) const
 
void readAnalogs (const std::string &file_path, Array4D &analogs, const std::string &var_name=Config::_ANALOGS, std::vector< size_t > start={}, std::vector< size_t > count={})
 
void read (const netCDF::NcGroup &nc, Parameters &parameters, size_t start=0, size_t count=0) const
 
void read (const netCDF::NcGroup &nc, Stations &stations, size_t start=0, size_t count=0, const std::string &dim_name_prefix="", const std::string &var_name_prefix="") const
 
void read (const netCDF::NcGroup &nc, Times &times, const std::string &var_name, size_t start=0, size_t count=0) const
 
template<typename T >
void read (const netCDF::NcGroup &nc, T *p_vals, const std::string &var_name=Config::_DATA, std::vector< size_t > start={}, std::vector< size_t > count={}) const
 

Protected Member Functions

void checkFileType_ (const netCDF::NcFile &nc, FileType file_type) const
 

Protected Attributes

Verbose verbose_
 

Detailed Description

AnEnReadNcdf provides the functionality to read the NetCDF format. The recognized NetCDF file structure is below.

https://weiming-hu.github.io/AnalogsEnsemble/2019/01/16/NetCDF-File-Types.html

Member Enumeration Documentation

◆ FileType

enum class AnEnReadNcdf::FileType
strong
Enumerator
Forecasts 
Observations 
Analogs 

Constructor & Destructor Documentation

◆ AnEnReadNcdf() [1/3]

AnEnReadNcdf::AnEnReadNcdf ( )

◆ AnEnReadNcdf() [2/3]

AnEnReadNcdf::AnEnReadNcdf ( Verbose  verbose)

◆ AnEnReadNcdf() [3/3]

AnEnReadNcdf::AnEnReadNcdf ( const AnEnReadNcdf orig)

◆ ~AnEnReadNcdf()

AnEnReadNcdf::~AnEnReadNcdf ( )
virtual

Member Function Documentation

◆ checkFileType_()

void AnEnReadNcdf::checkFileType_ ( const netCDF::NcFile &  nc,
FileType  file_type 
) const
protected

◆ read() [1/4]

void AnEnReadNcdf::read ( const netCDF::NcGroup &  nc,
Parameters parameters,
size_t  start = 0,
size_t  count = 0 
) const

Read different components from an NetCDF group object

Parameters
ncNcGroup to read
parametersParameters to store results
stationsStations to store results
timesTimes to store results
var_nameVariable names to read for times
startIndex to start reading
countTotal numbers to read

◆ read() [2/4]

void AnEnReadNcdf::read ( const netCDF::NcGroup &  nc,
Stations stations,
size_t  start = 0,
size_t  count = 0,
const std::string &  dim_name_prefix = "",
const std::string &  var_name_prefix = "" 
) const

◆ read() [3/4]

template<typename T >
void AnEnReadNcdf::read ( const netCDF::NcGroup &  nc,
T *  p_vals,
const std::string &  var_name = Config::_DATA,
std::vector< size_t >  start = {},
std::vector< size_t >  count = {} 
) const

◆ read() [4/4]

void AnEnReadNcdf::read ( const netCDF::NcGroup &  nc,
Times times,
const std::string &  var_name,
size_t  start = 0,
size_t  count = 0 
) const

◆ readAnalogs()

void AnEnReadNcdf::readAnalogs ( const std::string &  file_path,
Array4D analogs,
const std::string &  var_name = Config::_ANALOGS,
std::vector< size_t >  start = {},
std::vector< size_t >  count = {} 
)

◆ readForecasts() [1/3]

void AnEnReadNcdf::readForecasts ( const std::string &  file_path,
Forecasts forecasts 
) const

◆ readForecasts() [2/3]

void AnEnReadNcdf::readForecasts ( const std::string &  file_path,
Forecasts forecasts,
int  station_start,
int  station_count 
) const

◆ readForecasts() [3/3]

void AnEnReadNcdf::readForecasts ( const std::string &  file_path,
Forecasts forecasts,
std::vector< size_t >  start,
std::vector< size_t >  count 
) const

◆ readObservations() [1/3]

void AnEnReadNcdf::readObservations ( const std::string &  file_path,
Observations observations 
) const

◆ readObservations() [2/3]

void AnEnReadNcdf::readObservations ( const std::string &  file_path,
Observations observations,
int  station_start,
int  station_count 
) const

◆ readObservations() [3/3]

void AnEnReadNcdf::readObservations ( const std::string &  file_path,
Observations observations,
std::vector< size_t >  start,
std::vector< size_t >  count 
) const

Member Data Documentation

◆ verbose_

Verbose AnEnReadNcdf::verbose_
protected

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