ENVISAT Product Reader C API 2.3
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
23extern "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 */
40
72
73
123
124
136
145
152
153struct EPR_ProductId;
154struct EPR_DatasetId;
155struct EPR_BandId;
156struct EPR_Record;
157struct EPR_RecordInfo;
158struct EPR_Field;
159struct EPR_FieldInfo;
160struct EPR_ProductInfo;
161struct EPR_DSD;
162struct EPR_Raster;
163struct EPR_DatasetRef;
164struct EPR_Flag;
165struct EPR_BandId;
166struct EPR_ParamElem;
167struct EPR_Time;
168
176typedef struct EPR_BandId EPR_SBandId;
177typedef struct EPR_Record EPR_SRecord;
178typedef struct EPR_RecordInfo EPR_SRecordInfo;
179typedef struct EPR_Field EPR_SField;
180typedef struct EPR_FieldInfo EPR_SFieldInfo;
181typedef struct EPR_DSD EPR_SDSD;
182typedef struct EPR_Raster EPR_SRaster;
184typedef struct EPR_ParamElem EPR_SParamElem;
185typedef struct EPR_Time EPR_STime;
187typedef struct EPR_BitmaskTerm EPR_SBitmaskTerm;
188typedef struct EPR_FlagSet EPR_SFlagSet;
189typedef void (*EPR_FErrHandler)(EPR_EErrCode err_code, const char* err_message);
190typedef void (*EPR_FLogHandler)(EPR_ELogLevel log_level, const char* log_message);
191
192
193typedef int epr_boolean;
194typedef unsigned char uchar;
195typedef unsigned short ushort;
196typedef unsigned int uint;
197typedef unsigned long ulong;
198
199
200typedef 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
239
249
254
259
264
269
274 FILE* istream;
275
280
285
290 EPR_SPtrArray* dsd_array;
291
301 EPR_SPtrArray* record_info_cache;
302
309 EPR_SPtrArray* param_table;
310
314 EPR_SPtrArray* dataset_ids;
315
319 EPR_SPtrArray* band_ids;
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
380};
381
382
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
473
482{
488
494
515 void* elems;
516};
517
580
581
597{
599 int field_index; /* -1 if not used */
600 int elem_index; /* -1 if not used */
601};
602
608{
614
619
623 char* name;
624
629};
630
631
757
770
771
772
773/*************************************************************************/
774/********************************* FUNCTIONS *****************************/
775/*************************************************************************/
776
777/*
778 * ============================ (1) Initialisation ==========================
779 */
780
785
802 EPR_FLogHandler log_handler,
803 EPR_FErrHandler err_handler);
804
805
812void epr_close_api(void);
814
815
816/*
817 * ============================ (2) Logging ============================
818 */
819
824
836
847
856void epr_log_message(EPR_ELogLevel log_level, const char* log_message);
857
859
860/*
861 * ========================= (3) Error Handling ==========================
862 */
863
868
876
884
891const char* epr_get_last_err_message(void);
892
898void epr_clear_err(void);
899
901
902/*
903 * ========================== (4) Input / Output ============================
904 */
905
910
911/*
912 * ======================= (4.1) Product File Access ==========================
913 */
914
919
933EPR_SProductId* epr_open_product(const char* product_file_path);
934
944
946
947/*
948 * ================= (4.2) Writing to a file or standard output =================
949 */
950
977void epr_print_record(const EPR_SRecord* record, FILE* ostream);
978void epr_print_field(const EPR_SField* field, FILE* ostream);
979void epr_print_element(const EPR_SRecord* record, uint field_index, uint element_index, FILE* ostream);
980void epr_dump_record(const EPR_SRecord* record);
981void epr_dump_field(const EPR_SField* field);
982void epr_dump_element(const EPR_SRecord* record, uint field_index, uint element_index);
984
985/*
986 * ======================= (5) Basic Data Access =========================
987 */
988
993
1002
1011
1013
1014/*
1015 * ============================ (5.1) Dataset ==============================
1016 */
1017
1023
1031
1041
1049EPR_SDatasetId* epr_get_dataset_id(EPR_SProductId* product_id, const char* dataset_name);
1050
1057const char* epr_get_dataset_name(EPR_SDatasetId* dataset_id);
1058
1065const char* epr_get_dsd_name(const EPR_SDatasetId* dataset_id);
1066
1074
1082
1089const EPR_SDSD* epr_get_dsd(const EPR_SDatasetId* dataset_id);
1090
1098
1099
1101EPR_SDSD* epr_get_dsd_at(const EPR_SProductId* product_id, uint dsd_index);
1102
1104
1105/*
1106 * ================================= (5.2) Records ============================
1107 */
1108
1114
1124
1144 uint record_index,
1145 EPR_SRecord* record);
1146
1155
1157
1158/*
1159 * =========================== (5.3) Field Access =============================
1160 */
1161
1167
1178const EPR_SField* epr_get_field(const EPR_SRecord* record, const char* field_name);
1179
1187
1196const EPR_SField* epr_get_field_at(const EPR_SRecord* record, uint field_index);
1197
1204const char* epr_get_field_unit(const EPR_SField* field);
1205
1213const char* epr_get_field_description(const EPR_SField* field);
1214
1223
1231const char* epr_get_field_name(const EPR_SField* field);
1232
1241
1243
1244/*
1245 * ========================= (5.4) Single Element Access =========================
1246 */
1247
1263char epr_get_field_elem_as_char(const EPR_SField* field, uint elem_index);
1265short epr_get_field_elem_as_short(const EPR_SField* field, uint elem_index);
1267int epr_get_field_elem_as_int(const EPR_SField* field, uint elem_index);
1269float epr_get_field_elem_as_float(const EPR_SField* field, uint elem_index);
1270double epr_get_field_elem_as_double(const EPR_SField* field, uint elem_index);
1272const char* epr_get_field_elem_as_str(const EPR_SField* field);
1274
1275/*
1276 * =========================== (5.5) Array Element Access =============================
1277 */
1278
1291const char* epr_get_field_elems_char(const EPR_SField* field);
1293const short* epr_get_field_elems_short(const EPR_SField* field);
1295const int* epr_get_field_elems_int(const EPR_SField* field);
1297const float* epr_get_field_elems_float(const EPR_SField* field);
1298const double* epr_get_field_elems_double(const EPR_SField* field);
1300
1317uint epr_copy_field_elems_as_ints(const EPR_SField* field, int* buffer, uint num_elems);
1318uint epr_copy_field_elems_as_uints(const EPR_SField* field, uint* buffer, uint num_elems);
1319uint epr_copy_field_elems_as_floats(const EPR_SField* field, float* buffer, uint num_elems);
1320uint epr_copy_field_elems_as_doubles(const EPR_SField* field, double* buffer, uint num_elems);
1322
1323
1324
1325/*
1326 * ======================== (6) Geophysical Data Access =========================
1327 */
1328
1333
1335
1336/*
1337 * ================================== (6.1) Raster ===============================
1338 */
1339
1345
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
1451void* epr_get_raster_elem_addr(const EPR_SRaster* raster, uint offset);
1452
1457
1462
1463
1472
1481
1482
1483
1491
1501
1509EPR_SBandId* epr_get_band_id(EPR_SProductId* product_id, const char* band_name);
1510
1517const char* epr_get_band_name(EPR_SBandId* band_id);
1518
1525
1527
1528/*
1529 * ============================ (6.2) Single Pixel Access ========================
1530 */
1531
1537
1548uint epr_get_pixel_as_uint(const EPR_SRaster* raster, int x, int y);
1549int epr_get_pixel_as_int(const EPR_SRaster* raster, int x, int y);
1550float epr_get_pixel_as_float(const EPR_SRaster* raster, int x, int y);
1551double epr_get_pixel_as_double(const EPR_SRaster* raster, int x, int y);
1553
1554/*
1555 * ================================= (7) Bitmasks ==========================
1556 */
1557
1562
1584 const char* bm_expr,
1585 int offset_x,
1586 int offset_y,
1587 EPR_SRaster* raster);
1588
1590
1591/*
1592 * ================================= (8) Utility functions ==========================
1593 */
1594
1599
1604
1609
1611
1612#ifdef __cplusplus
1613} /* extern "C" */
1614#endif
1615#endif /* #ifndef EPR_API_H_INCL */
struct EPR_DSD EPR_SDSD
Definition epr_api.h:181
struct EPR_Raster EPR_SRaster
Definition epr_api.h:182
struct EPR_BitmaskTerm EPR_SBitmaskTerm
Definition epr_api.h:187
EPR_LogLevel
The EPR_LogLevel enumeration lists possible log levels for the ENVISAT product reader API.
Definition epr_api.h:130
@ e_log_debug
Definition epr_api.h:131
@ e_log_info
Definition epr_api.h:132
@ e_log_error
Definition epr_api.h:134
@ e_log_warning
Definition epr_api.h:133
enum EPR_SampleModel EPR_ESampleModel
Definition epr_api.h:172
struct EPR_ProductId EPR_SProductId
Definition epr_api.h:174
EPR_SampleModel
Definition epr_api.h:138
@ e_smod_2OF2
Definition epr_api.h:141
@ e_smod_1OF2
Definition epr_api.h:140
@ e_smod_3TOI
Definition epr_api.h:142
@ e_smod_2TOF
Definition epr_api.h:143
@ e_smod_1OF1
Definition epr_api.h:139
enum EPR_ErrCode EPR_EErrCode
Definition epr_api.h:170
struct EPR_Record EPR_SRecord
Definition epr_api.h:177
unsigned char uchar
Definition epr_api.h:194
enum EPR_DataTypeId EPR_EDataTypeId
Definition epr_api.h:169
unsigned long ulong
Definition epr_api.h:197
struct EPR_DatasetId EPR_SDatasetId
Definition epr_api.h:175
void(* EPR_FErrHandler)(EPR_EErrCode err_code, const char *err_message)
Definition epr_api.h:189
struct EPR_Field EPR_SField
Definition epr_api.h:179
struct EPR_FieldInfo EPR_SFieldInfo
Definition epr_api.h:180
EPR_ErrCode
The EPR_ErrCode enumeration lists all possible error codes for the ENVISAT product reader API.
Definition epr_api.h:79
@ e_err_file_not_found
Definition epr_api.h:93
@ e_err_unknown_endian_order
Definition epr_api.h:114
@ e_err_file_read_error
Definition epr_api.h:95
@ e_err_invalid_band_name
Definition epr_api.h:110
@ e_err_file_close_failed
Definition epr_api.h:98
@ e_err_illegal_data_type
Definition epr_api.h:90
@ e_err_invalid_product_name
Definition epr_api.h:109
@ e_err_invalid_product_id
Definition epr_api.h:102
@ e_err_invalid_keyword_name
Definition epr_api.h:113
@ e_err_invalid_field_name
Definition epr_api.h:107
@ e_err_file_access_denied
Definition epr_api.h:94
@ e_err_invalid_data_format
Definition epr_api.h:111
@ e_err_file_open_failed
Definition epr_api.h:97
@ e_err_invalid_band
Definition epr_api.h:104
@ e_err_index_out_of_range
Definition epr_api.h:88
@ e_err_invalid_dataset_name
Definition epr_api.h:106
@ e_err_invalid_record
Definition epr_api.h:103
@ e_err_null_pointer
Definition epr_api.h:84
@ e_err_invalid_ddbb_format
Definition epr_api.h:121
@ e_err_illegal_arg
Definition epr_api.h:85
@ e_err_file_write_error
Definition epr_api.h:96
@ e_err_invalid_value
Definition epr_api.h:112
@ e_err_none
Definition epr_api.h:81
@ e_err_illegal_conversion
Definition epr_api.h:89
@ e_err_flag_not_found
Definition epr_api.h:117
@ e_err_out_of_memory
Definition epr_api.h:87
@ e_err_api_not_initialized
Definition epr_api.h:101
@ e_err_invalid_raster
Definition epr_api.h:105
@ e_err_illegal_state
Definition epr_api.h:86
@ e_err_invalid_record_name
Definition epr_api.h:108
unsigned int uint
Definition epr_api.h:196
struct EPR_FlagSet EPR_SFlagSet
Definition epr_api.h:188
EPR_ScalingMethod
Definition epr_api.h:147
@ e_smid_non
Definition epr_api.h:148
@ e_smid_lin
Definition epr_api.h:149
@ e_smid_log
Definition epr_api.h:150
int EPR_Magic
Definition epr_api.h:200
enum EPR_LogLevel EPR_ELogLevel
Definition epr_api.h:171
struct EPR_BandId EPR_SBandId
Definition epr_api.h:176
unsigned short ushort
Definition epr_api.h:195
void(* EPR_FLogHandler)(EPR_ELogLevel log_level, const char *log_message)
Definition epr_api.h:190
struct EPR_ParamElem EPR_SParamElem
Definition epr_api.h:184
struct EPR_FlagDef EPR_SFlagDef
Definition epr_api.h:183
struct EPR_Time EPR_STime
Definition epr_api.h:185
int epr_boolean
Definition epr_api.h:193
struct EPR_RecordInfo EPR_SRecordInfo
Definition epr_api.h:178
#define EPR_PRODUCT_ID_STRLEN
Definition epr_api.h:213
struct EPR_DatasetRef EPR_SDatasetRef
Definition epr_api.h:186
EPR_DataTypeId
The EPR_DataTypeId enumeration lists all possible data types for field elements in ENVISAT dataset re...
Definition epr_api.h:46
@ e_tid_time
A time (MJD) structure, C type is EPR_Time.
Definition epr_api.h:70
@ e_tid_string
A zero-terminated ASCII string, C type is char*.
Definition epr_api.h:66
@ e_tid_uchar
An array of unsigned 8-bit integers, C type is uchar*.
Definition epr_api.h:50
@ e_tid_unknown
The ID for unknown types.
Definition epr_api.h:48
@ e_tid_int
An array of signed 32-bit integers, C type is int*.
Definition epr_api.h:60
@ e_tid_char
An array of signed 8-bit integers, C type is char*.
Definition epr_api.h:52
@ e_tid_float
An array of 32-bit floating point numbers, C type is float*.
Definition epr_api.h:62
@ e_tid_short
An array of signed 16-bit integers, C type is short*.
Definition epr_api.h:56
@ e_tid_ushort
An array of unsigned 16-bit integers, C type is ushort*.
Definition epr_api.h:54
@ e_tid_uint
An array of unsigned 32-bit integers, C type is uint*.
Definition epr_api.h:58
@ e_tid_double
An array of 64-bit floating point numbers, C type is double*.
Definition epr_api.h:64
@ e_tid_spare
An array of unsigned character, C type is uchar*.
Definition epr_api.h:68
enum EPR_ScalingMethod EPR_EScalingMethod
Definition epr_api.h:173
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 ...
uint epr_copy_field_elems_as_doubles(const EPR_SField *field, double *buffer, uint num_elems)
uint epr_copy_field_elems_as_uints(const EPR_SField *field, uint *buffer, uint num_elems)
uint epr_copy_field_elems_as_floats(const EPR_SField *field, float *buffer, uint num_elems)
uint epr_copy_field_elems_as_ints(const EPR_SField *field, int *buffer, uint num_elems)
uint epr_get_num_datasets(EPR_SProductId *product_id)
Gets the number off all datasets contained in a product.
const char * epr_get_dsd_name(const EPR_SDatasetId *dataset_id)
Gets the name of the dsd for the given dataset ID.
EPR_SRecord * epr_get_sph(const EPR_SProductId *product_id)
Gets the SPH record from the given product_id.
EPR_SDSD * epr_get_dsd_at(const EPR_SProductId *product_id, uint dsd_index)
const char * epr_get_dataset_name(EPR_SDatasetId *dataset_id)
Gets the name of the dataset for the given dataset ID.
EPR_SDatasetId * epr_get_dataset_id_at(EPR_SProductId *product_id, uint index)
Gets the dataset_id at the specified position within the product.
EPR_SRecord * epr_get_mph(const EPR_SProductId *product_id)
Gets the MPH record from the given product_id.
uint epr_get_num_dsds(const EPR_SProductId *product_id)
EPR_SDatasetId * epr_get_dataset_id(EPR_SProductId *product_id, const char *dataset_name)
Gets the dataset_id corresponding to the specified dataset name.
const EPR_SDSD * epr_get_dsd(const EPR_SDatasetId *dataset_id)
Gets the dataset descriptor (DSD) for the dataset specified by dataset_id.
uint epr_get_num_records(const EPR_SDatasetId *dataset_id)
Gets the number of records of the dataset specified by dataset_id.
uint epr_get_scene_width(const EPR_SProductId *product_id)
Gets the product's scene width in pixels.
uint epr_get_scene_height(const EPR_SProductId *product_id)
Gets the product's scene height in pixels.
void epr_clear_err(void)
Clears the last error.
EPR_EErrCode epr_get_last_err_code(void)
Gets the error code of the error that occurred during the last API function call.
void epr_set_err_handler(EPR_FErrHandler err_handler)
Sets the error handler for the ENVISAT API.
const char * epr_get_last_err_message(void)
Gets the error message of the error that occurred during the last API function call.
const float * epr_get_field_elems_float(const EPR_SField *field)
const ushort * epr_get_field_elems_ushort(const EPR_SField *field)
const double * epr_get_field_elems_double(const EPR_SField *field)
const uchar * epr_get_field_elems_uchar(const EPR_SField *field)
const short * epr_get_field_elems_short(const EPR_SField *field)
const int * epr_get_field_elems_int(const EPR_SField *field)
const uint * epr_get_field_elems_uint(const EPR_SField *field)
const char * epr_get_field_elems_char(const EPR_SField *field)
const char * epr_get_field_description(const EPR_SField *field)
Gets the description of the field.
const char * epr_get_field_unit(const EPR_SField *field)
Gets the unit of the field.
const char * epr_get_field_name(const EPR_SField *field)
Gets the name of the field.
const EPR_SField * epr_get_field_at(const EPR_SRecord *record, uint field_index)
Gets a field at the specified position within the record.
uint epr_get_num_fields(const EPR_SRecord *record)
Gets the number of fields contained in the given record.
uint epr_get_field_num_elems(const EPR_SField *field)
Gets the number of elements of the field.
EPR_EDataTypeId epr_get_field_type(const EPR_SField *field)
Gets the type of the field.
const EPR_SField * epr_get_field(const EPR_SRecord *record, const char *field_name)
Gets a field from the given record.
double epr_get_field_elem_as_double(const EPR_SField *field, uint elem_index)
const char * epr_get_field_elem_as_str(const EPR_SField *field)
const EPR_STime * epr_get_field_elem_as_mjd(const EPR_SField *field)
int epr_get_field_elem_as_int(const EPR_SField *field, uint elem_index)
short epr_get_field_elem_as_short(const EPR_SField *field, uint elem_index)
uchar epr_get_field_elem_as_uchar(const EPR_SField *field, uint elem_index)
ushort epr_get_field_elem_as_ushort(const EPR_SField *field, uint elem_index)
uint epr_get_field_elem_as_uint(const EPR_SField *field, uint elem_index)
float epr_get_field_elem_as_float(const EPR_SField *field, uint elem_index)
char epr_get_field_elem_as_char(const EPR_SField *field, uint elem_index)
int epr_init_api(EPR_ELogLevel log_level, EPR_FLogHandler log_handler, EPR_FErrHandler err_handler)
Initializes the ENVISAT product reader API.
void epr_close_api(void)
Closes the ENVISAT product reader API by releasing all resources allocated by the API.
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.
int epr_set_log_level(EPR_ELogLevel log_level)
Sets the log level for the ENVISAT API.
void epr_set_log_handler(EPR_FLogHandler log_handler)
Sets the log handler for the ENVISAT API.
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,...
int epr_close_product(EPR_SProductId *product_id)
Closes the ENVISAT product file determined by the given product identifier.
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_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.
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.
void * epr_get_raster_elem_addr(const EPR_SRaster *raster, uint offset)
const char * epr_get_band_name(EPR_SBandId *band_id)
Gets the name of the band for the given band ID.
void epr_free_raster(EPR_SRaster *raster)
Release the memory allocated through a raster.
void * epr_get_raster_line_addr(const EPR_SRaster *raster, uint y)
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.
uint epr_get_num_bands(EPR_SProductId *product_id)
Gets the number of all bands contained in a product.
uint epr_get_raster_elem_size(const EPR_SRaster *raster)
uint epr_get_raster_height(EPR_SRaster *raster)
Gets the raster's scene height in pixels.
EPR_SBandId * epr_get_band_id(EPR_SProductId *product_id, const char *band_name)
Gets the band ID corresponding to the specified name.
EPR_SBandId * epr_get_band_id_at(EPR_SProductId *product_id, uint index)
Gets the band ID at the specified position within the product.
uint epr_get_raster_width(EPR_SRaster *raster)
Gets the raster's scene width in pixels.
void * epr_get_raster_pixel_addr(const EPR_SRaster *raster, uint x, uint y)
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.
void epr_free_record(EPR_SRecord *record)
Frees the memory allocated through the given 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.
int epr_get_pixel_as_int(const EPR_SRaster *raster, int x, int y)
double epr_get_pixel_as_double(const EPR_SRaster *raster, int x, int y)
float epr_get_pixel_as_float(const EPR_SRaster *raster, int x, int y)
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.
const char * epr_data_type_id_to_str(EPR_EDataTypeId data_type_id)
Gets the 'C' data type string for the given data type.
uint epr_get_data_type_size(EPR_EDataTypeId data_type_id)
Gets the size in bytes for an element of the given data type.
void epr_dump_record(const EPR_SRecord *record)
void epr_dump_field(const EPR_SField *field)
void epr_dump_element(const EPR_SRecord *record, uint field_index, uint element_index)
void epr_print_element(const EPR_SRecord *record, uint field_index, uint element_index, FILE *ostream)
void epr_print_field(const EPR_SField *field, FILE *ostream)
void epr_print_record(const EPR_SRecord *record, FILE *ostream)
The EPR_BandId structure contains information about a band within an ENVISAT product file which has b...
Definition epr_api.h:644
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
EPR_SProductId * product_id
The ID of the product to which this band belongs to.
Definition epr_api.h:659
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_EDataTypeId data_type
The data type of the band's pixel values.
Definition epr_api.h:693
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
char * description
A short description of the band's contents.
Definition epr_api.h:755
int spectr_band_index
The (zero-based) spectral band index.
Definition epr_api.h:654
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:733
float scaling_factor
The scaling factor.
Definition epr_api.h:726
float scaling_offset
The scaling offset.
Definition epr_api.h:714
char * band_name
The name as presented to the user in a band selection dialog (also known as spectral subset).
Definition epr_api.h:665
EPR_Magic magic
The magic number for this structure.
Definition epr_api.h:649
EPR_SPtrArray * flag_coding
The flag coding is a list of EPR_SFlag instances.
Definition epr_api.h:745
char * unit
The geophysical unit for the band's pixel values.
Definition epr_api.h:750
char * bm_expr
A bit-mask expression used to filter valid pixels.
Definition epr_api.h:738
The EPR_DSD structure contains information about the propertier of a dataset properties and its locat...
Definition epr_api.h:391
char * ds_name
The dataset name.
Definition epr_api.h:406
uint dsr_size
The size of dataset record for the given dataset name.
Definition epr_api.h:436
EPR_Magic magic
The magic number for this structure.
Definition epr_api.h:396
uint ds_size
The size of dataset-information in dataset product file.
Definition epr_api.h:426
int index
The index of this DSD (zero-based).
Definition epr_api.h:401
uint ds_offset
The offset of dataset-information the product file.
Definition epr_api.h:421
uint num_dsr
The number of dataset records for the given dataset name.
Definition epr_api.h:431
char * ds_type
The dataset type descriptor.
Definition epr_api.h:411
char * filename
The filename in the DDDB with the description of this dataset.
Definition epr_api.h:416
The EPR_DatasetId structure contains information about a dataset within an ENVISAT product file which...
Definition epr_api.h:338
const EPR_SDSD * dsd
The dataset descriptor obtained from the current product.
Definition epr_api.h:358
char * dsd_name
The name as presented to the user in a dsd selection dialog.
Definition epr_api.h:353
char * description
A short description of the band's contents.
Definition epr_api.h:379
EPR_SProductId * product_id
The ID of the product to which this dataset belongs to.
Definition epr_api.h:348
const struct RecordDescriptor * record_descriptor
The record descriptor found in the DDDB for this dataset.
Definition epr_api.h:368
EPR_Magic magic
The magic number for this structure.
Definition epr_api.h:343
EPR_SRecordInfo * record_info
The record info which describes a record of this dataset.
Definition epr_api.h:373
char * dataset_name
The name as presented to the user in a dataset selection dialog.
Definition epr_api.h:363
The EPR_DatasetRef structure represents the information from dddb with the reference to data name (i...
Definition epr_api.h:597
int field_index
Definition epr_api.h:599
EPR_SDatasetId * dataset_id
Definition epr_api.h:598
int elem_index
Definition epr_api.h:600
Represents a field within a record.
Definition epr_api.h:482
EPR_Magic magic
The magic number for this structure.
Definition epr_api.h:487
void * elems
The elements of this field.
Definition epr_api.h:515
EPR_SFieldInfo * info
The corresponding field info for this field.
Definition epr_api.h:493
Represents a flag-field within a flag-record.
Definition epr_api.h:608
uint bit_mask
The bit mask describing this flag.
Definition epr_api.h:618
EPR_Magic magic
The magic number for this structure.
Definition epr_api.h:613
char * description
The flag description.
Definition epr_api.h:628
char * name
The flag name.
Definition epr_api.h:623
The EPR_ProductId structure contains information about an ENVISAT product file which has been opened ...
Definition epr_api.h:228
EPR_SPtrArray * band_ids
Contains and array of all band IDs for the product (type EPR_SBandId*).
Definition epr_api.h:319
FILE * istream
The input stream as returned by the ANSI C fopen function for the given file path.
Definition epr_api.h:274
int meris_iodd_version
For MERIS L1b and RR and FR to provide backward compatibility.
Definition epr_api.h:238
char id_string[EPR_PRODUCT_ID_STRLEN+1]
The product identifier string obtained from the MPH parameter 'PRODUCT'.
Definition epr_api.h:248
uint tot_size
The total size in bytes of the product file.
Definition epr_api.h:253
uint scene_height
The total height of product's scene raster in pixels.
Definition epr_api.h:263
char * file_path
The file's path including the file name.
Definition epr_api.h:268
uint scene_width
The total width of product's scene raster in pixels.
Definition epr_api.h:258
EPR_Magic magic
The magic number for this structure.
Definition epr_api.h:233
EPR_SPtrArray * record_info_cache
Cache for record infos.
Definition epr_api.h:301
EPR_SRecord * sph_record
The record representing the specific product header (SPH).
Definition epr_api.h:284
EPR_SPtrArray * param_table
A table containing dynamic field info parameters.
Definition epr_api.h:309
EPR_SRecord * mph_record
The record representing the main product header (MPH).
Definition epr_api.h:279
EPR_SPtrArray * dsd_array
An array containing all (!) DSDs read from the product's specific product header (SPH).
Definition epr_api.h:290
EPR_SPtrArray * dataset_ids
Contains and array of all dataset IDs for the product (type EPR_SDatasetId*).
Definition epr_api.h:314
Represents a raster in which data will be stored.
Definition epr_api.h:524
uint raster_width
The width of the raster in pixel.
Definition epr_api.h:566
void * buffer
The elements of this raster.
Definition epr_api.h:578
uint source_width
The width of the source .
Definition epr_api.h:545
EPR_Magic magic
The magic number for this structure.
Definition epr_api.h:529
EPR_EDataTypeId data_type
The data type of the band's pixel values.
Definition epr_api.h:535
uint source_step_y
The sub-sampling for the along-track direction in pixel.
Definition epr_api.h:560
uint source_step_x
The sub-sampling for the across-track direction in pixel.
Definition epr_api.h:555
uint elem_size
The size in byte of a single element (sample) of this raster's buffer.
Definition epr_api.h:540
uint source_height
The height of the source.
Definition epr_api.h:550
uint raster_height
The height of the raster in pixel.
Definition epr_api.h:572
The EPR_Record structure represents a record instance read from an ENVISAT dataset.
Definition epr_api.h:448
EPR_SRecordInfo * info
The corresponding record info for this record (a 'soft' pointer).
Definition epr_api.h:465
EPR_SField ** fields
The record fields.
Definition epr_api.h:471
uint num_fields
The number of fields contained in this record.
Definition epr_api.h:460
EPR_Magic magic
The magic number for this structure.
Definition epr_api.h:453
Represents a binary time value field in ENVISAT records.
Definition epr_api.h:765
uint microseconds
Definition epr_api.h:768
int days
Definition epr_api.h:766
uint seconds
Definition epr_api.h:767