ENVISAT Product Reader API for C

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 
18 #ifndef EPR_API_H_INCL
19 #define EPR_API_H_INCL
20 
21 
22 #ifdef __cplusplus
23 extern "C"
24 {
25 #endif
26 
27 /* to make the FILE structure available */
28 #include <stdio.h>
29 
30 /* to make dynamic arrays available*/
31 #include "epr_ptrarray.h"
32 
33 #define EPR_PRODUCT_API_NAME_STR "ENVISAT Product Reader API"
34 #define EPR_PRODUCT_API_VERSION_STR "2.3"
35 
36 /* needed by Doxygen */
46 {
60  e_tid_int = 6,
70  e_tid_time = 21
71 };
72 
73 
79 {
80  /* Not an error */
82 
83  /* Low level errors */
91 
92  /* I/O errors */
99 
100  /* API related errors */
115 
116  /* Bitmask term errors */
118 
119 
120  /* DDDB errors */
122 };
123 
124 
130 {
134  e_log_error = 2
135 };
136 
138 {
143  e_smod_2TOF = 4
144 };
145 
147 {
150  e_smid_log = 2
151 };
152 
153 struct EPR_ProductId;
154 struct EPR_DatasetId;
155 struct EPR_BandId;
156 struct EPR_Record;
157 struct EPR_RecordInfo;
158 struct EPR_Field;
159 struct EPR_FieldInfo;
160 struct EPR_ProductInfo;
161 struct EPR_DSD;
162 struct EPR_Raster;
163 struct EPR_DatasetRef;
164 struct EPR_Flag;
165 struct EPR_BandId;
166 struct EPR_ParamElem;
167 struct EPR_Time;
168 
169 typedef enum EPR_DataTypeId EPR_EDataTypeId;
170 typedef enum EPR_ErrCode EPR_EErrCode;
171 typedef enum EPR_LogLevel EPR_ELogLevel;
172 typedef enum EPR_SampleModel EPR_ESampleModel;
174 typedef struct EPR_ProductId EPR_SProductId;
175 typedef struct EPR_DatasetId EPR_SDatasetId;
176 typedef struct EPR_BandId EPR_SBandId;
177 typedef struct EPR_Record EPR_SRecord;
178 typedef struct EPR_RecordInfo EPR_SRecordInfo;
179 typedef struct EPR_Field EPR_SField;
180 typedef struct EPR_FieldInfo EPR_SFieldInfo;
181 typedef struct EPR_DSD EPR_SDSD;
182 typedef struct EPR_Raster EPR_SRaster;
183 typedef struct EPR_FlagDef EPR_SFlagDef;
184 typedef struct EPR_ParamElem EPR_SParamElem;
185 typedef struct EPR_Time EPR_STime;
186 typedef struct EPR_DatasetRef EPR_SDatasetRef;
187 typedef struct EPR_BitmaskTerm EPR_SBitmaskTerm;
188 typedef struct EPR_FlagSet EPR_SFlagSet;
189 typedef void (*EPR_FErrHandler)(EPR_EErrCode err_code, const char* err_message);
190 typedef void (*EPR_FLogHandler)(EPR_ELogLevel log_level, const char* log_message);
191 
192 
193 typedef int epr_boolean;
194 typedef unsigned char uchar;
195 typedef unsigned short ushort;
196 typedef unsigned int uint;
197 typedef unsigned long ulong;
198 
199 
200 typedef int EPR_Magic;
201 
202 #define EPR_MAGIC_PRODUCT_ID 0xCAFFEE64
203 #define EPR_MAGIC_DATASET_ID 0xEFEABDCA
204 #define EPR_MAGIC_BAND_ID 0xFEC21ABD
205 #define EPR_MAGIC_RECORD 0x7BABACAE
206 #define EPR_MAGIC_FIELD 0xBA0BABBA
207 #define EPR_MAGIC_RASTER 0x0BABA0EB
208 #define EPR_MAGIC_FLAG_DEF 0xCABA11AD
209 
210 #define TRUE 1
211 #define FALSE 0
212 
213 #define EPR_PRODUCT_ID_STRLEN 48
214 
215 
216 /*************************************************************************/
217 /******************************** STRUCTURES *****************************/
218 /*************************************************************************/
219 
228 {
234 
238  char* file_path;
239 
244  FILE* istream;
245 
250 
255 
260 
270 
275 
280 
285  EPR_SPtrArray* dsd_array;
286 
296  EPR_SPtrArray* record_info_cache;
297 
304  EPR_SPtrArray* param_table;
305 
309  EPR_SPtrArray* dataset_ids;
310 
314  EPR_SPtrArray* band_ids;
315 
320 };
321 
322 
323 
324 
338 {
344 
349 
353  char* dsd_name;
354 
358  const EPR_SDSD* dsd;
359 
364 
368  const struct RecordDescriptor* record_descriptor;
369 
374 
375 
379  char* description;
380 };
381 
382 
390 struct EPR_DSD
391 {
397 
401  int index;
402 
406  char* ds_name;
407 
411  char* ds_type;
412 
416  char* filename;
417 
422 
427 
432 
437 };
438 
439 
448 {
454 
459 
466 
472 };
473 
481 struct EPR_Field
482 {
488 
494 
515  void* elems;
516 };
517 
524 {
530 
536 
541 
546 
551 
556 
561 
567 
573 
578  void* buffer;
579 };
580 
581 
597 {
599  int field_index; /* -1 if not used */
600  int elem_index; /* -1 if not used */
601 };
602 
608 {
614 
618  char* name;
619 
624 
628  char* description;
629 };
630 
631 
644 {
650 
655 
660  char* band_name;
661 
666 
674 
685 
694 
704 
715 
727 
731  char* bm_expr;
732 
738  EPR_SPtrArray* flag_coding;
739 
743  char* unit;
744 
748  char* description;
749 
756 };
757 
764 struct EPR_Time
765 {
766  int days;
769 };
770 
771 
772 
773 /*************************************************************************/
774 /********************************* FUNCTIONS *****************************/
775 /*************************************************************************/
776 
777 /*
778  * ============================ (1) Initialisation ==========================
779  */
780 
802  EPR_FLogHandler log_handler,
803  EPR_FErrHandler err_handler);
804 
805 
812 void epr_close_api(void);
816 /*
817  * ============================ (2) Logging ============================
818  */
819 
836 
847 
856 void epr_log_message(EPR_ELogLevel log_level, const char* log_message);
857 
860 /*
861  * ========================= (3) Error Handling ==========================
862  */
863 
876 
884 
891 const char* epr_get_last_err_message(void);
892 
898 void epr_clear_err(void);
899 
902 /*
903  * ========================== (4) Input / Output ============================
904  */
905 
911 /*
912  * ======================= (4.1) Product File Access ==========================
913  */
914 
933 EPR_SProductId* epr_open_product(const char* product_file_path);
934 
947 /*
948  * ================= (4.2) Writing to a file or standard output =================
949  */
950 
977 void epr_print_record(const EPR_SRecord* record, FILE* ostream);
978 void epr_print_field(const EPR_SField* field, FILE* ostream);
979 void epr_print_element(const EPR_SRecord* record, uint field_index, uint element_index, FILE* ostream);
980 void epr_dump_record(const EPR_SRecord* record);
981 void epr_dump_field(const EPR_SField* field);
982 void epr_dump_element(const EPR_SRecord* record, uint field_index, uint element_index);
985 /*
986  * ======================= (5) Basic Data Access =========================
987  */
988 
1002 
1011 
1014 /*
1015  * ============================ (5.1) Dataset ==============================
1016  */
1017 
1031 
1041 
1049 EPR_SDatasetId* epr_get_dataset_id(EPR_SProductId* product_id, const char* dataset_name);
1050 
1057 const char* epr_get_dataset_name(EPR_SDatasetId* dataset_id);
1058 
1065 const char* epr_get_dsd_name(const EPR_SDatasetId* dataset_id);
1066 
1074 
1082 
1089 const EPR_SDSD* epr_get_dsd(const EPR_SDatasetId* dataset_id);
1090 
1098 
1099 
1101 EPR_SDSD* epr_get_dsd_at(const EPR_SProductId* product_id, uint dsd_index);
1102 
1105 /*
1106  * ================================= (5.2) Records ============================
1107  */
1108 
1124 
1144  uint record_index,
1145  EPR_SRecord* record);
1146 
1155 
1158 /*
1159  * =========================== (5.3) Field Access =============================
1160  */
1161 
1178 const EPR_SField* epr_get_field(const EPR_SRecord* record, const char* field_name);
1179 
1187 
1196 const EPR_SField* epr_get_field_at(const EPR_SRecord* record, uint field_index);
1197 
1204 const char* epr_get_field_unit(const EPR_SField* field);
1205 
1213 const char* epr_get_field_description(const EPR_SField* field);
1214 
1223 
1231 const char* epr_get_field_name(const EPR_SField* field);
1232 
1241 
1244 /*
1245  * ========================= (5.4) Single Element Access =========================
1246  */
1247 
1263 char epr_get_field_elem_as_char(const EPR_SField* field, uint elem_index);
1265 short epr_get_field_elem_as_short(const EPR_SField* field, uint elem_index);
1267 int epr_get_field_elem_as_int(const EPR_SField* field, uint elem_index);
1269 float epr_get_field_elem_as_float(const EPR_SField* field, uint elem_index);
1270 double epr_get_field_elem_as_double(const EPR_SField* field, uint elem_index);
1272 const char* epr_get_field_elem_as_str(const EPR_SField* field);
1275 /*
1276  * =========================== (5.5) Array Element Access =============================
1277  */
1278 
1291 const char* epr_get_field_elems_char(const EPR_SField* field);
1293 const short* epr_get_field_elems_short(const EPR_SField* field);
1295 const int* epr_get_field_elems_int(const EPR_SField* field);
1297 const float* epr_get_field_elems_float(const EPR_SField* field);
1298 const double* epr_get_field_elems_double(const EPR_SField* field);
1317 uint epr_copy_field_elems_as_ints(const EPR_SField* field, int* buffer, uint num_elems);
1318 uint epr_copy_field_elems_as_uints(const EPR_SField* field, uint* buffer, uint num_elems);
1319 uint epr_copy_field_elems_as_floats(const EPR_SField* field, float* buffer, uint num_elems);
1320 uint epr_copy_field_elems_as_doubles(const EPR_SField* field, double* buffer, uint num_elems);
1325 /*
1326  * ======================== (6) Geophysical Data Access =========================
1327  */
1328 
1336 /*
1337  * ================================== (6.1) Raster ===============================
1338  */
1339 
1381  uint source_width,
1382  uint source_height,
1383  uint source_step_x,
1384  uint source_step_y);
1385 
1399  uint source_width,
1400  uint source_height,
1401  uint source_step_x,
1402  uint source_step_y);
1403 
1404 
1416  uint source_height,
1417  uint source_step_x,
1418  uint source_step_y);
1419 
1438  int offset_x,
1439  int offset_y,
1440  EPR_SRaster* raster);
1441 
1442 
1447 
1451 void* epr_get_raster_elem_addr(const EPR_SRaster* raster, uint offset);
1452 
1456 void* epr_get_raster_pixel_addr(const EPR_SRaster* raster, uint x, uint y);
1457 
1462 
1463 
1472 
1481 
1482 
1483 
1491 
1501 
1509 EPR_SBandId* epr_get_band_id(EPR_SProductId* product_id, const char* band_name);
1510 
1517 const char* epr_get_band_name(EPR_SBandId* band_id);
1518 
1525 
1528 /*
1529  * ============================ (6.2) Single Pixel Access ========================
1530  */
1531 
1548 uint epr_get_pixel_as_uint(const EPR_SRaster* raster, int x, int y);
1549 int epr_get_pixel_as_int(const EPR_SRaster* raster, int x, int y);
1550 float epr_get_pixel_as_float(const EPR_SRaster* raster, int x, int y);
1551 double epr_get_pixel_as_double(const EPR_SRaster* raster, int x, int y);
1554 /*
1555  * ================================= (7) Bitmasks ==========================
1556  */
1557 
1584  const char* bm_expr,
1585  int offset_x,
1586  int offset_y,
1587  EPR_SRaster* raster);
1588 
1591 /*
1592  * ================================= (8) Utility functions ==========================
1593  */
1594 
1604 
1608 const char* epr_data_type_id_to_str(EPR_EDataTypeId data_type_id);
1609 
1612 #ifdef __cplusplus
1613 } /* extern "C" */
1614 #endif
1615 #endif /* #ifndef EPR_API_H_INCL */
epr_get_last_err_code
EPR_EErrCode epr_get_last_err_code(void)
Gets the error code of the error that occured during the last API function call.
EPR_Raster::source_step_x
uint source_step_x
The sub-sampling for the across-track direction in pixel.
Definition: epr_api.h:555
EPR_Record::num_fields
uint num_fields
The number of fields contained in this record.
Definition: epr_api.h:465
e_err_invalid_field_name
@ e_err_invalid_field_name
Definition: epr_api.h:107
EPR_DSD::dsr_size
uint dsr_size
The size of dataset record for the given dataset name.
Definition: epr_api.h:436
e_smod_1OF2
@ e_smod_1OF2
Definition: epr_api.h:140
epr_get_dsd
const EPR_SDSD * epr_get_dsd(const EPR_SDatasetId *dataset_id)
Gets the dataset descriptor (DSD) for the dataset specified by dataset_id.
EPR_DatasetId::magic
EPR_Magic magic
The magic number for this structure.
Definition: epr_api.h:343
EPR_LogLevel
EPR_LogLevel
The EPR_LogLevel enumeration lists possible log levels for the ENVISAT product reader API.
Definition: epr_api.h:130
EPR_BandId::band_name
char * band_name
The name as presented to the user in a band selection dialog (also known as spectral subset)
Definition: epr_api.h:660
e_err_out_of_memory
@ e_err_out_of_memory
Definition: epr_api.h:87
EPR_BandId::scaling_offset
float scaling_offset
The scaling offset.
Definition: epr_api.h:714
e_err_invalid_band_name
@ e_err_invalid_band_name
Definition: epr_api.h:110
e_log_debug
@ e_log_debug
Definition: epr_api.h:131
EPR_ProductId::file_path
char * file_path
The file's path including the file name.
Definition: epr_api.h:238
e_err_illegal_arg
@ e_err_illegal_arg
Definition: epr_api.h:85
epr_get_field_elem_as_uchar
uchar epr_get_field_elem_as_uchar(const EPR_SField *field, uint elem_index)
epr_get_pixel_as_uint
uint epr_get_pixel_as_uint(const EPR_SRaster *raster, int x, int y)
This group of functions is for getting the values of the elements of a raster (i.e.
epr_get_num_fields
uint epr_get_num_fields(const EPR_SRecord *record)
Gets the number of fields contained in the given record.
epr_read_record
EPR_SRecord * epr_read_record(EPR_SDatasetId *dataset_id, uint record_index, EPR_SRecord *record)
Reads a record of a dataset specified by dataset_id.
EPR_Record
The EPR_Record structure represents a record instance read from an ENVISAT dataset.
Definition: epr_api.h:448
EPR_ELogLevel
enum EPR_LogLevel EPR_ELogLevel
Definition: epr_api.h:171
EPR_Raster::magic
EPR_Magic magic
The magic number for this structure.
Definition: epr_api.h:529
epr_create_bitmask_raster
EPR_SRaster * epr_create_bitmask_raster(uint source_width, uint source_height, uint source_step_x, uint source_step_y)
Creates a raster to be used for reading bitmasks.
EPR_DatasetId::product_id
EPR_SProductId * product_id
The ID of the product to which this dataset belongs to.
Definition: epr_api.h:348
epr_get_num_bands
uint epr_get_num_bands(EPR_SProductId *product_id)
Gets the number of all bands contained in a product.
epr_free_raster
void epr_free_raster(EPR_SRaster *raster)
Release the memory allocated through a raster.
e_log_warning
@ e_log_warning
Definition: epr_api.h:133
epr_free_record
void epr_free_record(EPR_SRecord *record)
Frees the memory allocated through the given record.
EPR_ProductId::band_ids
EPR_SPtrArray * band_ids
Contains and array of all band IDs for the product (type EPR_SBandId*)
Definition: epr_api.h:314
epr_get_field_elem_as_mjd
const EPR_STime * epr_get_field_elem_as_mjd(const EPR_SField *field)
EPR_Time::days
int days
Definition: epr_api.h:766
EPR_DSD::ds_name
char * ds_name
The dataset name.
Definition: epr_api.h:406
EPR_BandId::scaling_method
EPR_EScalingMethod scaling_method
The scaling method which must be applied to the raw source data in order to get the 'real' pixel valu...
Definition: epr_api.h:703
EPR_EErrCode
enum EPR_ErrCode EPR_EErrCode
Definition: epr_api.h:170
epr_dump_element
void epr_dump_element(const EPR_SRecord *record, uint field_index, uint element_index)
EPR_Record::magic
EPR_Magic magic
The magic number for this structure.
Definition: epr_api.h:453
EPR_Raster::source_width
uint source_width
The width of the source .
Definition: epr_api.h:545
EPR_Raster::elem_size
uint elem_size
The size in byte of a single element (sample) of this raster's buffer.
Definition: epr_api.h:540
EPR_DatasetRef::field_index
int field_index
Definition: epr_api.h:599
epr_clear_err
void epr_clear_err(void)
Clears the last error.
EPR_ProductId::sph_record
EPR_SRecord * sph_record
The record representing the specific product header (SPH).
Definition: epr_api.h:279
e_err_none
@ e_err_none
Definition: epr_api.h:81
e_err_invalid_band
@ e_err_invalid_band
Definition: epr_api.h:104
e_err_file_close_failed
@ e_err_file_close_failed
Definition: epr_api.h:98
EPR_DSD::magic
EPR_Magic magic
The magic number for this structure.
Definition: epr_api.h:396
EPR_Raster::data_type
EPR_EDataTypeId data_type
The data type of the band's pixel values.
Definition: epr_api.h:535
EPR_DatasetRef::dataset_id
EPR_SDatasetId * dataset_id
Definition: epr_api.h:598
epr_get_field_elem_as_uint
uint epr_get_field_elem_as_uint(const EPR_SField *field, uint elem_index)
EPR_Field::magic
EPR_Magic magic
The magic number for this structure.
Definition: epr_api.h:487
epr_get_field_elems_int
const int * epr_get_field_elems_int(const EPR_SField *field)
epr_boolean
int epr_boolean
Definition: epr_api.h:193
e_err_file_access_denied
@ e_err_file_access_denied
Definition: epr_api.h:94
epr_get_pixel_as_float
float epr_get_pixel_as_float(const EPR_SRaster *raster, int x, int y)
epr_init_api
int epr_init_api(EPR_ELogLevel log_level, EPR_FLogHandler log_handler, EPR_FErrHandler err_handler)
Initializes the ENVISAT product reader API.
epr_get_field_elem_as_ushort
ushort epr_get_field_elem_as_ushort(const EPR_SField *field, uint elem_index)
e_tid_float
@ e_tid_float
An array of 32-bit floating point numbers, C type is float*
Definition: epr_api.h:62
e_smid_lin
@ e_smid_lin
Definition: epr_api.h:149
e_err_file_open_failed
@ e_err_file_open_failed
Definition: epr_api.h:97
e_err_invalid_data_format
@ e_err_invalid_data_format
Definition: epr_api.h:111
EPR_BandId::data_type
EPR_EDataTypeId data_type
The data type of the band's pixel values.
Definition: epr_api.h:693
epr_get_band_name
const char * epr_get_band_name(EPR_SBandId *band_id)
Gets the name of the band for the given band ID.
epr_get_raster_pixel_addr
void * epr_get_raster_pixel_addr(const EPR_SRaster *raster, uint x, uint y)
epr_get_field_at
const EPR_SField * epr_get_field_at(const EPR_SRecord *record, uint field_index)
Gets a field at the specified position within the record.
EPR_ProductId::record_info_cache
EPR_SPtrArray * record_info_cache
Cache for record infos.
Definition: epr_api.h:296
epr_get_pixel_as_double
double epr_get_pixel_as_double(const EPR_SRaster *raster, int x, int y)
epr_get_field
const EPR_SField * epr_get_field(const EPR_SRecord *record, const char *field_name)
Gets a field from the given record.
epr_create_compatible_raster
EPR_SRaster * epr_create_compatible_raster(EPR_SBandId *band_id, uint source_width, uint source_height, uint source_step_x, uint source_step_y)
Creates a raster which is compatible with the data type contained in the band identified by band_id.
EPR_SampleModel
EPR_SampleModel
Definition: epr_api.h:138
EPR_DSD::ds_offset
uint ds_offset
The offset of dataset-information the product file.
Definition: epr_api.h:421
epr_get_raster_height
uint epr_get_raster_height(EPR_SRaster *raster)
Gets the raster's scene height in pixels.
e_err_invalid_product_id
@ e_err_invalid_product_id
Definition: epr_api.h:102
epr_get_field_type
EPR_EDataTypeId epr_get_field_type(const EPR_SField *field)
Gets the type of the field.
EPR_Field::info
EPR_SFieldInfo * info
The corresponding field info for this field.
Definition: epr_api.h:493
epr_get_field_elem_as_int
int epr_get_field_elem_as_int(const EPR_SField *field, uint elem_index)
EPR_DSD
The EPR_DSD structure contains information about the propertier of a dataset properties and its locat...
Definition: epr_api.h:391
e_tid_int
@ e_tid_int
An array of signed 32-bit integers, C type is int*
Definition: epr_api.h:60
e_tid_ushort
@ e_tid_ushort
An array of unsigned 16-bit integers, C type is ushort*
Definition: epr_api.h:54
e_err_invalid_record
@ e_err_invalid_record
Definition: epr_api.h:103
e_smod_2TOF
@ e_smod_2TOF
Definition: epr_api.h:143
e_err_illegal_data_type
@ e_err_illegal_data_type
Definition: epr_api.h:90
EPR_Raster::raster_width
uint raster_width
The width of the raster in pixel.
Definition: epr_api.h:566
epr_copy_field_elems_as_floats
uint epr_copy_field_elems_as_floats(const EPR_SField *field, float *buffer, uint num_elems)
epr_get_dataset_id
EPR_SDatasetId * epr_get_dataset_id(EPR_SProductId *product_id, const char *dataset_name)
Gets the dataset_id coresponding to the specified dataset name.
e_smod_2OF2
@ e_smod_2OF2
Definition: epr_api.h:141
epr_get_scene_height
uint epr_get_scene_height(const EPR_SProductId *product_id)
Gets the product's scene height in pixels.
e_err_null_pointer
@ e_err_null_pointer
Definition: epr_api.h:84
EPR_DSD::index
int index
The index of this DSD (zero-based)
Definition: epr_api.h:401
e_err_unknown_endian_order
@ e_err_unknown_endian_order
Definition: epr_api.h:114
EPR_BandId::flag_coding
EPR_SPtrArray * flag_coding
The flag coding is a list of EPR_SFlag instances.
Definition: epr_api.h:738
EPR_FErrHandler
void(* EPR_FErrHandler)(EPR_EErrCode err_code, const char *err_message)
Definition: epr_api.h:189
EPR_FLogHandler
void(* EPR_FLogHandler)(EPR_ELogLevel log_level, const char *log_message)
Definition: epr_api.h:190
e_err_api_not_initialized
@ e_err_api_not_initialized
Definition: epr_api.h:101
EPR_DSD::filename
char * filename
The filename in the DDDB with the description of this dataset.
Definition: epr_api.h:416
e_err_file_write_error
@ e_err_file_write_error
Definition: epr_api.h:96
epr_get_field_elem_as_str
const char * epr_get_field_elem_as_str(const EPR_SField *field)
EPR_BandId::sample_model
EPR_ESampleModel sample_model
The sample model operation applied to the source dataset for getting the correct samples from the MDS...
Definition: epr_api.h:684
EPR_FlagDef::bit_mask
uint bit_mask
The bit mask describing this flag.
Definition: epr_api.h:623
EPR_Raster::source_height
uint source_height
The height of the source.
Definition: epr_api.h:550
epr_get_data_type_size
uint epr_get_data_type_size(EPR_EDataTypeId data_type_id)
Gets the size in bytes for an element of the given data type.
EPR_FlagDef
Represents a flag-field within a flag-record.
Definition: epr_api.h:608
EPR_ProductId::dataset_ids
EPR_SPtrArray * dataset_ids
Contains and array of all dataset IDs for the product (type EPR_SDatasetId*)
Definition: epr_api.h:309
EPR_DatasetId::dataset_name
char * dataset_name
The name as presented to the user in a dataset selection dialog.
Definition: epr_api.h:363
e_err_file_read_error
@ e_err_file_read_error
Definition: epr_api.h:95
EPR_PRODUCT_ID_STRLEN
#define EPR_PRODUCT_ID_STRLEN
Definition: epr_api.h:213
e_err_index_out_of_range
@ e_err_index_out_of_range
Definition: epr_api.h:88
e_err_illegal_conversion
@ e_err_illegal_conversion
Definition: epr_api.h:89
epr_get_field_elems_float
const float * epr_get_field_elems_float(const EPR_SField *field)
EPR_FlagDef::magic
EPR_Magic magic
The magic number for this structure.
Definition: epr_api.h:613
e_err_invalid_value
@ e_err_invalid_value
Definition: epr_api.h:112
EPR_Time::seconds
uint seconds
Definition: epr_api.h:767
EPR_EScalingMethod
enum EPR_ScalingMethod EPR_EScalingMethod
Definition: epr_api.h:173
EPR_ProductId::mph_record
EPR_SRecord * mph_record
The record representing the main product header (MPH).
Definition: epr_api.h:274
e_log_error
@ e_log_error
Definition: epr_api.h:134
EPR_ProductId::istream
FILE * istream
The input stream as returned by the ANSI C fopen function for the given file path.
Definition: epr_api.h:244
e_tid_uint
@ e_tid_uint
An array of unsigned 32-bit integers, C type is uint*
Definition: epr_api.h:58
EPR_SRecordInfo
struct EPR_RecordInfo EPR_SRecordInfo
Definition: epr_api.h:178
epr_get_field_description
const char * epr_get_field_description(const EPR_SField *field)
Gets the description of the field.
epr_get_field_elems_ushort
const ushort * epr_get_field_elems_ushort(const EPR_SField *field)
epr_log_message
void epr_log_message(EPR_ELogLevel log_level, const char *log_message)
A default implementation for a logging function to be passed into the epr_init() function.
EPR_ProductId::param_table
EPR_SPtrArray * param_table
A table containing dynamic field info parameters.
Definition: epr_api.h:304
EPR_ProductId::scene_width
uint scene_width
The total width of product's scene raster in pixels.
Definition: epr_api.h:254
epr_get_field_elems_uint
const uint * epr_get_field_elems_uint(const EPR_SField *field)
epr_get_num_records
uint epr_get_num_records(const EPR_SDatasetId *dataset_id)
Gets the number of records of the dataset specified by dataset_id.
epr_get_dataset_name
const char * epr_get_dataset_name(EPR_SDatasetId *dataset_id)
Gets the name of the dataset for the given dataset ID.
epr_set_log_handler
void epr_set_log_handler(EPR_FLogHandler log_handler)
Sets the log handler for the ENVISAT API.
epr_copy_field_elems_as_uints
uint epr_copy_field_elems_as_uints(const EPR_SField *field, uint *buffer, uint num_elems)
EPR_SFlagSet
struct EPR_FlagSet EPR_SFlagSet
Definition: epr_api.h:188
epr_data_type_id_to_str
const char * epr_data_type_id_to_str(EPR_EDataTypeId data_type_id)
Gets the 'C' data type string for the given data type.
EPR_BandId::dataset_ref
EPR_SDatasetRef dataset_ref
The reference of the source dataset containing the raw data used to create the band's pixel values.
Definition: epr_api.h:673
e_err_file_not_found
@ e_err_file_not_found
Definition: epr_api.h:93
e_err_invalid_raster
@ e_err_invalid_raster
Definition: epr_api.h:105
e_tid_spare
@ e_tid_spare
An array of unsigned character, C type is uchar*
Definition: epr_api.h:68
epr_dump_field
void epr_dump_field(const EPR_SField *field)
EPR_DatasetRef::elem_index
int elem_index
Definition: epr_api.h:600
EPR_Raster
Represents a raster in which data will be stored.
Definition: epr_api.h:524
epr_get_field_elem_as_char
char epr_get_field_elem_as_char(const EPR_SField *field, uint elem_index)
epr_get_num_dsds
uint epr_get_num_dsds(const EPR_SProductId *product_id)
epr_get_raster_width
uint epr_get_raster_width(EPR_SRaster *raster)
Gets the raster's scene width in pixels.
EPR_Magic
int EPR_Magic
Definition: epr_api.h:200
EPR_DatasetRef
The EPR_DatasetRef structure represents the information from dddb with the reference to data name (i...
Definition: epr_api.h:597
epr_create_raster
EPR_SRaster * epr_create_raster(EPR_EDataTypeId data_type, uint source_width, uint source_height, uint source_step_x, uint source_step_y)
Creates a raster of the specified data type.
epr_get_last_err_message
const char * epr_get_last_err_message(void)
Gets the error message of the error that occured during the last API function call.
epr_close_api
void epr_close_api(void)
Closes the ENVISAT product reader API by releasing all resources allocated by the API.
EPR_Record::fields
EPR_SField ** fields
The record fields.
Definition: epr_api.h:471
EPR_ProductId::magic
EPR_Magic magic
The magic number for this structure.
Definition: epr_api.h:233
EPR_Raster::raster_height
uint raster_height
The height of the raster in pixel.
Definition: epr_api.h:572
e_err_invalid_record_name
@ e_err_invalid_record_name
Definition: epr_api.h:108
e_log_info
@ e_log_info
Definition: epr_api.h:132
epr_get_field_elem_as_short
short epr_get_field_elem_as_short(const EPR_SField *field, uint elem_index)
EPR_BandId::magic
EPR_Magic magic
The magic number for this structure.
Definition: epr_api.h:649
EPR_Raster::source_step_y
uint source_step_y
The sub-sampling for the along-track direction in pixel.
Definition: epr_api.h:560
epr_print_record
void epr_print_record(const EPR_SRecord *record, FILE *ostream)
EPR_BandId::scaling_factor
float scaling_factor
The scaling factor.
Definition: epr_api.h:726
e_err_invalid_dataset_name
@ e_err_invalid_dataset_name
Definition: epr_api.h:106
EPR_DSD::ds_type
char * ds_type
The dataset type descriptor.
Definition: epr_api.h:411
epr_set_log_level
int epr_set_log_level(EPR_ELogLevel log_level)
Sets the log level for the ENVISAT API.
EPR_Time::microseconds
uint microseconds
Definition: epr_api.h:768
epr_get_dsd_name
const char * epr_get_dsd_name(const EPR_SDatasetId *dataset_id)
Gets the name of the dsd for the given dataset ID.
e_tid_char
@ e_tid_char
An array of signed 8-bit integers, C type is char*
Definition: epr_api.h:52
EPR_ESampleModel
enum EPR_SampleModel EPR_ESampleModel
Definition: epr_api.h:172
EPR_DataTypeId
EPR_DataTypeId
The EPR_DataTypeId enumeration lists all possible data types for field elements in ENVISAT dataset re...
Definition: epr_api.h:46
epr_get_dataset_id_at
EPR_SDatasetId * epr_get_dataset_id_at(EPR_SProductId *product_id, uint index)
Gets the dataset_id at the specified position within the product.
e_err_illegal_state
@ e_err_illegal_state
Definition: epr_api.h:86
EPR_ProductId::dsd_array
EPR_SPtrArray * dsd_array
An array containing all (!) DSDs read from the product's specific product header (SPH).
Definition: epr_api.h:285
EPR_Field::elems
void * elems
The elements of this field.
Definition: epr_api.h:515
EPR_SParamElem
struct EPR_ParamElem EPR_SParamElem
Definition: epr_api.h:184
epr_get_raster_elem_addr
void * epr_get_raster_elem_addr(const EPR_SRaster *raster, uint offset)
EPR_BandId::lines_mirrored
epr_boolean lines_mirrored
If true (=1) lines will be mirrored (flipped) after read into a raster in order to ensure a pixel ord...
Definition: epr_api.h:755
e_tid_double
@ e_tid_double
An array of 64-bit floating point numbers, C type is double*
Definition: epr_api.h:64
EPR_ProductId::id_string
char id_string[EPR_PRODUCT_ID_STRLEN+1]
The product identifier string obtained from the MPH parameter 'PRODUCT'.
Definition: epr_api.h:269
epr_get_sph
EPR_SRecord * epr_get_sph(const EPR_SProductId *product_id)
Gets the SPH record from the given product_id.
EPR_DSD::ds_size
uint ds_size
The size of dataset-information in dataset product file.
Definition: epr_api.h:426
epr_get_pixel_as_int
int epr_get_pixel_as_int(const EPR_SRaster *raster, int x, int y)
EPR_BandId::description
char * description
A short description of the band's contents.
Definition: epr_api.h:748
epr_create_record
EPR_SRecord * epr_create_record(EPR_SDatasetId *dataset_id)
Creates a new, empty record with a structure compatible with the dataset specified by dataset_id.
epr_print_field
void epr_print_field(const EPR_SField *field, FILE *ostream)
epr_copy_field_elems_as_ints
uint epr_copy_field_elems_as_ints(const EPR_SField *field, int *buffer, uint num_elems)
epr_get_num_datasets
uint epr_get_num_datasets(EPR_SProductId *product_id)
Gets the number off all datasets contained in a product.
epr_get_scene_width
uint epr_get_scene_width(const EPR_SProductId *product_id)
Gets the product's scene width in pixels.
EPR_SBitmaskTerm
struct EPR_BitmaskTerm EPR_SBitmaskTerm
Definition: epr_api.h:187
epr_get_field_elems_double
const double * epr_get_field_elems_double(const EPR_SField *field)
epr_get_field_num_elems
uint epr_get_field_num_elems(const EPR_SField *field)
Gets the number of elements of the field.
e_err_invalid_keyword_name
@ e_err_invalid_keyword_name
Definition: epr_api.h:113
e_smod_1OF1
@ e_smod_1OF1
Definition: epr_api.h:139
e_smod_3TOI
@ e_smod_3TOI
Definition: epr_api.h:142
EPR_FlagDef::description
char * description
The flag description.
Definition: epr_api.h:628
epr_get_field_elems_uchar
const uchar * epr_get_field_elems_uchar(const EPR_SField *field)
EPR_ProductId::meris_iodd_version
int meris_iodd_version
For MERIS L1b and RR and FR to provide backward compatibility.
Definition: epr_api.h:319
EPR_DatasetId::record_info
EPR_SRecordInfo * record_info
The record info which describes a record of this dataset.
Definition: epr_api.h:373
EPR_DatasetId::dsd
const EPR_SDSD * dsd
The dataset descriptor obtained from the current product.
Definition: epr_api.h:358
e_tid_string
@ e_tid_string
A zero-terminated ASCII string, C type is char*
Definition: epr_api.h:66
EPR_ProductId::scene_height
uint scene_height
The total height of product's scene raster in pixels.
Definition: epr_api.h:259
epr_get_field_elem_as_double
double epr_get_field_elem_as_double(const EPR_SField *field, uint elem_index)
epr_set_err_handler
void epr_set_err_handler(EPR_FErrHandler err_handler)
Sets the error handler for the ENVISAT API.
e_tid_short
@ e_tid_short
An array of signed 16-bit integers, C type is short*
Definition: epr_api.h:56
epr_print_element
void epr_print_element(const EPR_SRecord *record, uint field_index, uint element_index, FILE *ostream)
epr_get_field_elems_short
const short * epr_get_field_elems_short(const EPR_SField *field)
epr_get_raster_elem_size
uint epr_get_raster_elem_size(const EPR_SRaster *raster)
EPR_DatasetId::dsd_name
char * dsd_name
The name as presented to the user in a dsd selection dialog.
Definition: epr_api.h:353
EPR_BandId
The EPR_BandId structure contains information about a band within an ENVISAT product file which has b...
Definition: epr_api.h:644
e_smid_non
@ e_smid_non
Definition: epr_api.h:148
epr_get_band_id
EPR_SBandId * epr_get_band_id(EPR_SProductId *product_id, const char *band_name)
Gets the band ID corresponding to the specified name.
EPR_Raster::buffer
void * buffer
The elements of this raster.
Definition: epr_api.h:578
epr_get_band_id_at
EPR_SBandId * epr_get_band_id_at(EPR_SProductId *product_id, uint index)
Gets the band ID at the specified position within the product.
e_tid_time
@ e_tid_time
A time (MJD) structure, C type is EPR_Time
Definition: epr_api.h:70
epr_get_field_unit
const char * epr_get_field_unit(const EPR_SField *field)
Gets the unit of the field.
EPR_EDataTypeId
enum EPR_DataTypeId EPR_EDataTypeId
Definition: epr_api.h:169
EPR_Field
Represents a field within a record.
Definition: epr_api.h:482
e_smid_log
@ e_smid_log
Definition: epr_api.h:150
e_tid_unknown
@ e_tid_unknown
The ID for unknown types.
Definition: epr_api.h:48
EPR_BandId::spectr_band_index
int spectr_band_index
The (zero-based) spectral band index.
Definition: epr_api.h:665
EPR_ScalingMethod
EPR_ScalingMethod
Definition: epr_api.h:147
epr_get_raster_line_addr
void * epr_get_raster_line_addr(const EPR_SRaster *raster, uint y)
EPR_ProductId::tot_size
uint tot_size
The total size in bytes of the product file.
Definition: epr_api.h:249
EPR_DatasetId::description
char * description
A short description of the band's contents.
Definition: epr_api.h:379
epr_open_product
EPR_SProductId * epr_open_product(const char *product_file_path)
Opens the ENVISAT product file with the given file path, reads MPH, SPH and all DSDs,...
EPR_BandId::bm_expr
char * bm_expr
A bit-mask expression used to filter valid pixels.
Definition: epr_api.h:731
EPR_Time
Represents a binary time value field in ENVISAT records.
Definition: epr_api.h:765
e_tid_uchar
@ e_tid_uchar
An array of unsigned 8-bit integers, C type is uchar*
Definition: epr_api.h:50
epr_get_field_name
const char * epr_get_field_name(const EPR_SField *field)
Gets the name of the field.
EPR_DatasetId
The EPR_DatasetId structure contains information about a dataset within an ENVISAT product file which...
Definition: epr_api.h:338
EPR_BandId::product_id
EPR_SProductId * product_id
The ID of the product to which this band belongs to.
Definition: epr_api.h:654
epr_get_field_elems_char
const char * epr_get_field_elems_char(const EPR_SField *field)
EPR_DSD::num_dsr
uint num_dsr
The number of dataset records for the given dataset name.
Definition: epr_api.h:431
ushort
unsigned short ushort
Definition: epr_api.h:195
epr_read_band_raster
int epr_read_band_raster(EPR_SBandId *band_id, int offset_x, int offset_y, EPR_SRaster *raster)
Reads (geo-)physical values of the given band of the specified source-region.
epr_get_field_elem_as_float
float epr_get_field_elem_as_float(const EPR_SField *field, uint elem_index)
ulong
unsigned long ulong
Definition: epr_api.h:197
epr_dump_record
void epr_dump_record(const EPR_SRecord *record)
epr_get_mph
EPR_SRecord * epr_get_mph(const EPR_SProductId *product_id)
Gets the MPH record from the given product_id.
epr_get_dsd_at
EPR_SDSD * epr_get_dsd_at(const EPR_SProductId *product_id, uint dsd_index)
EPR_ErrCode
EPR_ErrCode
The EPR_ErrCode enumeration lists all possible error codes for the ENVISAT product reader API.
Definition: epr_api.h:79
uint
unsigned int uint
Definition: epr_api.h:196
uchar
unsigned char uchar
Definition: epr_api.h:194
epr_read_bitmask_raster
int epr_read_bitmask_raster(EPR_SProductId *product_id, const char *bm_expr, int offset_x, int offset_y, EPR_SRaster *raster)
Calculates a bit-mask, composed of flags of the given product and combined as described in the given ...
EPR_Record::info
EPR_SRecordInfo * info
The corresponding record info for this record (a 'soft' pointer).
Definition: epr_api.h:458
EPR_DatasetId::record_descriptor
const struct RecordDescriptor * record_descriptor
The record descriptor found in the DDDB for this dataset.
Definition: epr_api.h:368
e_err_invalid_product_name
@ e_err_invalid_product_name
Definition: epr_api.h:109
epr_copy_field_elems_as_doubles
uint epr_copy_field_elems_as_doubles(const EPR_SField *field, double *buffer, uint num_elems)
epr_close_product
int epr_close_product(EPR_SProductId *product_id)
Closes the ENVISAT product file determined by the given product identifier.
EPR_BandId::unit
char * unit
The geophysical unit for the band's pixel values.
Definition: epr_api.h:743
e_err_flag_not_found
@ e_err_flag_not_found
Definition: epr_api.h:117
e_err_invalid_ddbb_format
@ e_err_invalid_ddbb_format
Definition: epr_api.h:121
EPR_FlagDef::name
char * name
The flag name.
Definition: epr_api.h:618
EPR_SFieldInfo
struct EPR_FieldInfo EPR_SFieldInfo
Definition: epr_api.h:180
EPR_ProductId
The EPR_ProductId structure contains information about an ENVISAT product file which has been opened ...
Definition: epr_api.h:228

Generated on Sat Oct 24 2020 07:44:39

ENVISAT Product Reader C API

Written by Brockmann Consult, © 2002     Brockmann Consult      Eropean Space Agency