LSDTopoTools
 All Classes Files Functions Variables Friends Pages
Public Member Functions | Protected Attributes | List of all members
rainGrid Class Reference

rainGrid is a class used to store and manipulate rainfall data. It can be used to interpolate or downscale rainfall data from coarser resolutions/grid spacings. More...

#include <LSDRainfallRunoff.hpp>

Public Member Functions

 rainGrid ()
 Default constructor – throws an error.
 
 rainGrid (std::vector< std::vector< float > > &rain_data, TNT::Array2D< int > &hydroindex, int imax, int jmax, int current_rainfall_timestep, int rf_num)
 
void interpolateRainfall_RectBivariateSpline (rainGrid &raingrid)
 
void interpolateRainfall_RectTrivariateSpline (rainGrid &raingrid, const TNT::Array2D< double > &elevation)
 
void ReShapeRainfallData_2DArray ()
 
void downscaleRainfallData ()
 
void write_rainGrid_to_raster_file (double xmin, double ymin, double cellsize, std::string RAINGRID_FNAME, std::string RAINGRID_EXTENSION)
 
double get_rainfall (int i, int j) const
 Getter for getting rainfall value.
 

Protected Attributes

TNT::Array2D< double > rainfallgrid2D
 
TNT::Array3D< double > rainfallgrid3D
 

Detailed Description

rainGrid is a class used to store and manipulate rainfall data. It can be used to interpolate or downscale rainfall data from coarser resolutions/grid spacings.

Author
DAV

Constructor & Destructor Documentation

rainGrid::rainGrid ( std::vector< std::vector< float > > &  rain_data,
TNT::Array2D< int > &  hydroindex,
int  imax,
int  jmax,
int  current_rainfall_timestep,
int  rf_num 
)
inline

Create a raingrid from the rainfall data vector, and the raster or model domain dimensions, for the current timestep only. Specify an interpolation method

Member Function Documentation

void rainGrid::downscaleRainfallData ( )

Downscales the 2d rainfall array to a resampled, higher resolution array, with the same grid spacing, and dimensions as the model or raste rdomain.

Note
This is actually done by the create() function for now, but it should probably go in its own method.
void rainGrid::interpolateRainfall_RectBivariateSpline ( rainGrid raingrid)

Create rainGrid from interpolating between sparse points and x, y coord TODO Takes a 2D array of regular gridded rainfall and interpolates it according to a Bivariate Spline. Similar to sciPy's scipy.interpolate.RectBivariateSpline

void rainGrid::interpolateRainfall_RectTrivariateSpline ( rainGrid raingrid,
const TNT::Array2D< double > &  elevation 
)

Will take a 2D array of regular gridded rainfall and interpolates it based on a TRI-variate spline. I.e. interpolates based on an extra third variable which would be terrain in most cases (see Tait et al 2006, for example)

void rainGrid::ReShapeRainfallData_2DArray ( )

Takes the rainfall data for a current timestep and reshapes it into a 2D array.

void rainGrid::write_rainGrid_to_raster_file ( double  xmin,
double  ymin,
double  cellsize,
std::string  RAINGRID_FNAME,
std::string  RAINGRID_EXTENSION 
)

Writes the 2D upscaled and/or interpolated rainfall grid to a raster output file for checking.

Member Data Documentation

TNT::Array2D<double> rainGrid::rainfallgrid2D
protected

For a single instance of a 2D rainfall grid, matching the dimensions of the model domain.

TNT::Array3D<double> rainGrid::rainfallgrid3D
protected

Experimental - stores grids of rainfall data for every rainfall timestep: Warning - this could be a massive object!


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