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

WossDb for custom made NetCDF DECK41 Sediment database. More...

#include <sediment-deck41-coord-db.h>

Inheritance diagram for woss::SedimDeck41CoordDb:
Inheritance graph
Collaboration diagram for woss::SedimDeck41CoordDb:
Collaboration graph

Public Member Functions

 SedimDeck41CoordDb (const ::std::string &name=DB_NAME_NOT_SET)
 
 SedimDeck41CoordDb (const ::std::string &name, DECK41DbType db_type)
 
Deck41Types getSeaFloorType (const Coord &coordinates) const
 
virtual bool finalizeConnection ()
 
virtual bool isValid ()
 
void setDeck41DbType (DECK41DbType db_type)
 
DECK41DbType getDeck41DbType () const
 
- Public Member Functions inherited from woss::WossNetcdfDb
 WossNetcdfDb (const ::std::string &name)
 
virtual bool openConnection ()
 
virtual bool closeConnection ()
 
- Public Member Functions inherited from woss::WossDb
 WossDb (const ::std::string &name)
 
void setDbName (const ::std::string &pathname)
 
::std::string getDbName () const
 
void setDebug (double flag=true)
 
bool isUsingDebug () const
 
virtual bool isValid ()
 
virtual bool openConnection ()=0
 
virtual bool finalizeConnection ()=0
 
virtual bool closeConnection ()=0
 

Protected Member Functions

int getSedimIndex (const Coord &coords) const
 
::std::pair< int, int > getSedimIndexes (const Coord &coordinates) const
 
- Protected Member Functions inherited from woss::WossDb
PathName getPathName (const ::std::string &complete_path)
 

Protected Attributes

netCDF::NcVar main_sedim_var_coord
 
NcVar * main_sedim_var_coord
 
netCDF::NcVar sec_sedim_var_coord
 
NcVar * sec_sedim_var_coord
 
netCDF::NcVar lat_var
 
NcVar * lat_var
 
netCDF::NcVar lon_var
 
NcVar * lon_var
 
DECK41DbType deck41_db_type
 
- Protected Attributes inherited from woss::WossNetcdfDb
netCDF::NcFile * netcdf_db
 
NcFile * netcdf_db
 
- Protected Attributes inherited from woss::WossDb
::std::string db_name
 
bool debug
 

Detailed Description

WossDb for custom made NetCDF DECK41 Sediment database.

SedimDeck41Db implements WossNetcdfDb for the custom made NetCDF DECK41 Sediment database

Constructor & Destructor Documentation

◆ SedimDeck41CoordDb() [1/2]

SedimDeck41CoordDb::SedimDeck41CoordDb ( const ::std::string &  name = DB_NAME_NOT_SET)

SedimDeck41CoordDb default constructor. Default constructed object are not valid

Parameters
namepathname of database

References woss::DECK41_DB_V1_TYPE.

◆ SedimDeck41CoordDb() [2/2]

SedimDeck41CoordDb::SedimDeck41CoordDb ( const ::std::string &  name,
DECK41DbType  db_type 
)

SedimDeck41CoordDb default constructor. Default constructed object are not valid

Parameters
namepathname of database
db_typeDECK41 db type

Member Function Documentation

◆ finalizeConnection()

bool SedimDeck41CoordDb::finalizeConnection ( )
virtual

Post openConnection() actions, used to create and initialize NetCDF variables

Returns
true if method was successful, false otherwise

Implements woss::WossDb.

References woss::DECK41_DB_INVALID_TYPE, deck41_db_type, woss::DECK41_DB_V2_TYPE, lat_var, lon_var, main_sedim_var_coord, woss::WossNetcdfDb::netcdf_db, and sec_sedim_var_coord.

◆ getDeck41DbType()

DECK41DbType woss::SedimDeck41CoordDb::getDeck41DbType ( ) const
inline

Returns the current DECK41 DB type

Returns
current deck41 db type

References deck41_db_type.

◆ getSeaFloorType()

Deck41Types SedimDeck41CoordDb::getSeaFloorType ( const Coord coordinates) const

Returns a Deck41Types for the given coordinates

Parameters
coordinatesconst reference to a valid Coord object
Returns
a Deck41Types value ( main type value, secondary type value )

References woss::WossDb::debug, deck41_db_type, woss::DECK41_DB_V1_TYPE, woss::DECK41_DB_V2_TYPE, woss::Coord::getLatitude(), getSedimIndex(), getSedimIndexes(), lat_var, lon_var, main_sedim_var_coord, and sec_sedim_var_coord.

Referenced by woss::SedimDeck41Db::getDeck41TypesFromCoords().

Here is the call graph for this function:

◆ getSedimIndex()

int SedimDeck41CoordDb::getSedimIndex ( const Coord coords) const
protected

Returns the index used by a NetCDF variable to get the DECK41 floortype integer value

Parameters
coordinatesconst reference to a valid Coord object
Returns
index value

References woss::Coord::getLatitude().

Referenced by getSeaFloorType().

Here is the call graph for this function:

◆ getSedimIndexes()

std::pair< int, int > SedimDeck41CoordDb::getSedimIndexes ( const Coord coordinates) const
protected

Returns the index pair used by a NetCDF variable to get the DECK41 floortype integer value

Parameters
coordinatesconst reference to a valid Coord object
Returns
index pair

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

Referenced by getSeaFloorType().

Here is the call graph for this function:

◆ isValid()

virtual bool woss::SedimDeck41CoordDb::isValid ( )
inlinevirtual

Checks the validity of SedimDeck41CoordDb

Returns
true if pathname is valid, false otherwise

Reimplemented from woss::WossDb.

References woss::WossDb::db_name, woss::DECK41_DB_INVALID_TYPE, deck41_db_type, and woss::WossDb::isValid().

Here is the call graph for this function:

◆ setDeck41DbType()

void woss::SedimDeck41CoordDb::setDeck41DbType ( DECK41DbType  db_type)
inline

Sets the current DECK41 Db type

Parameters
db_typeDECK41DbType

References deck41_db_type.

Referenced by woss::SedimDeck41DbCreator::initializeSedimDb().

Member Data Documentation

◆ deck41_db_type

DECK41DbType woss::SedimDeck41CoordDb::deck41_db_type
protected

◆ lat_var

netCDF::NcVar woss::SedimDeck41CoordDb::lat_var
protected

NetCDF latitude variable

Referenced by finalizeConnection(), and getSeaFloorType().

◆ lon_var

netCDF::NcVar woss::SedimDeck41CoordDb::lon_var
protected

NetCDF longitude variable

Referenced by finalizeConnection(), and getSeaFloorType().

◆ main_sedim_var_coord

netCDF::NcVar woss::SedimDeck41CoordDb::main_sedim_var_coord
protected

NetCDF variable representing main DECK41 floortype

Referenced by finalizeConnection(), and getSeaFloorType().

◆ sec_sedim_var_coord

netCDF::NcVar woss::SedimDeck41CoordDb::sec_sedim_var_coord
protected

NetCDF variable representing secondary DECK41 floortype

Referenced by finalizeConnection(), and getSeaFloorType().


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