OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
epr_band.h File Reference
#include "epr_ptrarray.h"
#include <stdio.h>
Include dependency graph for epr_band.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef void(* EPR_FLineDecoder) (void *sourceArray, EPR_SBandId *band_id, int xo, int raster_width, int s_x, void *raster_buffer, int raster_pos)
 
typedef void(* EPR_FArrayTransformer) (void *sourceArray, EPR_SBandId *band_id, float *raster_buffer, epr_uint nel)
 

Functions

EPR_EScalingMethod epr_str_to_scaling_method (const char *str)
 
EPR_ESampleModel epr_str_to_sample_offset (const char *str)
 
EPR_SDatasetRef epr_get_ref_struct (EPR_SProductId *product_id, const char *str)
 
float epr_get_scaling_factor (EPR_SProductId *product_id, const char *str)
 
float epr_get_scaling_params (EPR_SProductId *product_id, const char *str)
 
int epr_read_band_measurement_data (EPR_SBandId *band_id, int offset_x, int offset_y, EPR_SRaster *raster)
 
int epr_read_band_annotation_data (EPR_SBandId *band_id, int offset_x, int offset_y, EPR_SRaster *raster)
 
void decode_line_uchar_1_of_1_to_float (void *sourceArray, EPR_SBandId *band_id, int xo, int raster_width, int s_x, void *raster_buffer, int raster_pos)
 
void decode_line_ushort_1_of_1_to_float (void *sourceArray, EPR_SBandId *band_id, int xo, int raster_width, int s_x, void *raster_buffer, int raster_pos)
 
void decode_line_short_1_of_1_to_float (void *sourceArray, EPR_SBandId *band_id, int xo, int raster_width, int s_x, void *raster_buffer, int raster_pos)
 
void decode_line_short_1_of_2_to_float (void *sourceArray, EPR_SBandId *band_id, int xo, int raster_width, int s_x, void *raster_buffer, int raster_pos)
 
void decode_line_short_2_of_2_to_float (void *sourceArray, EPR_SBandId *band_id, int xo, int raster_width, int s_x, void *raster_buffer, int raster_pos)
 
void decode_line_char_1_of_1_to_float (void *sourceArray, EPR_SBandId *band_id, int xo, int raster_width, int s_x, void *raster_buffer, int raster_pos)
 
void decode_line_uchar_1_of_1_to_uchar (void *sourceArray, EPR_SBandId *band_id, int xo, int raster_width, int s_x, void *raster_buffer, int raster_pos)
 
void decode_line_uchar_1_of_2_to_uchar (void *sourceArray, EPR_SBandId *band_id, int xo, int raster_width, int s_x, void *raster_buffer, int raster_pos)
 
void decode_line_uchar_2_of_2_to_uchar (void *sourceArray, EPR_SBandId *band_id, int xo, int raster_width, int s_x, void *raster_buffer, int raster_pos)
 
void decode_line_ushort_1_of_1_to_ushort (void *sourceArray, EPR_SBandId *band_id, int xo, int raster_width, int s_x, void *raster_buffer, int raster_pos)
 
void decode_line_uchar_1_of_2_to_float (void *sourceArray, EPR_SBandId *band_id, int xo, int raster_width, int s_x, void *raster_buffer, int raster_pos)
 
void decode_line_uchar_2_of_2_to_float (void *sourceArray, EPR_SBandId *band_id, int xo, int raster_width, int s_x, void *raster_buffer, int raster_pos)
 
void decode_line_uchar_2_to_f_to_float (void *sourceArray, EPR_SBandId *band_id, int xo, int raster_width, int s_x, void *raster_buffer, int raster_pos)
 
void decode_line_uchar_3_to_i_to_uint (void *sourceArray, EPR_SBandId *band_id, int xo, int raster_width, int s_x, void *raster_buffer, int raster_pos)
 
void transform_array_short_to_float (void *sourceArray, EPR_SBandId *band_id, float *raster_buffer, epr_uint nel)
 
void transform_array_ushort_to_float (void *sourceArray, EPR_SBandId *band_id, float *raster_buffer, epr_uint nel)
 
void transform_array_int_to_float (void *sourceArray, EPR_SBandId *band_id, float *raster_buffer, epr_uint nel)
 
void transform_array_uint_to_float (void *sourceArray, EPR_SBandId *band_id, float *raster_buffer, epr_uint nel)
 
void mirror_float_array (float *raster_buffer, epr_uint raster_width, epr_uint raster_height)
 
