/* reproject.h */ /* remap Copyright (C) 2006 Fabrice Ducos, fabrice.ducos@icare.univ-lille1.fr This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef REPROJECT_H #define REPROJECT_H #include "common.h" #include "grid.h" /** * reprojects src_grid over target_grid * * The current implementation uses a \em "nearest neighbour" policy, an optional argument might be * added to choose the reprojection policy (with this one by default) * * Source and target grids must meet some requirements : * - their grid_type::lat, grid_type::lon and grid_type::tim fields must be filled * - grid_type::lat must contain values in \em degrees between MIN_LAT and MAX_LAT * - grid_type::lon must contain values in \em degrees between MIN_LON and MAX_LON * - grid_type::tim must contain values in ::time_type (TAI93, Temps Atomique International 1993), e.g. a number * of seconds since the 1st Jan 1993, 0h00 UTC * * @param src_grid the grid whose content is to reproject * @param target_grid the grid over which reprojection is to be done * @param distance the maximal search distance for the nearest neighbour * * ::reproject updates the following fields of target_grid : * - grid_type::data * - grid_type::distance_from_ref * - grid_type::time_from_ref * - grid_type::src_irows (currently not used) * - grid_type::src_icols (currently not used) * */ extern void reproject_coordinates(grid_type *src_grid, grid_type *target_grid); extern void reproject_measures(grid_type *src_grid, grid_type *target_grid); extern void rescale(grid_type *grid, float64 new_slope, float64 new_offset, data_type old_undef_count, data_type new_undef_count); #endif