OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
Raster Data Access
Collaboration diagram for Raster Data Access:

Functions

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)
 
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)
 
EPR_SRaster * epr_create_bitmask_raster (epr_uint source_width, epr_uint source_height, epr_uint source_step_x, epr_uint source_step_y)
 
int epr_read_band_raster (EPR_SBandId *band_id, int offset_x, int offset_y, EPR_SRaster *raster)
 
epr_uint epr_get_raster_elem_size (const EPR_SRaster *raster)
 
void * epr_get_raster_elem_addr (const EPR_SRaster *raster, epr_uint offset)
 
void * epr_get_raster_pixel_addr (const EPR_SRaster *raster, epr_uint x, epr_uint y)
 
void * epr_get_raster_line_addr (const EPR_SRaster *raster, epr_uint y)
 
epr_uint epr_get_raster_width (EPR_SRaster *raster)
 
epr_uint epr_get_raster_height (EPR_SRaster *raster)
 
epr_uint epr_get_num_bands (EPR_SProductId *product_id)
 
EPR_SBandId * epr_get_band_id_at (EPR_SProductId *product_id, epr_uint index)
 
EPR_SBandId * epr_get_band_id (EPR_SProductId *product_id, const char *band_name)
 
const char * epr_get_band_name (EPR_SBandId *band_id)
 
void epr_free_raster (EPR_SRaster *raster)
 

Detailed Description

Function Documentation

◆ epr_create_bitmask_raster()

EPR_SRaster* epr_create_bitmask_raster ( epr_uint  source_width,
epr_uint  source_height,
epr_uint  source_step_x,
epr_uint  source_step_y 
)

Creates a raster to be used for reading bitmasks. The raster returned always is of type byte.

Parameters
source_widththe width (across track dimension) of the source to be read into the raster. See description of epr_create_compatible_raster.
source_heightthe height (along track dimension) of the source to be read into the raster. See description of epr_create_compatible_raster.
source_step_xthe subsampling step across track of the source when reading into the raster. See description of epr_create_compatible_raster.
source_step_ythe subsampling step along track of the source when reading into the raster. See description of epr_create_compatible_raster.
Returns
the new raster instance or NULL if an error occured.

Creates a raster to be used for reading bitmasks. The raster returned is always of type byte.

Parameters
source_widththe width (across track dimension) of the source to be read into the raster. See description of epr_create_compatible_raster.
source_heightthe height (along track dimension) of the source to be read into the raster. See description of epr_create_compatible_raster.
source_step_xthe subsampling step across track of the source when reading into the raster. See description of epr_create_compatible_raster.
source_step_ythe subsampling step along track of the source when reading into the raster. See description of epr_create_compatible_raster.
Returns
the new raster instance or NULL if an error occured.

Definition at line 472 of file epr_band.c.

◆ epr_create_compatible_raster()

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 
)

Creates a raster which is compatible with the data type contained in the band identified by band_id. The created raster is used to read the data in it (see epr_read_band_raster).

The raster is defined on the grid of the product, from which the data are read. Spatial subsets and undersampling are possible) through the parameter of the function.

The concept of defining the raster is such: A certain portion of the ENVISAT product will be read into the raster. This is called the source. The complete ENVISAT product can be much greater than the source. One can move the raster over the complete ENVISAT product and read in turn different parts - always of the size of the source - of it into the raster. The source is specified by the parameter source_height and source_width.

A typical example is a processing in blocks. Lets say, a block has 64x32 pixel. Then, my source has a width of 64 pixel and a height of 32 pixel. Another example is a processing of complete image lines. Then, my source has a widths of the complete product (for example 1121 for a MERIS RR product), and a height of 1). One can loop over all blocks read into the raster and process it.

In addition, it is possible to defined a subsampling step for a raster. This means, that the source is not read 1:1 into the raster, but that only every 2nd or 3rd pixel is read. This step can be set differently for the across track (source_step_x) and along track (source_step_y) directions.

Parameters
band_idthe band identifier. The raster will be compatible with the data type of that band; must not be NULL
source_widththe width (across track dimension) of the source to be read into the raster. See text above.
source_heightthe height (along track dimension) of the source to be read into the raster. See text above.
source_step_xthe subsampling step across track of the source when reading into the raster. See text above.
source_step_ythe subsampling step along track of the source when reading into the raster. See text above.
Returns
the new raster instance or NULL if an error occured.

Creates a compatible raster for the given band.

Parameters
band_idthe band identifier, must not be NULL
Returns
the new raster instance or NULL if an error occured.

Definition at line 549 of file epr_band.c.

