OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
epr_api.h
Go to the documentation of this file.
1 /*
2  * $Id: epr_api.h,v 1.3 2009-03-27 10:25:54 sabine Exp $
3  *
4  * Copyright (C) 2002 by Brockmann Consult (info@brockmann-consult.de)
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License as published by the
8  * Free Software Foundation. This program is distributed in the hope it will
9  * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
10  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11  * See the GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16  */
17 #pragma GCC diagnostic ignored "-Wpadded"
18 #ifndef EPR_API_H_INCL
19 #define EPR_API_H_INCL
20 
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 /* to make the FILE structure available */
27 #include <stdio.h>
28 
29 /* to make dynamic arrays available*/
30 #include "epr_ptrarray.h"
31 
32 #define EPR_PRODUCT_API_NAME_STR "ENVISAT Product Reader API"
33 #define EPR_PRODUCT_API_VERSION_STR "2.3"
34 
35 /* needed by Doxygen */
58  e_tid_int = 6,
69 };
70 
76  /* Not an error */
78 
79  /* Low level errors */
87 
88  /* I/O errors */
95 
96  /* API related errors */
111 
112  /* Bitmask term errors */
114 
115 
116  /* DDDB errors */
118 };
119 
129 };
130 
137 };
138 
143 };
144 
145 struct EPR_ProductId;
146 struct EPR_DatasetId;
147 struct EPR_BandId;
148 struct EPR_Record;
149 struct EPR_RecordInfo;
150 struct EPR_Field;
151 struct EPR_FieldInfo;
152 struct EPR_ProductInfo;
153 struct EPR_DSD;
154 struct EPR_Raster;
155 struct EPR_DatasetRef;
156 struct EPR_Flag;
157 struct EPR_BandId;
158 struct EPR_ParamElem;
159 struct EPR_Time;
160 
166 typedef struct EPR_ProductId EPR_SProductId;
167 typedef struct EPR_DatasetId EPR_SDatasetId;
168 typedef struct EPR_BandId EPR_SBandId;
169 typedef struct EPR_Record EPR_SRecord;
170 typedef struct EPR_RecordInfo EPR_SRecordInfo;
171 typedef struct EPR_Field EPR_SField;
172 typedef struct EPR_FieldInfo EPR_SFieldInfo;
173 typedef struct EPR_DSD EPR_SDSD;
174 typedef struct EPR_Raster EPR_SRaster;
175 typedef struct EPR_FlagDef EPR_SFlagDef;
176 typedef struct EPR_ParamElem EPR_SParamElem;
177 typedef struct EPR_Time EPR_STime;
178 typedef struct EPR_DatasetRef EPR_SDatasetRef;
179 typedef struct EPR_BitmaskTerm EPR_SBitmaskTerm;
180 typedef struct EPR_FlagSet EPR_SFlagSet;
181 typedef void (*EPR_FErrHandler)(EPR_EErrCode err_code, const char* err_message);
182 typedef void (*EPR_FLogHandler)(EPR_ELogLevel log_level, const char* log_message);
183 
184 
185 typedef int epr_boolean;
186 typedef unsigned char epr_uchar;
187 typedef unsigned short epr_ushort;
188 typedef unsigned int epr_uint;
189 typedef unsigned long epr_ulong;
190 
191 
192 typedef int EPR_Magic;
193 
194 #define EPR_MAGIC_PRODUCT_ID 0xCAFFEE64
195 #define EPR_MAGIC_DATASET_ID 0xEFEABDCA
196 #define EPR_MAGIC_BAND_ID 0xFEC21ABD
197 #define EPR_MAGIC_RECORD 0x7BABACAE
198 #define EPR_MAGIC_FIELD 0xBA0BABBA
199 #define EPR_MAGIC_RASTER 0x0BABA0EB
200 #define EPR_MAGIC_FLAG_DEF 0xCABA11AD
201 
202 #define EPR_TRUE 1
203 #define EPR_FALSE 0
204 
205 #define EPR_PRODUCT_ID_STRLEN 48
206 
207 
208 /*************************************************************************/
209 /******************************** STRUCTURES *****************************/
210 /*************************************************************************/
211 
225 
229  char* file_path;
230 
235  FILE* istream;
236 
241 
246 
251 
261 
265  EPR_SRecord* mph_record;
266 
270  EPR_SRecord* sph_record;
271 
276  EPR_SPtrArray* dsd_array;
277 
287  EPR_SPtrArray* record_info_cache;
288 
295  EPR_SPtrArray* param_table;
296 
300  EPR_SPtrArray* dataset_ids;
301 
305  EPR_SPtrArray* band_ids;
306 
311 };
312 
331 
335  EPR_SProductId* product_id;
336 
340  char* dsd_name;
341 
345  const EPR_SDSD* dsd;
346 
351 
356 
360  EPR_SRecordInfo* record_info;
361 
362 
366  char* description;
367 };
368 
376 struct EPR_DSD {
382 
386  int index;
387 
391  char* ds_name;
392 
396  char* ds_type;
397 
401  char* filename;
402 
407 
412 
417 
422 };
423 
431 struct EPR_Record {
437 
441  EPR_SRecordInfo* info;
442 
449 
454  EPR_SField** fields;
455 };
456 
464 struct EPR_Field {
470 
475  EPR_SFieldInfo* info;
476 
497  void* elems;
498 };
499 
505 struct EPR_Raster {
511 
517 
522 
527 
532 
537 
542 
548 
554 
559  void* buffer;
560 };
561 
577  EPR_SDatasetId* dataset_id;
578  int field_index; /* -1 if not used */
579  int elem_index; /* -1 if not used */
580 };
581 
586 struct EPR_FlagDef {
592 
596  char* name;
597 
602 
606  char* description;
607 };
608 
620 struct EPR_BandId {
626 
630  EPR_SProductId* product_id;
631 
636  char* band_name;
637 
642 
649  EPR_SDatasetRef dataset_ref;
650 
661 
670 
680 
691 
703 
707  char* bm_expr;
708 
714  EPR_SPtrArray* flag_coding;
715 
719  char* unit;
720 
724  char* description;
725 
732 };
733 
740 struct EPR_Time {
741  int days;
744 };
745 
746 
747 
748 /*************************************************************************/
749 /********************************* FUNCTIONS *****************************/
750 /*************************************************************************/
751 
752 /*
753  * ============================ (1) Initialisation ==========================
754  */
755 
776 int epr_init_api(EPR_ELogLevel log_level,
777  EPR_FLogHandler log_handler,
778  EPR_FErrHandler err_handler);
779 
780 
787 void epr_close_api();
791 /*
792  * ============================ (2) Logging ============================
793  */
794 
810 int epr_set_log_level(EPR_ELogLevel log_level);
811 
821 void epr_set_log_handler(EPR_FLogHandler log_handler);
822 
831 void epr_log_message(EPR_ELogLevel log_level, const char* log_message);
832 
835 /*
836  * ========================= (3) Error Handling ==========================
837  */
838 
850 void epr_set_err_handler(EPR_FErrHandler err_handler);
851 
859 
866 const char* epr_get_last_err_message();
867 
873 void epr_clear_err();
874 
877 /*
878  * ========================== (4) Input / Output ============================
879  */
880 
886 /*
887  * ======================= (4.1) Product File Access ==========================
888  */
889 
908 EPR_SProductId* epr_open_product(const char* product_file_path);
909 
917 int epr_close_product(EPR_SProductId* product_id);
922 /*
923  * ================= (4.2) Writing to a file or standard output =================
924  */
925 
952 void epr_print_record(const EPR_SRecord* record, FILE* ostream);
953 void epr_print_field(const EPR_SField* field, FILE* ostream);
954 void epr_print_element(const EPR_SRecord* record, epr_uint field_index, epr_uint element_index, FILE* ostream);
955 void epr_dump_record(const EPR_SRecord* record);
956 void epr_dump_field(const EPR_SField* field);
957 void epr_dump_element(const EPR_SRecord* record, epr_uint field_index, epr_uint element_index);
960 /*
961  * ======================= (5) Basic Data Access =========================
962  */
963 
976 epr_uint epr_get_scene_width(const EPR_SProductId* product_id);
977 
985 epr_uint epr_get_scene_height(const EPR_SProductId* product_id);
986 
989 /*
990  * ============================ (5.1) Dataset ==============================
991  */
992 
1005 epr_uint epr_get_num_datasets(EPR_SProductId* product_id);
1006 
1015 EPR_SDatasetId* epr_get_dataset_id_at(EPR_SProductId* product_id, epr_uint index);
1016 
1024 EPR_SDatasetId* epr_get_dataset_id(EPR_SProductId* product_id, const char* dataset_name);
1025 
1032 const char* epr_get_dataset_name(EPR_SDatasetId* dataset_id);
1033 
1040 const char* epr_get_dsd_name(const EPR_SDatasetId* dataset_id);
1041 
1048 EPR_SRecord* epr_get_mph(const EPR_SProductId* product_id);
1049 
1056 EPR_SRecord* epr_get_sph(const EPR_SProductId* product_id);
1057 
1064 const EPR_SDSD* epr_get_dsd(const EPR_SDatasetId* dataset_id);
1065 
1072 epr_uint epr_get_num_records(const EPR_SDatasetId* dataset_id);
1073 
1074 
1075 epr_uint epr_get_num_dsds(const EPR_SProductId* product_id);
1076 EPR_SDSD* epr_get_dsd_at(const EPR_SProductId* product_id, epr_uint dsd_index);
1077 
1080 /*
1081  * ================================= (5.2) Records ============================
1082  */
1083 
1098 EPR_SRecord* epr_create_record(EPR_SDatasetId* dataset_id);
1099 
1118 EPR_SRecord* epr_read_record(EPR_SDatasetId* dataset_id,
1119  epr_uint record_index,
1120  EPR_SRecord* record);
1121 
1129 void epr_free_record(EPR_SRecord* record);
1130 
1133 /*
1134  * =========================== (5.3) Field Access =============================
1135  */
1136 
1153 const EPR_SField* epr_get_field(const EPR_SRecord* record, const char* field_name);
1154 
1161 epr_uint epr_get_num_fields(const EPR_SRecord* record);
1162 
1171 const EPR_SField* epr_get_field_at(const EPR_SRecord* record, epr_uint field_index);
1172 
1179 const char* epr_get_field_unit(const EPR_SField* field);
1180 
1188 const char* epr_get_field_description(const EPR_SField* field);
1189 
1197 epr_uint epr_get_field_num_elems(const EPR_SField* field);
1198 
1206 const char* epr_get_field_name(const EPR_SField* field);
1207 
1215 EPR_EDataTypeId epr_get_field_type(const EPR_SField* field);
1216 
1219 /*
1220  * ========================= (5.4) Single Element Access =========================
1221  */
1222 
1238 char epr_get_field_elem_as_char(const EPR_SField* field, epr_uint elem_index);
1239 epr_uchar epr_get_field_elem_as_uchar(const EPR_SField* field, epr_uint elem_index);
1240 short epr_get_field_elem_as_short(const EPR_SField* field, epr_uint elem_index);
1241 epr_ushort epr_get_field_elem_as_ushort(const EPR_SField* field, epr_uint elem_index);
1242 int epr_get_field_elem_as_int(const EPR_SField* field, epr_uint elem_index);
1243 epr_uint epr_get_field_elem_as_uint(const EPR_SField* field, epr_uint elem_index);
1244 float epr_get_field_elem_as_float(const EPR_SField* field, epr_uint elem_index);
1245 double epr_get_field_elem_as_double(const EPR_SField* field, epr_uint elem_index);
1246 const EPR_STime* epr_get_field_elem_as_mjd(const EPR_SField* field);
1247 const char* epr_get_field_elem_as_str(const EPR_SField* field);
1250 /*
1251  * =========================== (5.5) Array Element Access =============================
1252  */
1253 
1266 const char* epr_get_field_elems_char(const EPR_SField* field);
1267 const epr_uchar* epr_get_field_elems_uchar(const EPR_SField* field);
1268 const short* epr_get_field_elems_short(const EPR_SField* field);
1269 const epr_ushort* epr_get_field_elems_ushort(const EPR_SField* field);
1270 const int* epr_get_field_elems_int(const EPR_SField* field);
1271 const epr_uint* epr_get_field_elems_uint(const EPR_SField* field);
1272 const float* epr_get_field_elems_float(const EPR_SField* field);
1273 const double* epr_get_field_elems_double(const EPR_SField* field);
1292 epr_uint epr_copy_field_elems_as_ints(const EPR_SField* field, int* buffer, epr_uint num_elems);
1293 epr_uint epr_copy_field_elems_as_uints(const EPR_SField* field, epr_uint* buffer, epr_uint num_elems);
1294 epr_uint epr_copy_field_elems_as_floats(const EPR_SField* field, float* buffer, epr_uint num_elems);
1295 epr_uint epr_copy_field_elems_as_doubles(const EPR_SField* field, double* buffer, epr_uint num_elems);
1300 /*
1301  * ======================== (6) Geophysical Data Access =========================
1302  */
1303 
1311 /*
1312  * ================================== (6.1) Raster ===============================
1313  */
1314 
1355 EPR_SRaster* epr_create_compatible_raster(EPR_SBandId* band_id,
1356  epr_uint source_width,
1357  epr_uint source_height,
1358  epr_uint source_step_x,
1359  epr_uint source_step_y);
1360 
1373 EPR_SRaster* epr_create_raster(EPR_EDataTypeId data_type,
1374  epr_uint source_width,
1375  epr_uint source_height,
1376  epr_uint source_step_x,
1377  epr_uint source_step_y);
1378 
1379 
1390 EPR_SRaster* epr_create_bitmask_raster(epr_uint source_width,
1391  epr_uint source_height,
1392  epr_uint source_step_x,
1393  epr_uint source_step_y);
1394 
1412 int epr_read_band_raster(EPR_SBandId* band_id,
1413  int offset_x,
1414  int offset_y,
1415  EPR_SRaster* raster);
1416 
1417 
1421 epr_uint epr_get_raster_elem_size(const EPR_SRaster* raster);
1422 
1426 void* epr_get_raster_elem_addr(const EPR_SRaster* raster, epr_uint offset);
1427 
1431 void* epr_get_raster_pixel_addr(const EPR_SRaster* raster, epr_uint x, epr_uint y);
1432 
1436 void* epr_get_raster_line_addr(const EPR_SRaster* raster, epr_uint y);
1437 
1438 
1446 epr_uint epr_get_raster_width(EPR_SRaster* raster);
1447 
1455 epr_uint epr_get_raster_height(EPR_SRaster* raster);
1456 
1457 
1458 
1465 epr_uint epr_get_num_bands(EPR_SProductId* product_id);
1466 
1475 EPR_SBandId* epr_get_band_id_at(EPR_SProductId* product_id, epr_uint index);
1476 
1484 EPR_SBandId* epr_get_band_id(EPR_SProductId* product_id, const char* band_name);
1485 
1492 const char* epr_get_band_name(EPR_SBandId* band_id);
1493 
1499 void epr_free_raster(EPR_SRaster* raster);
1500 
1503 /*
1504  * ============================ (6.2) Single Pixel Access ========================
1505  */
1506 
1523 epr_uint epr_get_pixel_as_uint(const EPR_SRaster* raster, int x, int y);
1524 int epr_get_pixel_as_int(const EPR_SRaster* raster, int x, int y);
1525 float epr_get_pixel_as_float(const EPR_SRaster* raster, int x, int y);
1526 double epr_get_pixel_as_double(const EPR_SRaster* raster, int x, int y);
1529 /*
1530  * ================================= (7) Bitmasks ==========================
1531  */
1532 
1558 int epr_read_bitmask_raster(EPR_SProductId* product_id,
1559  const char* bm_expr,
1560  int offset_x,
1561  int offset_y,
1562  EPR_SRaster* raster);
1563 
1566 /*
1567  * ================================= (8) Utility functions ==========================
1568  */
1569 
1579 
1583 const char* epr_data_type_id_to_str(EPR_EDataTypeId data_type_id);
1584 
1587 #ifdef __cplusplus
1588 } /* extern "C" */
1589 #endif
1590 #endif /* #ifndef EPR_API_H_INCL */
epr_uchar epr_get_field_elem_as_uchar(const EPR_SField *field, epr_uint elem_index)
Definition: epr_typconv.c:98
EPR_SRecord * mph_record
Definition: epr_api.h:265
epr_uint ds_size
Definition: epr_api.h:411
an array had not been initialized Several spelling and grammar corrections were which is read from the appropriate MCF the above metadata values were hard coded A problem calculating the average background DN for SWIR bands when the moon is in the space view port was corrected The new algorithm used to calculate the average background DN for all reflective bands when the moon is in the space view port is now the same as the algorithm employed by the thermal bands For non SWIR changes in the averages are typically less than Also for non SWIR the black body DNs remain a backup in case the SV DNs are not available For SWIR the changes in computed averages were larger because the old which used the black body suffered from contamination by the micron leak As a consequence of the if SV DNs are not available for the SWIR the EV pixels will not be the granule time is used to identify the appropriate tables within the set given for one LUT the first two or last two tables respectively will be used for the interpolation If there is only one LUT in the set of it will be treated as a constant LUT The manner in which Earth View data is checked for saturation was changed Previously the raw Earth View DNs and Space View DNs were checked against the lookup table values contained in the table dn_sat The change made is to check the raw Earth and Space View DNs to be sure they are less than the maximum saturation value and to check the Space View subtracted Earth View dns against a set of values contained in the new lookup table dn_sat_ev The metadata configuration and ASSOCIATEDINSTRUMENTSHORTNAME from the MOD02HKM product The same metatdata with extensions and were removed from the MOD021KM and MOD02OBC products ASSOCIATEDSENSORSHORTNAME was set to MODIS in all products These changes are reflected in new File Specification which users may consult for exact the pow functions were eliminated in Emissive_Cal and Emissive bands replaced by more efficient code Other calculations throughout the code were also made more efficient Aside from a few round off there was no difference to the product The CPU time decreased by about for a day case and for a night case A minor bug in calculating the uncertainty index for emissive bands was corrected The frame index(0-based) was previously being used the frame number(1-based) should have been used. There were only a few minor changes to the uncertainty index(maximum of 1 digit). 3. Some inefficient arrays(Sigma_RVS_norm_sq) were eliminated and some code lines in Preprocess_L1A_Data were moved into Process_OBCEng_Emiss. There were no changes to the product. Required RAM was reduced by 20 MB. Now
@ e_err_invalid_field_name
Definition: epr_api.h:103
@ e_smod_1OF2
Definition: epr_api.h:133
EPR_SPtrArray * flag_coding
Definition: epr_api.h:714
const EPR_SDSD * epr_get_dsd(const EPR_SDatasetId *dataset_id)
Definition: epr_dataset.c:196
EPR_LogLevel
Definition: epr_api.h:124
double epr_get_field_elem_as_double(const EPR_SField *field, epr_uint elem_index)
Definition: epr_typconv.c:514
epr_uint dsr_size
Definition: epr_api.h:421
@ e_err_out_of_memory
Definition: epr_api.h:83
@ e_err_invalid_band_name
Definition: epr_api.h:106
@ e_log_debug
Definition: epr_api.h:125
const epr_ushort * epr_get_field_elems_ushort(const EPR_SField *field)
Definition: epr_typconv.c:261
@ e_err_illegal_arg
Definition: epr_api.h:81
EPR_SDatasetRef dataset_ref
Definition: epr_api.h:649
epr_uint source_height
Definition: epr_api.h:531
epr_uint epr_get_num_dsds(const EPR_SProductId *product_id)
Definition: epr_dsd.c:610
enum EPR_LogLevel EPR_ELogLevel
Definition: epr_api.h:163
EPR_SRecordInfo * info
Definition: epr_api.h:441
EPR_SRaster * epr_create_compatible_raster(EPR_SBandId *band_id, epr_uint source_width, epr_uint source_height, epr_uint source_step_x, epr_uint source_step_y)
Definition: epr_band.c:549
epr_uint epr_get_pixel_as_uint(const EPR_SRaster *raster, int x, int y)
Definition: epr_bitmask.c:736
epr_uint epr_get_data_type_size(EPR_EDataTypeId data_type_id)
Definition: epr_core.c:148
unsigned int epr_uint
Definition: epr_api.h:188
short epr_get_field_elem_as_short(const EPR_SField *field, epr_uint elem_index)
Definition: epr_typconv.c:155
void epr_free_raster(EPR_SRaster *raster)
Definition: epr_band.c:568
EPR_EDataTypeId data_type
Definition: epr_api.h:516
@ e_log_warning
Definition: epr_api.h:127
void epr_free_record(EPR_SRecord *record)
Definition: epr_record.c:405
EPR_EScalingMethod scaling_method
Definition: epr_api.h:679
const EPR_STime * epr_get_field_elem_as_mjd(const EPR_SField *field)
Definition: epr_typconv.c:596
void * elems
Definition: epr_api.h:497
char * name
Definition: epr_api.h:596
enum EPR_ErrCode EPR_EErrCode
Definition: epr_api.h:162
unsigned short epr_ushort
Definition: epr_api.h:187
@ e_err_none
Definition: epr_api.h:77
epr_uint epr_copy_field_elems_as_floats(const EPR_SField *field, float *buffer, epr_uint num_elems)
Definition: epr_typconv.c:729
@ e_err_invalid_band
Definition: epr_api.h:100
@ e_err_file_close_failed
Definition: epr_api.h:94
epr_uint tot_size
Definition: epr_api.h:240
char * band_name
Definition: epr_api.h:636
EPR_SField ** fields
Definition: epr_api.h:454
const int * epr_get_field_elems_int(const EPR_SField *field)
Definition: epr_typconv.c:336
epr_uint source_step_x
Definition: epr_api.h:536
void epr_print_element(const EPR_SRecord *record, epr_uint field_index, epr_uint element_index, FILE *ostream)
Definition: epr_dump.c:172
int epr_boolean
Definition: epr_api.h:185
@ e_err_file_access_denied
Definition: epr_api.h:90
float epr_get_pixel_as_float(const EPR_SRaster *raster, int x, int y)
Definition: epr_bitmask.c:789
int epr_init_api(EPR_ELogLevel log_level, EPR_FLogHandler log_handler, EPR_FErrHandler err_handler)
Definition: epr_api.c:40
@ e_tid_float
Definition: epr_api.h:60
EPR_SPtrArray * dsd_array
Definition: epr_api.h:276
@ e_smid_lin
Definition: epr_api.h:141
@ e_err_file_open_failed
Definition: epr_api.h:93
@ e_err_invalid_data_format
Definition: epr_api.h:107
epr_uint epr_copy_field_elems_as_uints(const EPR_SField *field, epr_uint *buffer, epr_uint num_elems)
Definition: epr_typconv.c:857
const char * epr_get_band_name(EPR_SBandId *band_id)
Definition: epr_band.c:266
void epr_dump_element(const EPR_SRecord *record, epr_uint field_index, epr_uint element_index)
Definition: epr_dump.c:161
EPR_SPtrArray * dataset_ids
Definition: epr_api.h:300
void * epr_get_raster_pixel_addr(const EPR_SRaster *raster, epr_uint x, epr_uint y)
Definition: epr_band.c:1055
epr_uint epr_get_num_fields(const EPR_SRecord *record)
Definition: epr_record.c:383
unsigned long epr_ulong
Definition: epr_api.h:189
EPR_SBandId * epr_get_band_id_at(EPR_SProductId *product_id, epr_uint index)
Definition: epr_band.c:217
double epr_get_pixel_as_double(const EPR_SRaster *raster, int x, int y)
Definition: epr_bitmask.c:815
const EPR_SField * epr_get_field(const EPR_SRecord *record, const char *field_name)
Definition: epr_field.c:247
epr_uint scene_width
Definition: epr_api.h:245
EPR_SampleModel
Definition: epr_api.h:131
EPR_Magic magic
Definition: epr_api.h:224
@ e_err_invalid_product_id
Definition: epr_api.h:98
EPR_SRaster * epr_create_raster(EPR_EDataTypeId data_type, epr_uint source_width, epr_uint source_height, epr_uint source_step_x, epr_uint source_step_y)
Definition: epr_band.c:495
epr_ushort epr_get_field_elem_as_ushort(const EPR_SField *field, epr_uint elem_index)
Definition: epr_typconv.c:222
EPR_EDataTypeId epr_get_field_type(const EPR_SField *field)
Definition: epr_field.c:302
@ e_tid_int
Definition: epr_api.h:58
@ e_tid_ushort
Definition: epr_api.h:52
@ e_err_invalid_record
Definition: epr_api.h:99
@ e_smod_2TOF
Definition: epr_api.h:136
const char * epr_get_last_err_message()
Definition: epr_core.c:281
@ e_err_illegal_data_type
Definition: epr_api.h:86
EPR_SDatasetId * epr_get_dataset_id(EPR_SProductId *product_id, const char *dataset_name)
Definition: epr_dsd.c:96
@ e_smod_2OF2
Definition: epr_api.h:134
@ e_err_null_pointer
Definition: epr_api.h:80
@ e_err_unknown_endian_order
Definition: epr_api.h:110
epr_uint num_fields
Definition: epr_api.h:448
void(* EPR_FErrHandler)(EPR_EErrCode err_code, const char *err_message)
Definition: epr_api.h:181
void(* EPR_FLogHandler)(EPR_ELogLevel log_level, const char *log_message)
Definition: epr_api.h:182
@ e_err_api_not_initialized
Definition: epr_api.h:97
@ e_err_file_write_error
Definition: epr_api.h:92
epr_uint epr_get_raster_height(EPR_SRaster *raster)
Definition: epr_band.c:1079
epr_uint microseconds
Definition: epr_api.h:743
const char * epr_get_field_elem_as_str(const EPR_SField *field)
Definition: epr_typconv.c:624
epr_uint epr_get_scene_width(const EPR_SProductId *product_id)
Definition: epr_product.c:357
int spectr_band_index
Definition: epr_api.h:641
FILE * istream
Definition: epr_api.h:235
char * ds_type
Definition: epr_api.h:396
@ e_err_file_read_error
Definition: epr_api.h:91
#define EPR_PRODUCT_ID_STRLEN
Definition: epr_api.h:205
@ e_err_index_out_of_range
Definition: epr_api.h:84
@ e_err_illegal_conversion
Definition: epr_api.h:85
epr_uint epr_get_raster_elem_size(const EPR_SRaster *raster)
Definition: epr_band.c:1039
const float * epr_get_field_elems_float(const EPR_SField *field)
Definition: epr_typconv.c:487
const struct RecordDescriptor * record_descriptor
Definition: epr_api.h:355
@ e_err_invalid_value
Definition: epr_api.h:108
enum EPR_ScalingMethod EPR_EScalingMethod
Definition: epr_api.h:165
epr_boolean lines_mirrored
Definition: epr_api.h:731
epr_uint raster_height
Definition: epr_api.h:553
@ e_log_error
Definition: epr_api.h:128
@ e_tid_uint
Definition: epr_api.h:56
const char * epr_get_field_description(const EPR_SField *field)
Definition: epr_field.c:326
void epr_log_message(EPR_ELogLevel log_level, const char *log_message)
Definition: epr_api.c:121
epr_uint seconds
Definition: epr_api.h:742
EPR_SProductId * product_id
Definition: epr_api.h:335
const char * epr_get_dataset_name(EPR_SDatasetId *dataset_id)
Definition: epr_dataset.c:172
What value is used by your function when the data value is bad Default is BAD_FLT l2prod product_id[0]
epr_uint epr_get_field_elem_as_uint(const EPR_SField *field, epr_uint elem_index)
Definition: epr_typconv.c:363
void epr_set_log_handler(EPR_FLogHandler log_handler)
Definition: epr_api.c:115
char id_string[EPR_PRODUCT_ID_STRLEN+1]
Definition: epr_api.h:260
struct EPR_FlagSet EPR_SFlagSet
Definition: epr_api.h:180
char * dataset_name
Definition: epr_api.h:350
const char * epr_data_type_id_to_str(EPR_EDataTypeId data_type_id)
Definition: epr_core.c:104
@ e_err_file_not_found
Definition: epr_api.h:89
EPR_SRecord * epr_read_record(EPR_SDatasetId *dataset_id, epr_uint record_index, EPR_SRecord *record)
Definition: epr_dataset.c:269
epr_uint epr_get_num_datasets(EPR_SProductId *product_id)
Definition: epr_dsd.c:63
int elem_index
Definition: epr_api.h:579
@ e_err_invalid_raster
Definition: epr_api.h:101
EPR_SRaster * epr_create_bitmask_raster(epr_uint source_width, epr_uint source_height, epr_uint source_step_x, epr_uint source_step_y)
Definition: epr_band.c:472
@ e_tid_spare
Definition: epr_api.h:66
void epr_dump_field(const EPR_SField *field)
Definition: epr_dump.c:75
char * unit
Definition: epr_api.h:719
epr_uint epr_copy_field_elems_as_doubles(const EPR_SField *field, double *buffer, epr_uint num_elems)
Definition: epr_typconv.c:657
epr_uint source_width
Definition: epr_api.h:526
char * file_path
Definition: epr_api.h:229
int EPR_Magic
Definition: epr_api.h:192
char epr_get_field_elem_as_char(const EPR_SField *field, epr_uint elem_index)
Definition: epr_typconv.c:41
epr_uint epr_copy_field_elems_as_ints(const EPR_SField *field, int *buffer, epr_uint num_elems)
@ e_err_invalid_record_name
Definition: epr_api.h:104
@ e_log_info
Definition: epr_api.h:126
epr_uint elem_size
Definition: epr_api.h:521
epr_uint num_dsr
Definition: epr_api.h:416
const epr_uint * epr_get_field_elems_uint(const EPR_SField *field)
Definition: epr_typconv.c:408
char * filename
Definition: epr_api.h:401
void epr_print_record(const EPR_SRecord *record, FILE *ostream)
Definition: epr_dump.c:56
epr_uint raster_width
Definition: epr_api.h:547
const EPR_SDSD * dsd
Definition: epr_api.h:345
@ e_err_invalid_dataset_name
Definition: epr_api.h:102
int epr_set_log_level(EPR_ELogLevel log_level)
const char * epr_get_dsd_name(const EPR_SDatasetId *dataset_id)
Definition: epr_dataset.c:208
@ e_tid_char
Definition: epr_api.h:50
enum EPR_SampleModel EPR_ESampleModel
Definition: epr_api.h:164
EPR_DataTypeId
Definition: epr_api.h:44
void epr_clear_err()
Definition: epr_core.c:247
EPR_SDatasetId * dataset_id
Definition: epr_api.h:577
@ e_err_illegal_state
Definition: epr_api.h:82
float epr_get_field_elem_as_float(const EPR_SField *field, epr_uint elem_index)
Definition: epr_typconv.c:435
epr_uint source_step_y
Definition: epr_api.h:541
epr_uint bit_mask
Definition: epr_api.h:601
epr_uint epr_get_num_bands(EPR_SProductId *product_id)
Definition: epr_band.c:203
EPR_SRecord * sph_record
Definition: epr_api.h:270
@ e_tid_double
Definition: epr_api.h:62
EPR_SRecord * epr_get_sph(const EPR_SProductId *product_id)
Definition: epr_product.c:388
int epr_get_pixel_as_int(const EPR_SRaster *raster, int x, int y)
Definition: epr_bitmask.c:762
EPR_SRecord * epr_create_record(EPR_SDatasetId *dataset_id)
Definition: epr_dataset.c:241
void epr_print_field(const EPR_SField *field, FILE *ostream)
Definition: epr_dump.c:86
epr_uint epr_get_scene_height(const EPR_SProductId *product_id)
Definition: epr_product.c:374
struct EPR_BitmaskTerm EPR_SBitmaskTerm
Definition: epr_api.h:179
const double * epr_get_field_elems_double(const EPR_SField *field)
Definition: epr_typconv.c:569
EPR_SPtrArray * band_ids
Definition: epr_api.h:305
@ e_err_invalid_keyword_name
Definition: epr_api.h:109
@ e_smod_1OF1
Definition: epr_api.h:132
@ e_smod_3TOI
Definition: epr_api.h:135
EPR_SDatasetId * epr_get_dataset_id_at(EPR_SProductId *product_id, epr_uint index)
Definition: epr_dsd.c:75
epr_uint epr_get_num_records(const EPR_SDatasetId *dataset_id)
Definition: epr_dataset.c:184
char * dsd_name
Definition: epr_api.h:340
@ e_tid_string
Definition: epr_api.h:64
void epr_set_err_handler(EPR_FErrHandler err_handler)
@ e_tid_short
Definition: epr_api.h:54
const short * epr_get_field_elems_short(const EPR_SField *field)
Definition: epr_typconv.c:195
const epr_uchar * epr_get_field_elems_uchar(const EPR_SField *field)
Definition: epr_typconv.c:128
char * ds_name
Definition: epr_api.h:391
int meris_iodd_version
Definition: epr_api.h:310
char * bm_expr
Definition: epr_api.h:707
@ e_smid_non
Definition: epr_api.h:140
EPR_SBandId * epr_get_band_id(EPR_SProductId *product_id, const char *band_name)
Definition: epr_band.c:237
void * buffer
Definition: epr_api.h:559
int index
Definition: epr_api.h:386
@ e_tid_time
Definition: epr_api.h:68
const char * epr_get_field_unit(const EPR_SField *field)
Definition: epr_field.c:314
enum EPR_DataTypeId EPR_EDataTypeId
Definition: epr_api.h:161
EPR_EErrCode epr_get_last_err_code()
Definition: epr_core.c:265
void * epr_get_raster_line_addr(const EPR_SRaster *raster, epr_uint y)
Definition: epr_band.c:1063
@ e_smid_log
Definition: epr_api.h:142
@ e_tid_unknown
Definition: epr_api.h:46
EPR_ScalingMethod
Definition: epr_api.h:139
epr_uint ds_offset
Definition: epr_api.h:406
epr_uint epr_get_raster_width(EPR_SRaster *raster)
Definition: epr_band.c:1071
l2prod offset
epr_uint epr_get_field_num_elems(const EPR_SField *field)
Definition: epr_field.c:277
EPR_SProductId * epr_open_product(const char *product_file_path)
Definition: epr_product.c:54
unsigned char epr_uchar
Definition: epr_api.h:186
EPR_SPtrArray * param_table
Definition: epr_api.h:295
@ e_tid_uchar
Definition: epr_api.h:48
const char * epr_get_field_name(const EPR_SField *field)
Definition: epr_field.c:289
const char * epr_get_field_elems_char(const EPR_SField *field)
Definition: epr_typconv.c:71
EPR_ESampleModel sample_model
Definition: epr_api.h:660
int epr_read_band_raster(EPR_SBandId *band_id, int offset_x, int offset_y, EPR_SRaster *raster)
Definition: epr_band.c:593
float scaling_factor
Definition: epr_api.h:702
EPR_SFieldInfo * info
Definition: epr_api.h:475
void * epr_get_raster_elem_addr(const EPR_SRaster *raster, epr_uint offset)
Definition: epr_band.c:1047
epr_uint scene_height
Definition: epr_api.h:250
int epr_get_field_elem_as_int(const EPR_SField *field, epr_uint elem_index)
Definition: epr_typconv.c:291
int days
Definition: epr_api.h:741
void epr_dump_record(const EPR_SRecord *record)
Definition: epr_dump.c:45
EPR_SRecord * epr_get_mph(const EPR_SProductId *product_id)
Definition: epr_product.c:399
EPR_ErrCode
Definition: epr_api.h:75
int field_index
Definition: epr_api.h:578
EPR_SRecordInfo * record_info
Definition: epr_api.h:360
EPR_SDSD * epr_get_dsd_at(const EPR_SProductId *product_id, epr_uint dsd_index)
Definition: epr_dsd.c:615
int epr_read_bitmask_raster(EPR_SProductId *product_id, const char *bm_expr, int offset_x, int offset_y, EPR_SRaster *raster)
Definition: epr_bitmask.c:99
const EPR_SField * epr_get_field_at(const EPR_SRecord *record, epr_uint field_index)
Definition: epr_record.c:360
@ e_err_invalid_product_name
Definition: epr_api.h:105
int epr_close_product(EPR_SProductId *product_id)
Definition: epr_product.c:231
@ e_err_flag_not_found
Definition: epr_api.h:113
char * description
Definition: epr_api.h:366
void epr_close_api()
Definition: epr_api.c:90
EPR_SPtrArray * record_info_cache
Definition: epr_api.h:287
float scaling_offset
Definition: epr_api.h:690
@ e_err_invalid_ddbb_format
Definition: epr_api.h:117