ENVISAT Product Reader API for C

Modules | Enumerator | Functions | Variables
Single Pixel Access

Modules

 Bitmask
 
 Utility Functions
 

Functions

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.
 
int epr_get_pixel_as_int (const EPR_SRaster *raster, int x, int y)
 
float epr_get_pixel_as_float (const EPR_SRaster *raster, int x, int y)
 
double epr_get_pixel_as_double (const EPR_SRaster *raster, int x, int y)
 

Variables

EPR_Magic EPR_ProductId::magic
 The magic number for this structure.
 
char * EPR_ProductId::file_path
 The file's path including the file name.
 
FILE * EPR_ProductId::istream
 The input stream as returned by the ANSI C fopen function for the given file path.
 
uint EPR_ProductId::tot_size
 The total size in bytes of the product file.
 
uint EPR_ProductId::scene_width
 The total width of product's scene raster in pixels.
 
uint EPR_ProductId::scene_height
 The total height of product's scene raster in pixels.
 
char EPR_ProductId::id_string [EPR_PRODUCT_ID_STRLEN+1]
 The product identifier string obtained from the MPH parameter 'PRODUCT'.
 
EPR_SRecordEPR_ProductId::mph_record
 The record representing the main product header (MPH).
 
EPR_SRecordEPR_ProductId::sph_record
 The record representing the specific product header (SPH).
 
EPR_SPtrArray * EPR_ProductId::dsd_array
 An array containing all (!) DSDs read from the product's specific product header (SPH).
 
EPR_SPtrArray * EPR_ProductId::record_info_cache
 Cache for record infos.
 
EPR_SPtrArray * EPR_ProductId::param_table
 A table containing dynamic field info parameters.
 
EPR_SPtrArray * EPR_ProductId::dataset_ids
 Contains and array of all dataset IDs for the product (type EPR_SDatasetId*)
 
EPR_SPtrArray * EPR_ProductId::band_ids
 Contains and array of all band IDs for the product (type EPR_SBandId*)
 
int EPR_ProductId::meris_iodd_version
 For MERIS L1b and RR and FR to provide backward compatibility.
 
EPR_Magic EPR_DatasetId::magic
 The magic number for this structure.
 
EPR_SProductIdEPR_DatasetId::product_id
 The ID of the product to which this dataset belongs to.
 
char * EPR_DatasetId::dsd_name
 The name as presented to the user in a dsd selection dialog.
 
const EPR_SDSDEPR_DatasetId::dsd
 The dataset descriptor obtained from the current product.
 
char * EPR_DatasetId::dataset_name
 The name as presented to the user in a dataset selection dialog.
 
const struct RecordDescriptor * EPR_DatasetId::record_descriptor
 The record descriptor found in the DDDB for this dataset.
 
EPR_SRecordInfoEPR_DatasetId::record_info
 The record info which describes a record of this dataset.
 
char * EPR_DatasetId::description
 A short description of the band's contents.
 
EPR_Magic EPR_DSD::magic
 The magic number for this structure.
 
int EPR_DSD::index
 The index of this DSD (zero-based)
 
char * EPR_DSD::ds_name
 The dataset name.
 
char * EPR_DSD::ds_type
 The dataset type descriptor.
 
char * EPR_DSD::filename
 The filename in the DDDB with the description of this dataset.
 
uint EPR_DSD::ds_offset
 The offset of dataset-information the product file.
 
uint EPR_DSD::ds_size
 The size of dataset-information in dataset product file.
 
uint EPR_DSD::num_dsr
 The number of dataset records for the given dataset name.
 
uint EPR_DSD::dsr_size
 The size of dataset record for the given dataset name.
 
EPR_Magic EPR_Record::magic
 The magic number for this structure.
 
EPR_SRecordInfoEPR_Record::info
 The corresponding record info for this record (a 'soft' pointer).
 
uint EPR_Record::num_fields
 The number of fields contained in this record.
 
EPR_SField ** EPR_Record::fields
 The record fields.
 
EPR_Magic EPR_Field::magic
 The magic number for this structure.
 
EPR_SFieldInfoEPR_Field::info
 The corresponding field info for this field.
 
void * EPR_Field::elems
 The elements of this field.
 
EPR_Magic EPR_Raster::magic
 The magic number for this structure.
 
EPR_EDataTypeId EPR_Raster::data_type
 The data type of the band's pixel values.
 
uint EPR_Raster::elem_size
 The size in byte of a single element (sample) of this raster's buffer.
 
uint EPR_Raster::source_width
 The width of the source .
 
uint EPR_Raster::source_height
 The height of the source.
 
uint EPR_Raster::source_step_x
 The sub-sampling for the across-track direction in pixel.
 
uint EPR_Raster::source_step_y
 The sub-sampling for the along-track direction in pixel.
 