void mirror_uchar_array (epr_uchar *raster_buffer, epr_uint raster_width, epr_uint raster_height)
 
void mirror_ushort_array (epr_ushort *raster_buffer, epr_uint raster_width, epr_uint raster_height)
 
void mirror_uint_array (epr_uint *raster_buffer, epr_uint raster_width, epr_uint raster_height)
 
float epr_interpolate2D (float wi, float wj, float x00, float x10, float x01, float x11)
 
void decode_tiepoint_band (float *sa_beg, float *sa_end, epr_uint samples_per_tie_pt, epr_uint num_elems, EPR_SBandId *band_id, int xo, float scan_offset_x, float y_mod, int raster_width, int s_x, float *raster_buffer, int raster_pos)
 
EPR_FLineDecoder select_line_decode_function (EPR_EDataTypeId band_daty, EPR_ESampleModel band_smod, EPR_EDataTypeId daty_id)
 
EPR_FArrayTransformer select_transform_array_function (EPR_EDataTypeId band_daty, EPR_EDataTypeId daty_id)
 
void epr_zero_invalid_pixels (EPR_SRaster *raster, EPR_SRaster *bm_raster)
 
void epr_free_band_id (EPR_SBandId *band_id)
 
EPR_SPtrArray * epr_create_band_ids (EPR_SProductId *product_id)
 

Typedef Documentation

◆ EPR_FArrayTransformer

typedef void(* EPR_FArrayTransformer) (void *sourceArray, EPR_SBandId *band_id, float *raster_buffer, epr_uint nel)

Definition at line 221 of file epr_band.h.

◆ EPR_FLineDecoder

typedef void(* EPR_FLineDecoder) (void *sourceArray, EPR_SBandId *band_id, int xo, int raster_width, int s_x, void *raster_buffer, int raster_pos)

Definition at line 208 of file epr_band.h.

Function Documentation

◆ decode_line_char_1_of_1_to_float()

void decode_line_char_1_of_1_to_float ( void *  sourceArray,
EPR_SBandId *  band_id,
int  xo,
int  raster_width,
int  s_x,
void *  raster_buffer,
int  raster_pos 
)

Definition at line 1203 of file epr_band.c.

◆ decode_line_short_1_of_1_to_float()

void decode_line_short_1_of_1_to_float ( void *  sourceArray,
EPR_SBandId *  band_id,
int  xo,
int  raster_width,
int  s_x,
void *  raster_buffer,
int  raster_pos 
)

Definition at line 1263 of file epr_band.c.

◆ decode_line_short_1_of_2_to_float()

void decode_line_short_1_of_2_to_float ( void *  sourceArray,
EPR_SBandId *  band_id,
int  xo,
int  raster_width,
int  s_x,
void *  raster_buffer,
int  raster_pos 
)

Definition at line 1292 of file epr_band.c.

◆ decode_line_short_2_of_2_to_float()

void decode_line_short_2_of_2_to_float ( void *  sourceArray,
EPR_SBandId *  band_id,
int  xo,
int  raster_width,
int  s_x,
void *  raster_buffer,
int  raster_pos 
)

Definition at line 1322 of file epr_band.c.

◆ decode_line_uchar_1_of_1_to_float()

void decode_line_uchar_1_of_1_to_float ( void *  sourceArray,
EPR_SBandId *  band_id,
int  xo,
int  raster_width,
int  s_x,
void *  raster_buffer,
int  raster_pos 
)

This group of functions is for scaling the field element for a physical measurement values.
The type is located in the field info.
One field must have one type only.

Parameters
sourceArraythe sourse array identifier (to be scaled)
band_idthe band ID with the information about the field's physical properties
xo[PIXEL] X-coordinate (0-bazed) of the upper right corner raster to search
raster_width[PIXEL] the width of the raster is been research
s_xX-step to get the next raster to search
raster_buffer[BYTE] the memory buffer to save information was scaled
raster_posshows the point of filling of the array raster_buffer

Definition at line 1173 of file epr_band.c.

◆ decode_line_uchar_1_of_1_to_uchar()

void decode_line_uchar_1_of_1_to_uchar ( void *  sourceArray,
EPR_SBandId *  band_id,
int  xo,
int  raster_width,
int  s_x,
void *  raster_buffer,
int  raster_pos 
)

Definition at line 1352 of file epr_band.c.

◆ decode_line_uchar_1_of_2_to_float()

