Gridpp 0.7.0
A post-processing library for gridded weather forecasts
Public Member Functions | List of all members
gridpp::Grid Class Reference

#include <gridpp.h>

Public Member Functions

bool get_box (float lat, float lon, int &Y1_out, int &X1_out, int &Y2_out, int &X2_out) const
 
ivec2 get_closest_neighbours (float lat, float lon, int num, bool include_match=true) const
 
CoordinateType get_coordinate_type () const
 
vec2 get_elevs () const
 
vec2 get_lafs () const
 
vec2 get_lats () const
 
vec2 get_lons () const
 
ivec get_nearest_neighbour (float lat, float lon, bool include_match=true) const
 
ivec2 get_neighbours (float lat, float lon, float radius, bool include_match=true) const
 
ivec2 get_neighbours_with_distance (float lat, float lon, float radius, vec &distances, bool include_match=true) const
 
int get_num_neighbours (float lat, float lon, float radius, bool include_match=true) const
 
Point get_point (int y_index, int x_index) const
 
 Grid ()
 
 Grid (vec2 lats, vec2 lons, vec2 elevs=vec2(), vec2 lafs=vec2(), CoordinateType type=Geodetic)
 Initialize a new grid. More...
 
ivec size () const
 
Points to_points () const
 Convert grid to a vector of points. More...
 

Detailed Description

Represents a 2D grid of locations and their metadata.

Constructor & Destructor Documentation

◆ Grid() [1/2]

gridpp::Grid::Grid ( )

◆ Grid() [2/2]

gridpp::Grid::Grid ( vec2  lats,
vec2  lons,
vec2  elevs = vec2(),
vec2  lafs = vec2(),
CoordinateType  type = Geodetic 
)

Initialize a new grid.

Parameters
lats2D vector of latitudes [degrees] (or y-values)
lons2D vector of longitudes [degrees] (or x-values)
elevs2D vector of elevations [m]
lafs2D vector of land area fractions [1]
typeCoordinate type

Member Function Documentation

◆ get_box()

bool gridpp::Grid::get_box ( float  lat,
float  lon,
int &  Y1_out,
int &  X1_out,
int &  Y2_out,
int &  X2_out 
) const

◆ get_closest_neighbours()

ivec2 gridpp::Grid::get_closest_neighbours ( float  lat,
float  lon,
int  num,
bool  include_match = true 
) const

◆ get_coordinate_type()

CoordinateType gridpp::Grid::get_coordinate_type ( ) const

◆ get_elevs()

vec2 gridpp::Grid::get_elevs ( ) const

◆ get_lafs()

vec2 gridpp::Grid::get_lafs ( ) const

◆ get_lats()

vec2 gridpp::Grid::get_lats ( ) const

◆ get_lons()

vec2 gridpp::Grid::get_lons ( ) const

◆ get_nearest_neighbour()

ivec gridpp::Grid::get_nearest_neighbour ( float  lat,
float  lon,
bool  include_match = true 
) const

◆ get_neighbours()

ivec2 gridpp::Grid::get_neighbours ( float  lat,
float  lon,
float  radius,
bool  include_match = true 
) const

◆ get_neighbours_with_distance()

ivec2 gridpp::Grid::get_neighbours_with_distance ( float  lat,
float  lon,
float  radius,
vec distances,
bool  include_match = true 
) const

◆ get_num_neighbours()

int gridpp::Grid::get_num_neighbours ( float  lat,
float  lon,
float  radius,
bool  include_match = true 
) const

◆ get_point()

gridpp::Point gridpp::Grid::get_point ( int  y_index,
int  x_index 
) const

◆ size()

ivec gridpp::Grid::size ( ) const

◆ to_points()

Points gridpp::Grid::to_points ( ) const

Convert grid to a vector of points.

Returns
Points object containing all gridpoints serialised into a vector

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