#include "float.h"
#include "math.h"
#include "c_hdf_reader.h"
Go to the source code of this file.
Defines | |
#define | NB_INPUT_FILE_MAX 20 |
#define | NB_AEROSOL_LAYER_CALIOP 8 |
#define | NB_PARASOL_DIRECTION 16 |
#define | NB_CLOUDSAT_VERTICAL_BINS 125 |
Functions | |
double | default_scale_function (const double invalue, const double scale_factor, const double scale_offset) |
default scaling function for HDF data : scaled_value = (bin_value - scale_offset) * scale_factor | |
double | parasol_scale_function (const double invalue, const double scale_factor, const double scale_offset) |
scaling function for PARASOL data : scaled_value = bin_value * scale_factor + scale_offset | |
double * | read_custom_scale_sds_data_by_id (const int32 sd_id, const char *sds_name, double *sds_data, int32 *start, int32 *stride, int32 *edges, double(*scale_function)(const double, const double, const double)) |
read the data of one dataset and apply the scaling to it | |
double * | custom_scale_data (const void *indata, const int32 indata_size, const int32 indata_typecode, const double scale_factor, const double scale_offset, double(*scale_function)(const double, const double, const double), double *outdata) |
apply a non HDF standard scaling function to an array of calibrated data | |
int32 | get_v_input_files (const char *filename, const char *product, char v_files[][MAX_NC_NAME], int32 *nb_file) |
read the list of input files of a product that have been used to build a caltrack product | |
int32 | get_v_input_files_by_id (const int32 sd_id, const char *product, char v_files[][MAX_NC_NAME], int32 *nb_file) |
read the list of input files of a product that have been used to build a caltrack product | |
int32 | get_input_file_by_id (const int32 sd_id, const char *product, const int32 i_file, char infile[MAX_NC_NAME]) |
retrieve an input file name of a given product, using its index | |
int32 | is_fill_value (const void *p_value, const int32 typecode) |
check if the given variable is a Caltrack fill value |
double* custom_scale_data | ( | const void * | indata, | |
const int32 | indata_size, | |||
const int32 | indata_typecode, | |||
const double | scale_factor, | |||
const double | scale_offset, | |||
double(*)(const double, const double, const double) | scale_function, | |||
double * | outdata | |||
) |
apply a non HDF standard scaling function to an array of calibrated data
indata | [IN] array of calibrated binary data | |
indata_size | [IN] number of elements in indata | |
indata_typecode | [IN] indata HDF typecode | |
scale_factor | [IN] scaling factor | |
scale_offset | [IN] scaling offset | |
scale_function | [IN] pointer to the scaling function | |
outdata | [OUT] output scaled data |
References custom_scale_data(), get_data_type_size(), and is_fill_value().
Referenced by custom_scale_data(), and read_custom_scale_sds_data_by_id().
double default_scale_function | ( | const double | invalue, | |
const double | scale_factor, | |||
const double | scale_offset | |||
) |
default scaling function for HDF data : scaled_value = (bin_value - scale_offset) * scale_factor
invalue | value to scale | |
scale_factor | slope | |
scale_offset | offset |
References default_scale_function().
Referenced by default_scale_function().
int32 get_input_file_by_id | ( | const int32 | sd_id, | |
const char * | product, | |||
const int32 | i_file, | |||
char | infile[MAX_NC_NAME] | |||
) |
retrieve an input file name of a given product, using its index
sd_id | [IN] an SD id as returned by the open_hdf_file function | |
product | [IN] name of the product | |
i_file | [IN] index of the file, as set in caltrack's "Input_File_Index" datasets | |
infile[] | [OUT] name of the input file used to produce the caltrack file |
References get_input_file_by_id(), and get_v_input_files_by_id().
Referenced by get_input_file_by_id().
int32 get_v_input_files | ( | const char * | filename, | |
const char * | product, | |||
char | v_files[][MAX_NC_NAME], | |||
int32 * | nb_file | |||
) |
read the list of input files of a product that have been used to build a caltrack product
filename | [IN] the full path to the file to read | |
product | [IN] name of the product | |
v_files[][] | array of files names | |
nb_file | number of files of v_files |
References close_hdf_file(), get_v_input_files(), get_v_input_files_by_id(), and open_hdf_file().
Referenced by get_v_input_files().
int32 get_v_input_files_by_id | ( | const int32 | sd_id, | |
const char * | product, | |||
char | v_files[][MAX_NC_NAME], | |||
int32 * | nb_file | |||
) |
read the list of input files of a product that have been used to build a caltrack product
sd_id | [IN] an SD id as returned by the open_hdf_file function | |
product | [IN] name of the product | |
v_files[][] | array of files names | |
nb_file | number of files of v_files |
References free_attr(), get_file_attr_by_id(), get_v_input_files_by_id(), and ATTR::value.
Referenced by get_input_file_by_id(), get_v_input_files(), and get_v_input_files_by_id().
int32 is_fill_value | ( | const void * | p_value, | |
const int32 | typecode | |||
) |
check if the given variable is a Caltrack fill value
p_value | [IN] pointer to the value to test | |
typecode | [IN] an HDF typecode |
References is_fill_value().
Referenced by custom_scale_data(), and is_fill_value().
double parasol_scale_function | ( | const double | invalue, | |
const double | scale_factor, | |||
const double | scale_offset | |||
) |
scaling function for PARASOL data : scaled_value = bin_value * scale_factor + scale_offset
invalue | value to scale | |
scale_factor | slope | |
scale_offset | offset |
References parasol_scale_function().
Referenced by parasol_scale_function().
double* read_custom_scale_sds_data_by_id | ( | const int32 | sd_id, | |
const char * | sds_name, | |||
double * | sds_data, | |||
int32 * | start, | |||
int32 * | stride, | |||
int32 * | edges, | |||
double(*)(const double, const double, const double) | scale_function | |||
) |
read the data of one dataset and apply the scaling to it
sd_id | [IN] an SD id as returned by the open_hdf_file function | |
sds_name | [IN] name of the sds to read | |
sds_data | [OUT] the buffer where is stored the read data. If set to NULL, the method will manage the memory allocation | |
start | [IN] Array specifying the starting location from where data is read. Set it to NULL to read all the dataset | |
stride | [IN] Array specifying the interval between the values that will be read along each dimension. Set it to NULL to read all the contigous data | |
edges | [IN] Array specifying the number of values to be read along each dimension. Set it to NULL to read all the dataset | |
scale_function | [IN] pointer to the scaling function |
References custom_scale_data(), SDS_INFO::data_type, free_sds_info(), free_typed_data(), get_sds_calibration_by_id(), get_sds_info_by_id(), SDS_INFO::rank, read_custom_scale_sds_data_by_id(), read_sds_binary_data_by_id(), set_start_stride_edge(), and SDS_INFO::v_attr.
Referenced by read_custom_scale_sds_data_by_id().