uint EPR_Raster::raster_width
 The width of the raster in pixel.
 
uint EPR_Raster::raster_height
 The height of the raster in pixel.
 
void * EPR_Raster::buffer
 The elements of this raster.
 
EPR_SDatasetIdEPR_DatasetRef::dataset_id
 
int EPR_DatasetRef::field_index
 
int EPR_DatasetRef::elem_index
 
EPR_Magic EPR_FlagDef::magic
 The magic number for this structure.
 
char * EPR_FlagDef::name
 The flag name.
 
uint EPR_FlagDef::bit_mask
 The bit mask describing this flag.
 
char * EPR_FlagDef::description
 The flag description.
 
EPR_Magic EPR_BandId::magic
 The magic number for this structure.
 
EPR_SProductIdEPR_BandId::product_id
 The ID of the product to which this band belongs to.
 
char * EPR_BandId::band_name
 The name as presented to the user in a band selection dialog (also known as spectral subset)
 
int EPR_BandId::spectr_band_index
 The (zero-based) spectral band index.
 
EPR_SDatasetRef EPR_BandId::dataset_ref
 The reference of the source dataset containing the raw data used to create the band's pixel values.
 
EPR_ESampleModel EPR_BandId::sample_model
 The sample model operation applied to the source dataset for getting the correct samples from the MDS (for example MERIS L2).
 
EPR_EDataTypeId EPR_BandId::data_type
 The data type of the band's pixel values.
 
EPR_EScalingMethod EPR_BandId::scaling_method
 The scaling method which must be applied to the raw source data in order to get the 'real' pixel values in geo-physical units.
 
float EPR_BandId::scaling_offset
 The scaling offset.
 
float EPR_BandId::scaling_factor
 The scaling factor.
 
char * EPR_BandId::bm_expr
 A bit-mask expression used to filter valid pixels.
 
EPR_SPtrArray * EPR_BandId::flag_coding
 The flag coding is a list of EPR_SFlag instances.
 
char * EPR_BandId::unit
 The geophysical unit for the band's pixel values.
 
char * EPR_BandId::description
 A short description of the band's contents.
 
epr_boolean EPR_BandId::lines_mirrored
 If true (=1) lines will be mirrored (flipped) after read into a raster in order to ensure a pixel ordering in raster X direction from WEST to EAST.
 
int EPR_Time::days
 
uint EPR_Time::seconds
 
uint EPR_Time::microseconds
 

Detailed Description

Function Documentation

◆ 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.

pixel) in a type-safe way.

Parameters
rasterthe raster which contains the pixel, must not be NULL
xthe (zero-based) X co-ordinate of the pixel
ythe (zero-based) Y co-ordinate of the pixel
Returns
the typed value at the given co-ordinate.

◆ epr_get_pixel_as_int()

int epr_get_pixel_as_int ( const EPR_SRaster raster,
int  x,
int  y 
)

◆ epr_get_pixel_as_float()

float epr_get_pixel_as_float ( const EPR_SRaster raster,
int  x,
int  y 
)

◆ epr_get_pixel_as_double()

double epr_get_pixel_as_double ( const EPR_SRaster raster,
int  x,
int  y 
)

Variable Documentation

◆ magic [1/8]

EPR_Magic EPR_ProductId::magic

The magic number for this structure.

IMPORTANT: This must always be the first member of this structure.

◆ file_path

char* EPR_ProductId::file_path

The file's path including the file name.

◆ istream

FILE* EPR_ProductId::istream

The input stream as returned by the ANSI C fopen function for the given file path.

◆ tot_size

uint EPR_ProductId::tot_size

The total size in bytes of the product file.

◆ scene_width

uint EPR_ProductId::scene_width

The total width of product's scene raster in pixels.

◆ scene_height

uint EPR_ProductId::scene_height

The total height of product's scene raster in pixels.

◆ id_string

char EPR_ProductId::id_string[EPR_PRODUCT_ID_STRLEN+1]

The product identifier string obtained from the MPH parameter 'PRODUCT'.

The first 10 characters of this string identify the the product type, e.g. "MER_1P__FR" for a MERIS Level 1b full resolution product. The rest of the string decodes product instance properties.

◆ mph_record

EPR_SRecord* EPR_ProductId::mph_record

The record representing the main product header (MPH).

◆ sph_record

EPR_SRecord* EPR_ProductId::sph_record

The record representing the specific product header (SPH).

◆ dsd_array

EPR_SPtrArray* EPR_ProductId::dsd_array

An array containing all (!) DSDs read from the product's specific product header (SPH).

◆ record_info_cache

EPR_SPtrArray* EPR_ProductId::record_info_cache

Cache for record infos.

Contains all record infos read from the database for this file so far.

The reason for caching record infos on a per-file-base is that a some record infos instances can contain file related content such as the number of pixels in a measurecment dataset record (MDSR).