void decode_line_uchar_1_of_2_to_float ( void *  sourceArray,
EPR_SBandId *  band_id,
int  xo,
int  raster_width,
int  s_x,
void *  raster_buffer,
int  raster_pos 
)

Definition at line 1461 of file epr_band.c.

◆ decode_line_uchar_1_of_2_to_uchar()

void decode_line_uchar_1_of_2_to_uchar ( void *  sourceArray,
EPR_SBandId *  band_id,
int  xo,
int  raster_width,
int  s_x,
void *  raster_buffer,
int  raster_pos 
)

Definition at line 1371 of file epr_band.c.

◆ decode_line_uchar_2_of_2_to_float()

void decode_line_uchar_2_of_2_to_float ( void *  sourceArray,
EPR_SBandId *  band_id,
int  xo,
int  raster_width,
int  s_x,
void *  raster_buffer,
int  raster_pos 
)

Definition at line 1492 of file epr_band.c.

◆ decode_line_uchar_2_of_2_to_uchar()

void decode_line_uchar_2_of_2_to_uchar ( void *  sourceArray,
EPR_SBandId *  band_id,
int  xo,
int  raster_width,
int  s_x,
void *  raster_buffer,
int  raster_pos 
)

Definition at line 1391 of file epr_band.c.

◆ decode_line_uchar_2_to_f_to_float()

void decode_line_uchar_2_to_f_to_float ( void *  sourceArray,
EPR_SBandId *  band_id,
int  xo,
int  raster_width,
int  s_x,
void *  raster_buffer,
int  raster_pos 
)

Definition at line 1429 of file epr_band.c.

◆ decode_line_uchar_3_to_i_to_uint()

void decode_line_uchar_3_to_i_to_uint ( void *  sourceArray,
EPR_SBandId *  band_id,
int  xo,
int  raster_width,
int  s_x,
void *  raster_buffer,
int  raster_pos 
)

Definition at line 1521 of file epr_band.c.

◆ decode_line_ushort_1_of_1_to_float()

void decode_line_ushort_1_of_1_to_float ( void *  sourceArray,
EPR_SBandId *  band_id,
int  xo,
int  raster_width,
int  s_x,
void *  raster_buffer,
int  raster_pos 
)

Definition at line 1233 of file epr_band.c.

◆ decode_line_ushort_1_of_1_to_ushort()

void decode_line_ushort_1_of_1_to_ushort ( void *  sourceArray,
EPR_SBandId *  band_id,
int  xo,
int  raster_width,
int  s_x,
void *  raster_buffer,
int  raster_pos 
)

Definition at line 1410 of file epr_band.c.

◆ decode_tiepoint_band()

void decode_tiepoint_band ( float *  sa_beg,
float *  sa_end,
epr_uint  samples_per_tie_pt,
epr_uint  num_elems,
EPR_SBandId *  band_id,
int  offset_x,
float  scan_offset_x,
float  y_mod,
int  raster_width,
int  s_x,
float *  raster_buffer,
int  raster_pos 
)

Computes the physical values for the annotation data.

Parameters
sa_begthe float array of tie points "before" Y-coordinate of the point to search
sa_endthe float array of tie points "after" Y-coordinate of the point to search
samples_per_tie_ptthe "distance" between two neighbour tie point (in scan-line direction)
num_elemsnumber of elements in one tie point scan-line
band_idthe information about properties and quantities of ENVISAT data.
xo[PIXEL] X-coordinate (0-bazed) of the upper right corner raster to search
y_mod[PIXEL] relativ location of the point is been researched (in fly direction)
raster_width[PIXEL] the width of the raster is been researched
s_x[PIXEL] X-step to get the next point (in source coordinates) to search
raster_bufferthe float user array to be filled with physical values
raster_posthe actual "filled" position in raster_buffer-array

Computes the physical values for the annotation data.

Parameters
sa_begthe float array of tie points "before" Y-coordinate of the point to search
sa_endthe float array of tie points "after" Y-coordinate of the point to search
samples_per_tie_ptthe "distance" between two neighbour tie points (in scan-line direction)
num_elemsnumber of elements in one tie point scan-line
band_idthe information about properties and quantities of ENVISAT data.
offset_x[PIXEL] X-coordinate (0-based) of the upper right raster corner to search
y_mod[PIXEL] relative location of the point is being searched for (in flight direction)
raster_width[PIXEL] the width of the raster is being searched for
s_x[PIXEL] X-step to get the next point (in source coordinates) to search
raster_bufferthe float user array to be filled with physical values
raster_posthe actual "filled" position in raster_buffer-array

