/* common.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 COMMON_H #define COMMON_H #include #include #include #include #include #include #include #include #include "hdfcpp.hpp" #include "debug.h" #define VERSION "0.4.6" #define STRING_MAXLEN 255 #define APPNAME "remap" #define OPT_VERBOSE 0x00000001 /* #define DATA_TYPE uint16_t #define DATA_TYPE_MIN 0 #define DATA_TYPE_MAX 65535 #define HDF_DATA_TYPE DFNT_UINT16 typedef DATA_TYPE data_type; const data_type DEFAULT_DATA_FILL_VALUE = DATA_TYPE_MAX; */ #define DATA_TYPE int16_t #define DATA_TYPE_MIN -32768 #define DATA_TYPE_MAX 32767 #define HDF_DATA_TYPE DFNT_INT16 typedef DATA_TYPE data_type; const data_type DEFAULT_DATA_FILL_VALUE = DATA_TYPE_MIN; #define HDF_COORD_TYPE DFNT_FLOAT32 #define HDF_DISTANCE_TYPE DFNT_FLOAT32 #define HDF_TIME_TYPE DFNT_FLOAT64 #define FLOAT_TYPE float // float or double typedef FLOAT_TYPE float_type; typedef float_type distance_type; typedef float_type coord_type; typedef float64 time_type; // standard for time used here is TAI93 (number of seconds since 01-Jan-1993, midnight) const float FLOAT_NAN = NAN; const double DOUBLE_NAN = NAN; const distance_type DEFAULT_DISTANCE_FILL_VALUE = FLOAT_NAN; const coord_type DEFAULT_COORD_FILL_VALUE = FLOAT_NAN; const time_type DEFAULT_TIME_FILL_VALUE = DOUBLE_NAN; const coord_type MIN_LAT = -90.; const coord_type MAX_LAT = +90.; const coord_type MIN_LON = -180.; const coord_type MAX_LON = +180.; /* FOR THE TIME BEING, ALL VALUES LESS THAN MIN_VALID_DATA OR GREATER THAN MAX_VALID_DATA ARE SUPPOSED INVALID * (THIS IS TRUE FOR ALL CURRENT SUPPORTED PRODUCTS BUT MAY BE WRONG FOR FUTURE PRODUCTS) */ const data_type MIN_VALID_DATA = -32767; const data_type MAX_VALID_DATA = 32767; extern float64 g_output_slope; extern float64 g_output_offset; extern bool g_verbose; extern bool g_extended_output; extern bool g_brillance_temperatures; extern distance_type g_distance_fill_value; extern coord_type g_coord_fill_value; extern time_type g_time_fill_value; extern data_type g_data_fill_value; extern time_type g_max_dtime; extern distance_type g_distance; extern coord_type g_equirect_latitude_orig; extern coord_type g_equirect_longitude_orig; extern distance_type g_equirect_resolution; // in km/pixel extern int g_equirect_nrows; extern int g_equirect_ncols; #endif