◆ param_table

EPR_SPtrArray* EPR_ProductId::param_table

A table containing dynamic field info parameters.

Dynamic field info parameters are created at runtime because the are derived from the product file contents and can not be staically stored in the record info database.

◆ dataset_ids

EPR_SPtrArray* EPR_ProductId::dataset_ids

Contains and array of all dataset IDs for the product (type EPR_SDatasetId*)

◆ band_ids

EPR_SPtrArray* EPR_ProductId::band_ids

Contains and array of all band IDs for the product (type EPR_SBandId*)

◆ meris_iodd_version

int EPR_ProductId::meris_iodd_version

For MERIS L1b and RR and FR to provide backward compatibility.

◆ magic [2/8]

EPR_Magic EPR_DatasetId::magic

The magic number for this structure.

IMPORTANT: This must always be the first member of this structure.

◆ product_id [1/2]

EPR_SProductId* EPR_DatasetId::product_id

The ID of the product to which this dataset belongs to.

◆ dsd_name

char* EPR_DatasetId::dsd_name

The name as presented to the user in a dsd selection dialog.

◆ dsd

const EPR_SDSD* EPR_DatasetId::dsd

The dataset descriptor obtained from the current product.

◆ dataset_name

char* EPR_DatasetId::dataset_name

The name as presented to the user in a dataset selection dialog.

◆ record_descriptor

const struct RecordDescriptor* EPR_DatasetId::record_descriptor

The record descriptor found in the DDDB for this dataset.

◆ record_info

EPR_SRecordInfo* EPR_DatasetId::record_info

The record info which describes a record of this dataset.

◆ description [1/3]

char* EPR_DatasetId::description

A short description of the band's contents.

◆ magic [3/8]

EPR_Magic EPR_DSD::magic

The magic number for this structure.

IMPORTANT: This must always be the first member of this structure.

◆ index

int EPR_DSD::index

The index of this DSD (zero-based)

◆ ds_name

char* EPR_DSD::ds_name

The dataset name.

◆ ds_type

char* EPR_DSD::ds_type

The dataset type descriptor.

◆ filename

char* EPR_DSD::filename

The filename in the DDDB with the description of this dataset.

◆ ds_offset

uint EPR_DSD::ds_offset

The offset of dataset-information the product file.

◆ ds_size

uint EPR_DSD::ds_size

The size of dataset-information in dataset product file.

◆ num_dsr

uint EPR_DSD::num_dsr

The number of dataset records for the given dataset name.

◆ dsr_size

uint EPR_DSD::dsr_size

The size of dataset record for the given dataset name.

◆ magic [4/8]

EPR_Magic EPR_Record::magic

The magic number for this structure.

IMPORTANT: This must always be the first member of this structure.

◆ info [1/2]

EPR_SRecordInfo* EPR_Record::info

The corresponding record info for this record (a 'soft' pointer).

◆ num_fields

uint EPR_Record::num_fields

The number of fields contained in this record.

The value is always equal info->field_infos->length and is provided here for convenience only.

◆ fields

EPR_SField** EPR_Record::fields

The record fields.

An array of EPR_Field* of length info->num_fields

◆ magic [5/8]

EPR_Magic EPR_Field::magic

The magic number for this structure.

IMPORTANT: This must always be the first member of this structure.

◆ info [2/2]

EPR_SFieldInfo* EPR_Field::info

The corresponding field info for this field.

supplierCardinality 1

◆ elems

void* EPR_Field::elems

The elements of this field.

In order to use the data, this member must be casted to one of the following array data types:

  1. unsigned char* - array of unsigned 8-bit integer elements
  2. char* - array of signed 8-bit integer fields
  3. unsigned short* - array of unsigned 16-bit integer elements
  4. short* - array of signed 16-bit integer elements
  5. unsigned int* - array of unsigned 32-bit integer elements
  6. int* - array of signed 32-bit integer elements
  7. float* - array of signed 32-bit floating point elements
  8. double* - array of signed 64-bit floating point elements
  9. EPR_STime* - array of MJD elements

Dedicated access routine are available The element type is given by info->data_type_id and the array length by info->num_elems.

◆ magic [6/8]

EPR_Magic EPR_Raster::magic

The magic number for this structure.

IMPORTANT: This must always be the first member of this structure.

◆ data_type [1/2]

EPR_EDataTypeId EPR_Raster::data_type

The data type of the band's pixel values.


All corresponding with EPR_DataTypeId types are possible

◆ elem_size

uint EPR_Raster::elem_size

The size in byte of a single element (sample) of this raster's buffer.

◆ source_width

uint EPR_Raster::source_width

The width of the source .

◆ source_height

uint EPR_Raster::source_height

The height of the source.

◆ source_step_x

uint EPR_Raster::source_step_x

