OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
epr_dsd.c File Reference
#include <assert.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "epr_api.h"
#include "epr_core.h"
#include "epr_string.h"
#include "epr_ptrarray.h"
#include "epr_swap.h"
#include "epr_field.h"
#include "epr_record.h"
#include "epr_param.h"
#include "epr_dsd.h"
#include "epr_msph.h"
#include "epr_band.h"
#include "epr_bitmask.h"
#include "epr_dddb.h"
Include dependency graph for epr_dsd.c:

Go to the source code of this file.

Macros

#define EPR_LENGTH_DS_NAME_IDENTIFIER   9
 
#define EPR_LENGTH_DS_TYPE_IDENTIFIER   8
 
#define EPR_LENGTH_FILENAME_IDENTIFIER   10
 
#define EPR_LENGTH_DS_OFFSEN_IDENTIFIER   11
 
#define EPR_LENGTH_DS_SIZE_IDENTIFIER   9
 
#define EPR_LENGTH_NUM_DSR_IDENTIFIER   9
 
#define EPR_LENGTH_DSR_SIZE_IDENTIFIER   10
 
#define EPR_LENGTH_DS_NAME_FIELD   39
 
#define EPR_LENGTH_DS_TYPE_FIELD   10
 
#define EPR_LENGTH_DS_FILENAME_FIELD   74
 
#define EPR_LENGTH_DS_OFFSEN_FIELD   39
 
#define EPR_LENGTH_DS_SIZE_FIELD   37
 
#define EPR_LENGTH_NUM_DSR_FIELD   20
 
#define EPR_LENGTH_DSR_SIZE_FIELD   28
 
#define EPR_LENGTH_EMPTY_FIELD   33
 
#define EPR_LENGTH_NUM_DSD_FIELD   20
 

Functions

EPR_SDSD * epr_create_dsd (int dsd_index)
 
epr_uint epr_get_num_datasets (EPR_SProductId *product_id)
 
EPR_SDatasetId * epr_get_dataset_id_at (EPR_SProductId *product_id, epr_uint index)
 
EPR_SDatasetId * epr_get_dataset_id (EPR_SProductId *product_id, const char *dataset_name)
 
int epr_detect_meris_iodd_version (EPR_SProductId *product_id)
 
void epr_free_dsd (EPR_SDSD *dsd)
 
EPR_SDSD * epr_read_each_dsd (FILE *envisat_source_file, int *pos)
 
epr_uint epr_find_first_dsd (FILE *envisat_source_file, epr_uint sph_length)
 
EPR_SPtrArray * epr_read_all_dsds (EPR_SProductId *product_id)
 
epr_uint epr_get_num_dsds (const EPR_SProductId *product_id)
 
EPR_SDSD * epr_get_dsd_at (const EPR_SProductId *product_id, epr_uint dsd_index)
 

Macro Definition Documentation

◆ EPR_LENGTH_DS_FILENAME_FIELD

#define EPR_LENGTH_DS_FILENAME_FIELD   74

Definition at line 209 of file epr_dsd.c.

◆ EPR_LENGTH_DS_NAME_FIELD

#define EPR_LENGTH_DS_NAME_FIELD   39

Definition at line 207 of file epr_dsd.c.

◆ EPR_LENGTH_DS_NAME_IDENTIFIER

#define EPR_LENGTH_DS_NAME_IDENTIFIER   9

Definition at line 199 of file epr_dsd.c.

◆ EPR_LENGTH_DS_OFFSEN_FIELD

#define EPR_LENGTH_DS_OFFSEN_FIELD   39

Definition at line 210 of file epr_dsd.c.

◆ EPR_LENGTH_DS_OFFSEN_IDENTIFIER

#define EPR_LENGTH_DS_OFFSEN_IDENTIFIER   11

Definition at line 202 of file epr_dsd.c.

◆ EPR_LENGTH_DS_SIZE_FIELD

#define EPR_LENGTH_DS_SIZE_FIELD   37

Definition at line 211 of file epr_dsd.c.

