00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef EPR_CORE_H_INCL
00019 #define EPR_CORE_H_INCL
00020
00021 #ifdef __cplusplus
00022 extern "C"
00023 {
00024 #endif
00025
00026
00027 #include <stdio.h>
00028
00029 #include "epr_ptrarray.h"
00030
00031 struct EPR_API;
00032 struct EPR_Parameter;
00033
00034 typedef struct EPR_API EPR_SAPI;
00035 typedef struct EPR_Parameter EPR_SParameter;
00036
00037
00038 #define EPR_ENVISAT_PRODUCT_MERIS "MER"
00039 #define EPR_ENVISAT_PRODUCT_ASAR "ASA"
00040 #define EPR_ENVISAT_PRODUCT_AATSR "ATS"
00041
00042 #define EPR_LONGI_BAND_NAME "longitude"
00043
00044 #define EPR_AATSR_LINES_PER_TIE_PT 32
00045
00046 #define EPR_MPH_SIZE 1247
00047 #define EPR_SPH_SIZE 11622
00048 #define EPR_DSD_SIZE 280
00049
00050 #define EPR_PRODUCT_MPH_SIZE 1048
00051 #define EPR_PRODUCT_MAGIC_STR "PRODUCT=\""
00052 #define EPR_PRODUCT_ID_OFFSET 9
00053
00054 #define EPR_PRODUCT_TYPE_ID_STRLEN 10
00055 #define EPR_LENGTH_NUM_DSD_IDENTIFIER 9
00056 #define EPR_COUNT_SEPARATOR_ARRAY ",*"
00057 #define EPR_IRRELEVANCE_SYMBOL '*'
00058 #define EPR_FIELD_SEPARATOR_ARRAY "|"
00059 #define EPR_HEADER_SEPARATOR_ARRAY "=<>"
00060 #define EPR_HEADER_EXCEPTIONS_ARRAY "eE"
00061
00062 #define EPR_LONGI_ABS_MAX 180
00063 #define EPR_LONGI_ABS_MIN -180
00064
00065 #define EPR_LINE_MAX_LENGTH 2000
00066
00067 #define EPR_BE_MAGIC_NUMBER 1162761801UL
00068 #define EPR_LE_MAGIC_NUMBER 1230392901UL
00069 #define EPR_LE_MAGIC_BYTE_0 'E'
00070 #define EPR_LE_MAGIC_BYTE_1 'N'
00071 #define EPR_LE_MAGIC_BYTE_2 'V'
00072 #define EPR_LE_MAGIC_BYTE_3 'I'
00073
00074 #define EPR_ATS_NUM_PER_POINT_ACROSS_LOCAT 23
00075 #define EPR_ATS_NUM_PER_POINT_ACROSS_SOLAR 11
00076 #define EPR_ATS_LINE_LENGTH 512
00077
00078 #define EPR_ASAR_NUM_PER_POINT_ACROSS_LOCAT 11
00079
00086 struct EPR_API
00087 {
00091 boolean init_flag;
00092
00099 int little_endian_order;
00100
00104 ulong epr_head_size;
00105
00109
00110
00114 EPR_ELogLevel log_level;
00115
00120 EPR_FLogHandler log_handler;
00121
00125 EPR_EErrCode last_err_code;
00126
00130 char* last_err_message;
00131
00136 EPR_FErrHandler err_handler;
00137 };
00138
00139
00143 extern EPR_SAPI epr_api;
00144
00145
00146
00147
00148
00149
00159 void epr_free_product_id(EPR_SProductId* product_id);
00160
00161
00172 void epr_log(EPR_ELogLevel log_level, const char* log_message);
00173
00181 void epr_set_err(EPR_EErrCode err_code, const char* err_message);
00182
00191 EPR_SRecord* epr_read_mph(EPR_SProductId* product_id);
00192
00201 EPR_SRecord* epr_read_sph(EPR_SProductId* product_id);
00202
00211 EPR_EDataTypeId epr_str_to_data_type_id(const char* str);
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00244 char* epr_build_db_file_istream_name(EPR_SProductId* product_id, char* what);
00245 FILE* epr_open_file(char* path_to_file);
00246 long epr_str_to_number(const char* str);
00247 uint epr_parse_value_count(EPR_SProductId* product_id, const char* str);
00248 uint epr_param_to_value(const char* str, EPR_SPtrArray* param_table);
00249 void epr_make_os_compatible_path(char* path);
00250 boolean epr_check_api_init_flag();
00251
00252
00253
00254
00255
00256
00263 void epr_output_element(const EPR_SField* field, uint field_index, uint element_index, FILE* istream);
00264
00265 #ifdef __cplusplus
00266 }
00267 #endif
00268
00269 #endif