Definition at line 1557 of file epr_band.c.

◆ epr_create_band_ids()

EPR_SPtrArray* epr_create_band_ids ( EPR_SProductId *  product_id)

Obtains all bands infos from the dddb.

Definition at line 43 of file epr_band.c.

◆ epr_free_band_id()

void epr_free_band_id ( EPR_SBandId *  band_id)

Release the memory allocated through a band ID.

Parameters
band_idthe band identifier to be released.

Release the memory allocated through a band ID.

Parameters
bandthe dataset description identifier, if NULL the function immediately returns zero.
Returns
zero for success, an error code otherwise

Definition at line 284 of file epr_band.c.

◆ epr_get_ref_struct()

EPR_SDatasetRef epr_get_ref_struct ( EPR_SProductId *  product_id,
const char *  str 
)

Gets the dataset_id, field_index and elem_index

Parameters
product_idthe the product file identifier
strthe string with the name, separator ('.') and indexes.
Returns
the dataset_id, field_index and elem_index (-1 if no). NULL if correspondent dataset name was not found.

Definition at line 383 of file epr_band.c.

◆ epr_get_scaling_factor()

float epr_get_scaling_factor ( EPR_SProductId *  product_id,
const char *  str 
)

Gets the scaling factor by the given dataset_id, field_index, elem_index

Parameters
product_idthe the product file identifier
strthe string with the name, separator ('.') and indexes.
Returns
the dataset_id, field_index and elem_index (-1 if no). NULL if correspondent dataset name was not found.

Definition at line 352 of file epr_band.c.

◆ epr_get_scaling_params()

float epr_get_scaling_params ( EPR_SProductId *  product_id,
const char *  str 
)

Gets the scaling params: factor or offset by the given dataset_id, field_index, elem_index

Parameters
product_idthe the product file identifier
strthe string with the name, separator ('.') and indexes.
Returns
the dataset_id, field_index and elem_index (-1 if no). NULL if correspondent dataset name was not found.

Definition at line 320 of file epr_band.c.

◆ epr_interpolate2D()

float epr_interpolate2D ( float  wi,
float  wj,
float  x00,
float  x10,
float  x01,
float  x11 
)

Two dimenzional interpolation

Parameters
withe interpolation point location in [0,1] in "horizontal" direction
wjthe interpolation point location in [0,1] in "vertical" direction
x00the first point in "horizontal" direction
x10the second point in "horizontal" direction
x01the first point in "vertical" direction
x11the second point in "vertical" direction
Returns
float interpolated value

Definition at line 1639 of file epr_band.c.

◆ epr_read_band_annotation_data()

int epr_read_band_annotation_data ( EPR_SBandId *  band_id,
int  offset_x,
int  offset_y,
EPR_SRaster *  raster 
)

Reads the annotation data and converts its in physical values.

Parameters
band_idthe information about properties and quantities of ENVISAT data.
offset_xX-coordinate in pixel co-ordinates (zero-based) of the upper right corner raster to search
offset_yY-coordinate in pixel co-ordinates (zero-based) of the upper right corner raster to search
rasterthe instance to the buffer information was used
Returns
zero for success, and error code otherwise

Reads the annotation data and converts its into physical values.

Parameters
band_idthe information about properties and quantities of ENVISAT data.
offset_xX-coordinate in pixel co-ordinates (zero-based) of the upper right corner raster to search
offset_yY-coordinate in pixel co-ordinates (zero-based) of the upper right corner raster to search
rasterthe instance to the buffer information was used
Returns
zero for success, an error code otherwise

! was 0.5F !!

! was 0.5F !!

! EPR-7: was 0.5F !!

Definition at line 820 of file epr_band.c.

◆ epr_read_band_measurement_data()

int epr_read_band_measurement_data ( EPR_SBandId *  band_id,
int  offset_x,
int  offset_y,
EPR_SRaster *  raster 
)

Reads the measurement data and converts its in physical values.

Parameters
band_idthe information about properties and quantities of ENVISAT data.
offset_xX-coordinate in pixel co-ordinates (zero-based) of the upper right corner raster to search
offset_yY-coordinate in pixel co-ordinates (zero-based) of the upper right corner raster to search
rasterthe instance to the buffer information was used
Returns
zero for success, and error code otherwise

Reads the measurement data and converts its into physical values.

