#include <ctime>
#include "Hdf.hpp"
#include "common.h"
#include "VFiles.h"
Classes | |
struct | grid_type_ |
Typedefs | |
typedef grid_type_ | grid_type |
Functions | |
void | create_grid (grid_type *grid, int nrows=0, int ncols=0, float64 slope=1., float64 offset=0., data_type data_fill_value=DEFAULT_DATA_FILL_VALUE, coord_type coord_fill_value=DEFAULT_COORD_FILL_VALUE, distance_type distance_fill_value=DEFAULT_DISTANCE_FILL_VALUE, time_type time_fill_value=DEFAULT_TIME_FILL_VALUE) |
void | reset_grid (grid_type *grid, data_type data_fill_value, coord_type coord_fill_value, distance_type distance_fill_value, time_type time_fill_value) |
void | reset_grid (grid_type *grid, data_type data_fill_value, distance_type distance_fill_value, time_type time_fill_value) |
void | destroy_grid (grid_type *grid) |
int | load_grid (grid_type *grid, data_type data_fill_value=DEFAULT_DATA_FILL_VALUE, coord_type coord_fill_value=DEFAULT_COORD_FILL_VALUE, distance_type distance_fill_value=DEFAULT_DISTANCE_FILL_VALUE, time_type time_fill_value=DEFAULT_TIME_FILL_VALUE) |
int | save_grid (grid_type *grid, bool record_delta, bool record_latlontime) |
void | copy_grid (grid_type *target_grid, grid_type *src_grid) |
void | copy_grid_footprint (grid_type *target_grid, grid_type *src_grid) |
bool | have_same_grid_footprint (grid_type *grid1, grid_type *grid2) |
|
Grids are the main data structures handled by the software. They should have been designed as a class instead of a simple struct with functions to handle it, but by lack of time the software had to be delivered as is. A rewritten code with a grid class instead of a struct should be much clearer and easier to maintain, but will need a substantial amount of time to reimplement (and of course redocument !), that is not available today. Grids are abstracts for reprojection. Their main purpose is to handle 2-dimensional buffers of geolocated data (measures along with their latitudes, longitudes and times of acquisition). The reprojection algorithm remaps a grid of data (from one instrument product) into another one. For convenience, origin and target of the data (files and datasets) are also maintained in the structure (although this is not a very clever design, I have to confess, I hope I'll have a chance to change this if more time is given to this project) |
|
intended to copy src_grid into target_grid (does correct allocation and copies) this function is not used in the current implementation |
|
intended to copy the footprint of a grid (the footprint includes lightweight data, namely scalar fields, but not buffers) this function is not used in the current implementation |
|
the grid constructor
|
|
the destructor of a grid it resets all the scalars fields and deallocates (and nullifies) all the pointer fields of a grid structure
|
|
intended to compare two grids footprints (the footprint includes lightweight data, namely scalar fields, but not buffers) this function is not used in the current implementation |
|
loads data from the dataset grid_type::input_dataset of the file grid_type::file into a grid. The function calls create_grid, so don't do it yourself. Grids allocated and filled by load_grid must be destroyed by the caller with destroy_grid
|
|
resets all the fields of a grid, except grid_type::lat, grid_type::lon, grid_type::tim It is used for the target grid whose geolocation fields never change. On the other hand, grid_type::data (measures), grid_type::distance_from_ref and grid_type::time_from_ref buffers must be reset with each new source grid (as source will be remapped into target). This function is essentially called from the main loop in the ::main function.
|
|
resets all the fields of a grid. It is essentially called by create_grid after allocations of pointers have been done.
|
|
saves grid_type::data buffer (with its slope and offset) into the grid_type::output_dataset of the file grid_type::file recorded in the grid structure.
|