bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
GeoFile Class Reference

#include <GeoFile.h>

Collaboration diagram for GeoFile:
Collaboration graph

Public Member Functions

void close_sidecar_file ()
 
 GeoFile (const std::string &data_file_name)
 Open and read the sidecar file for a given data file.
 
void get_stare_indices (const std::string &var_name, std::vector< STARE_ArrayIndexSpatialValue > &values)
 
size_t get_variable_cols (std::string variable_name) const
 
size_t get_variable_rows (std::string variable_name) const
 

Protected Member Functions

int read_sidecar_file (const std::string &file_name)
 Read a sidecar file.
 
std::string sanitize_pathname (string path) const
 Strip away path info. Use in error messages.
 
std::string sidecar_filename (const std::string &file_name) const
 

Detailed Description

This is the base class for a data file with geolocation.

Definition at line 49 of file GeoFile.h.

Constructor & Destructor Documentation

◆ GeoFile() [1/2]

GeoFile::GeoFile ( )
inline

Definition at line 87 of file GeoFile.h.

◆ GeoFile() [2/2]

GeoFile::GeoFile ( const std::string & data_file_name)
inlineexplicit

Open and read the sidecar file for a given data file.

Parameters
data_file_name

Definition at line 93 of file GeoFile.h.

◆ ~GeoFile()

virtual GeoFile::~GeoFile ( )
inlinevirtual

Definition at line 101 of file GeoFile.h.

Member Function Documentation

◆ close_sidecar_file()

void GeoFile::close_sidecar_file ( )

Close sidecar file.

Parameters
ncidID of the sidecar file.
Returns
0 for success, error code otherwise.

Definition at line 191 of file GeoFile.cc.

◆ get_stare_indices()

void GeoFile::get_stare_indices ( const std::string & var_name,
std::vector< STARE_ArrayIndexSpatialValue > & values )

Get the STARE indices for data variable.

Parameters
ncidID of the open sidecar file.
var_nameThe name of the data variable.
valuesValue-result parameter; holds the returned stare indices.
Returns
0 for success, NetCDF library error code otherwise.

Definition at line 137 of file GeoFile.cc.

◆ get_variable_cols()

size_t GeoFile::get_variable_cols ( std::string variable_name) const

Definition at line 172 of file GeoFile.cc.

◆ get_variable_rows()

size_t GeoFile::get_variable_rows ( std::string variable_name) const

Definition at line 160 of file GeoFile.cc.

◆ read_sidecar_file()

int GeoFile::read_sidecar_file ( const std::string & file_name)
protected

Read a sidecar file.

Open and read information (except the actual stare indices) from a STARE sidecar file. Each set of stare indices and the variables geolocation information they describe is recorded in the GeoFile instance.

The caller is responsible for calling close_sidecar_file().

Parameters
fileNameFull pathname of the sidecar file.
ncidValue-result parameter that returns the ncid of the open file
Returns
0 for success, netCDF error code otherwise.

Definition at line 56 of file GeoFile.cc.

◆ sanitize_pathname()

string GeoFile::sanitize_pathname ( string path) const
protected

Strip away path info. Use in error messages.

Parameters
pathFull pathname, etc., to a file.
Returns
Just the last part of a pathname

Definition at line 22 of file GeoFile.cc.

◆ sidecar_filename()

string GeoFile::sidecar_filename ( const std::string & file_name) const
protected

Get STARE index sidecar filename.

Definition at line 30 of file GeoFile.cc.


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