◆ EPR_LENGTH_DS_SIZE_IDENTIFIER

#define EPR_LENGTH_DS_SIZE_IDENTIFIER   9

Definition at line 203 of file epr_dsd.c.

◆ EPR_LENGTH_DS_TYPE_FIELD

#define EPR_LENGTH_DS_TYPE_FIELD   10

Definition at line 208 of file epr_dsd.c.

◆ EPR_LENGTH_DS_TYPE_IDENTIFIER

#define EPR_LENGTH_DS_TYPE_IDENTIFIER   8

Definition at line 200 of file epr_dsd.c.

◆ EPR_LENGTH_DSR_SIZE_FIELD

#define EPR_LENGTH_DSR_SIZE_FIELD   28

Definition at line 213 of file epr_dsd.c.

◆ EPR_LENGTH_DSR_SIZE_IDENTIFIER

#define EPR_LENGTH_DSR_SIZE_IDENTIFIER   10

Definition at line 205 of file epr_dsd.c.

◆ EPR_LENGTH_EMPTY_FIELD

#define EPR_LENGTH_EMPTY_FIELD   33

Definition at line 215 of file epr_dsd.c.

◆ EPR_LENGTH_FILENAME_IDENTIFIER

#define EPR_LENGTH_FILENAME_IDENTIFIER   10

Definition at line 201 of file epr_dsd.c.

◆ EPR_LENGTH_NUM_DSD_FIELD

#define EPR_LENGTH_NUM_DSD_FIELD   20

Definition at line 460 of file epr_dsd.c.

◆ EPR_LENGTH_NUM_DSR_FIELD

#define EPR_LENGTH_NUM_DSR_FIELD   20

Definition at line 212 of file epr_dsd.c.

◆ EPR_LENGTH_NUM_DSR_IDENTIFIER

#define EPR_LENGTH_NUM_DSR_IDENTIFIER   9

Definition at line 204 of file epr_dsd.c.

Function Documentation

◆ epr_create_dsd()

EPR_SDSD* epr_create_dsd ( int  dsd_index)

Opens dsd for a dataset description, obtained from an ENVISAT product file.

Parameters
dsd_indexthe number of dsd (zero-based), emrty dsd inclusive
Returns
the the pointer at the dsd information.

Definition at line 48 of file epr_dsd.c.

◆ epr_detect_meris_iodd_version()

int epr_detect_meris_iodd_version ( EPR_SProductId *  product_id)

Definition at line 125 of file epr_dsd.c.

◆ epr_find_first_dsd()

epr_uint epr_find_first_dsd ( FILE *  envisat_source_file,
epr_uint  sph_length 
)

Finds the first dataset description from an ENVISAT product file.

Parameters
envisat_source_filethe handle of the given ENVISAT product file, must not be NULL
sph_length[bytes] the length of SPH part from the given ENVISAT product file, must not be NULL
Returns
the offset to first searched for dsd or 0 if not found.

Definition at line 433 of file epr_dsd.c.

◆ epr_free_dsd()

void epr_free_dsd ( EPR_SDSD *  dsd)

Release the memory allocated through a dataset ID.

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

Definition at line 175 of file epr_dsd.c.

◆ epr_read_all_dsds()

EPR_SPtrArray* epr_read_all_dsds ( EPR_SProductId *  product_id)

Reads all dataset descriptions from an ENVISAT product file.

Parameters
product_idthe file identifier, if NULL the function immediately returns NULL.
Returns
an array of dataset descriptions or NULL if an error occured.

Definition at line 469 of file epr_dsd.c.

◆ epr_read_each_dsd()

EPR_SDSD* epr_read_each_dsd ( FILE *  envisat_source_file,
int *  pos 
)

Reads a dataset description from an ENVISAT product file.

Parameters
envisat_source_filethe handle of the given ENVISAT product file, must not be NULL
posnumber of the dataset description in ENVISAT product file,
Returns
a new dataset description or NULL if an error occured.

Definition at line 226 of file epr_dsd.c.