The sub-sampling for the across-track direction in pixel.

◆ source_step_y

uint EPR_Raster::source_step_y

The sub-sampling for the along-track direction in pixel.

◆ raster_width

uint EPR_Raster::raster_width

The width of the raster in pixel.


raster_width = (source_width - 1) / source_step_x + 1

◆ raster_height

uint EPR_Raster::raster_height

The height of the raster in pixel.


raster_height = (source_height - 1) / source_step_y + 1

◆ buffer

void* EPR_Raster::buffer

The elements of this raster.


Its volume is raster_width * raster_height * sizeof(data_type) in bytes.

◆ dataset_id

EPR_SDatasetId* EPR_DatasetRef::dataset_id

◆ field_index

int EPR_DatasetRef::field_index

◆ elem_index

int EPR_DatasetRef::elem_index

◆ magic [7/8]

EPR_Magic EPR_FlagDef::magic

The magic number for this structure.

IMPORTANT: This must always be the first member of this structure.

◆ name

char* EPR_FlagDef::name

The flag name.

◆ bit_mask

uint EPR_FlagDef::bit_mask

The bit mask describing this flag.

◆ description [2/3]

char* EPR_FlagDef::description

The flag description.

◆ magic [8/8]

EPR_Magic EPR_BandId::magic

The magic number for this structure.

IMPORTANT: This must always be the first member of this structure.

◆ product_id [2/2]

EPR_SProductId* EPR_BandId::product_id

The ID of the product to which this band belongs to.

◆ band_name

char* EPR_BandId::band_name

The name as presented to the user in a band selection dialog (also known as spectral subset)

◆ spectr_band_index

int EPR_BandId::spectr_band_index

The (zero-based) spectral band index.

-1 if this is not a spectral band.

◆ dataset_ref

EPR_SDatasetRef EPR_BandId::dataset_ref

The reference of the source dataset containing the raw data used to create the band's pixel values.

The external format used in the DDDB is MDS-name.field, where field is a one-based index (field=1 corresponds to the first field)

◆ sample_model

EPR_ESampleModel EPR_BandId::sample_model

The sample model operation applied to the source dataset for getting the correct samples from the MDS (for example MERIS L2).

Possible values are:

  • * --> no operation (direct copy)
  • 1OF2 --> first byte of 2-byte interleaved MDS
  • 2OF2 --> second byte of 2-byte interleaved MDS
  • 0123 --> combine 3-bytes interleaved to 4-byte integer

◆ data_type [2/2]

EPR_EDataTypeId EPR_BandId::data_type

The data type of the band's pixel values.

Possible values are:

  • * --> the datatype remains unchanged.
  • uint8_t --> 8-bit unsigned integer
  • uint32_t --> 32-bit unsigned integer
  • Float --> 32-bit IEEE floating point

◆ scaling_method

EPR_EScalingMethod EPR_BandId::scaling_method

The scaling method which must be applied to the raw source data in order to get the 'real' pixel values in geo-physical units.

Possible values are:

  • * --> no scaling applied
  • Linear_Scale --> linear scaling applied: y = offset + scale * x
  • Log_Scale --> logarithmic scaling applied: y = log10(offset + scale * x)

◆ scaling_offset

float EPR_BandId::scaling_offset

The scaling offset.

Possible values are:

  • * --> no offset provided (implies scaling_method=*)
  • const --> a floating point constant
  • GADS.field[.field2] --> value is provided in global annotation dataset with name GADS in field field. Optionally a second element index for multiple-element fields can be given too

◆ scaling_factor

float EPR_BandId::scaling_factor

The scaling factor.

Possible values are:

  • * --> no factor provided (implies scaling_method=*)
  • const --> a floating point constant
  • GADS.field[.field2] --> value is provided in global annotation dataset with name GADS in field field. Optionally a second element index for multiple-element fields can be given too

◆ bm_expr

char* EPR_BandId::bm_expr

A bit-mask expression used to filter valid pixels.

All others are set to zero.

◆ flag_coding

EPR_SPtrArray* EPR_BandId::flag_coding

The flag coding is a list of EPR_SFlag instances.

It determines each of the flags used in this band (= flags dataset). Each flag has a name, a bit-index and a description.

◆ unit

char* EPR_BandId::unit

The geophysical unit for the band's pixel values.

◆ description [3/3]

char* EPR_BandId::description

A short description of the band's contents.

◆ lines_mirrored

epr_boolean EPR_BandId::lines_mirrored

If true (=1) lines will be mirrored (flipped) after read into a raster in order to ensure a pixel ordering in raster X direction from WEST to EAST.

◆ days

int EPR_Time::days

◆ seconds

uint EPR_Time::seconds

◆ microseconds

uint EPR_Time::microseconds

Generated on Sun Nov 26 2023 08:06:45

ENVISAT Product Reader C API

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