◆ epr_create_raster()

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 
)

Creates a raster of the specified data type. This function can be used to create any type of raster, e.g. for later use as a bit-mask.

Parameters
data_typethe type of the data to stored in the raster, must not be NULL
source_widththe width (across track dimension) of the source to be read into the raster. See description of epr_create_compatible_raster.
source_heightthe height (along track dimension) of the source to be read into the raster. See description of epr_create_compatible_raster.
source_step_xthe subsampling step across track of the source when reading into the raster. See description of epr_create_compatible_raster.
source_step_ythe subsampling step along track of the source when reading into the raster. See description of epr_create_compatible_raster.
Returns
the new raster instance or NULL if an error occured.

Creates a raster for the given datatype and dimension.

Parameters
data_typethe data type identifier
source_widththe source's width
source_heightthe source's height
source_step_xthe sub-sampling in X
source_step_ythe sub-sampling in Y
Returns
the new raster instance or NULL if an error occured.

Definition at line 495 of file epr_band.c.

◆ epr_free_raster()

void epr_free_raster ( EPR_SRaster *  raster)

Release the memory allocated through a raster.

Parameters
rasterthe raster to be released.

Definition at line 568 of file epr_band.c.

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

Parameters
product_idthe source product ID, must not be NULL
band_namethe name of the band, must not be NULL
Returns
the requested band ID, or NULL if not found

Definition at line 237 of file epr_band.c.

◆ epr_get_band_id_at()

EPR_SBandId* epr_get_band_id_at ( EPR_SProductId *  product_id,
epr_uint  index 
)

Gets the band ID at the specified position within the product.

Parameters
product_idthe source product ID, must not be NULL
indexthe index identifying the position of the band, starting with 0, must not be negative
Returns
the requested band ID, or NULL if not found

Definition at line 217 of file epr_band.c.

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

Parameters
band_idthe band identifier, must not be NULL
Returns
the name of the band.

Definition at line 266 of file epr_band.c.

◆ epr_get_num_bands()

epr_uint epr_get_num_bands ( EPR_SProductId *  product_id)

Gets the number of all bands contained in a product.

Parameters
product_idthe source product ID, must not be NULL
Returns
the number off all bands

Definition at line 203 of file epr_band.c.

◆ epr_get_raster_elem_addr()

void* epr_get_raster_elem_addr ( const EPR_SRaster *  raster,
epr_uint  offset 
)
Todo:
1 se/nf - doku

Definition at line 1047 of file epr_band.c.

◆ epr_get_raster_elem_size()

epr_uint epr_get_raster_elem_size ( const EPR_SRaster *  raster)
Todo:
1 se/nf - doku

Definition at line 1039 of file epr_band.c.

◆ epr_get_raster_height()

epr_uint epr_get_raster_height ( EPR_SRaster *  raster)

Gets the raster's scene height in pixels.

Parameters
rasterthe product identifier, must not be NULL
Returns
the raster's total scene height in pixels, or 0 if an error occured.

Definition at line 1079 of file epr_band.c.

◆ epr_get_raster_line_addr()

void* epr_get_raster_line_addr ( const EPR_SRaster *  raster,
epr_uint  y 
)
Todo:
1 se/nf - doku

Definition at line 1063 of file epr_band.c.

◆ epr_get_raster_pixel_addr()

void* epr_get_raster_pixel_addr ( const EPR_SRaster *  raster,
epr_uint  x,
epr_uint  y 
)
Todo:
1 se/nf - doku

Definition at line 1055 of file epr_band.c.

◆ epr_get_raster_width()

epr_uint epr_get_raster_width ( EPR_SRaster *  raster)

Gets the raster's scene width in pixels.

Parameters
rasterthe raster identifier, must not be NULL
Returns
the raster's total scene width in pixels, or 0 if an error occured.

Definition at line 1071 of file epr_band.c.

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

The source-region is a defined part of the whole ENVISAT product image, which shall be read into a raster. In this routine the co-ordinates are specified, where the source-region to be read starts. The dimension of the region and the sub-sampling are attributes of the raster into which the data are read.

Parameters
band_idthe identified of the band to be read into the raster.
offset_xacross-track source co-ordinate in pixel co-ordinates (zero-based) of the upper right corner of the source-region
offset_yalong-track source co-ordinate in pixel co-ordinates (zero-based) of the upper right corner of the source-region
rasterthe identifier to given raster information and raster buffer
Returns
zero for success, and error code otherwise
See also
epr_create_compatible_raster
epr_create_rater

Definition at line 593 of file epr_band.c.