Parameters
band_idthe information about properties and quantities of ENVISAT data.
offset_xX-coordinate in pixel co-ordinates (zero-based) of the upper right corner raster to search
offset_yY-coordinate in pixel co-ordinates (zero-based) of the upper right corner raster to search
rasterthe instance to the buffer information was used
Returns
zero for success, an error code otherwise

Definition at line 689 of file epr_band.c.

◆ epr_str_to_sample_offset()

EPR_ESampleModel epr_str_to_sample_offset ( const char *  str)

Converts the given string into a sample offset identifier.

Parameters
strthe string to be converted.
Returns
the sample offset identifier represented by the given string. If the string is equal of '*' the value e_none_samoff is returned.

Definition at line 448 of file epr_band.c.

◆ epr_str_to_scaling_method()

EPR_EScalingMethod epr_str_to_scaling_method ( const char *  str)

Converts the given string into a scaling method identifier.

Parameters
strthe string to be converted.
Returns
the scaling method identifier represented by the given string. If the string is equal of '*' the value e_non_smid is returned.

Definition at line 429 of file epr_band.c.

◆ epr_zero_invalid_pixels()

void epr_zero_invalid_pixels ( EPR_SRaster *  raster,
EPR_SRaster *  bm_raster 
)

Masks the band information out. The band information will be masked dependent on bit mask filter for the same selected area (described in raster).

Parameters
rasterselected and physically processed the ENVISAT product data band information
bm_rasterselected the ENVISAT flag bit mask filter

Definition at line 1752 of file epr_band.c.

◆ mirror_float_array()

void mirror_float_array ( float *  raster_buffer,
epr_uint  raster_width,
epr_uint  raster_height 
)

This group of functions is for mirroring the scaled line of a physical MERIS values.

Parameters
raster_buffer[BYTE] the memory buffer to be Y-mirrored
raster_width[PIXEL] the width of the raster is been Y-mirrored
raster_height[PIXEL] the height of the raster is been Y-mirrored

Definition at line 1692 of file epr_band.c.

◆ mirror_uchar_array()

void mirror_uchar_array ( epr_uchar raster_buffer,
epr_uint  raster_width,
epr_uint  raster_height 
)

Definition at line 1707 of file epr_band.c.

◆ mirror_uint_array()

void mirror_uint_array ( epr_uint raster_buffer,
epr_uint  raster_width,
epr_uint  raster_height 
)

Definition at line 1737 of file epr_band.c.

◆ mirror_ushort_array()

void mirror_ushort_array ( epr_ushort raster_buffer,
epr_uint  raster_width,
epr_uint  raster_height 
)

Definition at line 1722 of file epr_band.c.

◆ select_line_decode_function()

EPR_FLineDecoder select_line_decode_function ( EPR_EDataTypeId  band_daty,
EPR_ESampleModel  band_smod,
EPR_EDataTypeId  daty_id 
)

Selects the line decode function, depended on measurement data type.

Definition at line 1088 of file epr_band.c.

◆ select_transform_array_function()

EPR_FArrayTransformer select_transform_array_function ( EPR_EDataTypeId  band_daty,
EPR_EDataTypeId  daty_id 
)

Selects the transform array function, dependent on annotation data type.

Definition at line 1155 of file epr_band.c.

◆ transform_array_int_to_float()

void transform_array_int_to_float ( void *  sourceArray,
EPR_SBandId *  band_id,
float *  raster_buffer,
epr_uint  nel 
)

Definition at line 1668 of file epr_band.c.

◆ transform_array_short_to_float()

void transform_array_short_to_float ( void *  sourceArray,
EPR_SBandId *  band_id,
float *  raster_buffer,
epr_uint  nel 
)

This group of functions is for scaling the field element for a physical annotation values.
The type is located in the field info.
One field must have one type only.

Parameters
sourceArraythe sourse array identifier (to be scaled)
band_idthe band ID with the information about the field's physical properties
raster_buffer[BYTE] the memory buffer to save information was scaled
nelnumber of element to scale

Definition at line 1644 of file epr_band.c.

◆ transform_array_uint_to_float()

void transform_array_uint_to_float ( void *  sourceArray,
EPR_SBandId *  band_id,
float *  raster_buffer,
epr_uint  nel 
)

Definition at line 1680 of file epr_band.c.

◆ transform_array_ushort_to_float()

void transform_array_ushort_to_float ( void *  sourceArray,
EPR_SBandId *  band_id,
float *  raster_buffer,
epr_uint  nel 
)

Definition at line 1656 of file epr_band.c.