ocssw
V2022
|
epr_band.c
Go to the documentation of this file.
106 band_id->dataset_ref = epr_get_ref_struct(product_id, b_tables[bt_index].descriptors[i].rec_name);
161 band_id->flag_coding = epr_create_flag_coding(product_id, b_tables[bt_index].descriptors[i].flag_coding_name);
619 if ((offset_x<0) || (offset_y<0) || (raster->raster_width<0) || (raster->raster_height<0) || (raster->source_step_x<0) || (raster->source_step_y<0)) {
625 if ((raster->source_step_x>raster->raster_width) || (raster->source_step_y>raster->raster_height)) {
737 field_info = (EPR_SFieldInfo*)epr_get_ptr_array_elem_at(record->info->field_infos, band_id->dataset_ref.field_index - 1);
772 for (iY = offset_y; (epr_uint)iY < offset_y + raster->source_height; iY += raster->source_step_y ) {
782 decode_func(field->elems, band_id, offset_x_mirrored, raster->source_width, raster->source_step_x, raster->buffer, raster_pos);
861 field_info = (EPR_SFieldInfo*)epr_get_ptr_array_elem_at(record->info->field_infos, band_id->dataset_ref.field_index - 1);
890 epr_set_err(e_err_invalid_value, "epr_read_band_annotation_data: internal error: illegal value for samples_per_tie_pt");
968 for (iY = offset_y; (epr_uint)iY < offset_y + raster->source_height; iY += raster->source_step_y ) {
1308 buf[raster_pos++] = (float)pow(10, band_id->scaling_offset + band_id->scaling_factor * sa[2 * x]);
1338 buf[raster_pos++] = (float)pow(10, band_id->scaling_offset + band_id->scaling_factor * sa[2 * x + 1]);
1477 buf[raster_pos++] = (float)pow(10, band_id->scaling_offset + band_id->scaling_factor * (sa[2 * x] & 0xff));
1508 buf[raster_pos++] = (float)pow(10, band_id->scaling_offset + band_id->scaling_factor * (sa[2 * x + 1] & 0xff));
1512 buf[raster_pos++] = band_id->scaling_offset + band_id->scaling_factor * (sa[2 * x + 1] & 0xff);
1707 void mirror_uchar_array(epr_uchar* raster_buffer, epr_uint raster_width, epr_uint raster_height) {
1722 void mirror_ushort_array(epr_ushort* raster_buffer, epr_uint raster_width, epr_uint raster_height) {
1737 void mirror_uint_array(epr_uint* raster_buffer, epr_uint raster_width, epr_uint raster_height) {
an array had not been initialized Several spelling and grammar corrections were which is read from the appropriate MCF the above metadata values were hard coded A problem calculating the average background DN for SWIR bands when the moon is in the space view port was corrected The new algorithm used to calculate the average background DN for all reflective bands when the moon is in the space view port is now the same as the algorithm employed by the thermal bands For non SWIR changes in the averages are typically less than Also for non SWIR the black body DNs remain a backup in case the SV DNs are not available For SWIR the changes in computed averages were larger because the old which used the black body suffered from contamination by the micron leak As a consequence of the if SV DNs are not available for the SWIR the EV pixels will not be the granule time is used to identify the appropriate tables within the set given for one LUT the first two or last two tables respectively will be used for the interpolation If there is only one LUT in the set of it will be treated as a constant LUT The manner in which Earth View data is checked for saturation was changed Previously the raw Earth View DNs and Space View DNs were checked against the lookup table values contained in the table dn_sat The change made is to check the raw Earth and Space View DNs to be sure they are less than the maximum saturation value and to check the Space View subtracted Earth View dns against a set of values contained in the new lookup table dn_sat_ev The metadata configuration and ASSOCIATEDINSTRUMENTSHORTNAME from the MOD02HKM product The same metatdata with extensions and were removed from the MOD021KM and MOD02OBC products ASSOCIATEDSENSORSHORTNAME was set to MODIS in all products These changes are reflected in new File Specification which users may consult for exact the pow functions were eliminated in Emissive_Cal and Emissive bands replaced by more efficient code Other calculations throughout the code were also made more efficient Aside from a few round off there was no difference to the product The CPU time decreased by about for a day case and for a night case A minor bug in calculating the uncertainty index for emissive bands was corrected The frame index(0-based) was previously being used the frame number(1-based) should have been used. There were only a few minor changes to the uncertainty index(maximum of 1 digit). 3. Some inefficient arrays(Sigma_RVS_norm_sq) were eliminated and some code lines in Preprocess_L1A_Data were moved into Process_OBCEng_Emiss. There were no changes to the product. Required RAM was reduced by 20 MB. Now
void decode_line_uchar_2_of_2_to_float(void *source_array, EPR_SBandId *band_id, int offset_x, int raster_width, int step_x, void *raster_buffer, int raster_pos)
Definition: epr_band.c:1492
#define EPR_ATS_NUM_PER_POINT_ACROSS_SOLAR
Definition: epr_core.h:75
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)
Definition: epr_band.c:549
#define EPR_ASAR_NUM_PER_POINT_ACROSS_LOCAT
Definition: epr_core.h:78
void decode_line_ushort_1_of_1_to_float(void *source_array, EPR_SBandId *band_id, int offset_x, int raster_width, int step_x, void *raster_buffer, int raster_pos)
Definition: epr_band.c:1233
epr_uint epr_get_data_type_size(EPR_EDataTypeId data_type_id)
Definition: epr_core.c:148
void decode_line_uchar_2_of_2_to_uchar(void *source_array, EPR_SBandId *band_id, int offset_x, int raster_width, int step_x, void *raster_buffer, int raster_pos)
Definition: epr_band.c:1391
void epr_free_flag_coding(EPR_SPtrArray *flag_coding)
Definition: epr_bitmask.c:395
void mirror_uchar_array(epr_uchar *raster_buffer, epr_uint raster_width, epr_uint raster_height)
Definition: epr_band.c:1707
void mirror_float_array(float *raster_buffer, epr_uint raster_width, epr_uint raster_height)
Definition: epr_band.c:1692
void decode_line_short_1_of_1_to_float(void *source_array, EPR_SBandId *band_id, int offset_x, int raster_width, int step_x, void *raster_buffer, int raster_pos)
Definition: epr_band.c:1263
char * epr_assign_string(char **str_clone, const char *str)
Definition: epr_string.c:29
EPR_SPtrArray * epr_create_band_ids(EPR_SProductId *product_id)
Definition: epr_band.c:43
void * epr_get_raster_pixel_addr(const EPR_SRaster *raster, epr_uint x, epr_uint y)
Definition: epr_band.c:1055
void decode_line_short_2_of_2_to_float(void *source_array, EPR_SBandId *band_id, int offset_x, int raster_width, int step_x, void *raster_buffer, int raster_pos)
Definition: epr_band.c:1322
EPR_SBandId * epr_get_band_id_at(EPR_SProductId *product_id, epr_uint index)
Definition: epr_band.c:217
const double F
const EPR_SField * epr_get_field(const EPR_SRecord *record, const char *field_name)
Definition: epr_field.c:247
float epr_get_scaling_params(EPR_SProductId *product_id, const char *str)
Definition: epr_band.c:320
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)
Definition: epr_band.c:495
epr_boolean epr_equal_names(const char *name1, const char *name2)
Definition: epr_string.c:91
Definition: epr_dddb.h:55
EPR_SDatasetId * epr_get_dataset_id(EPR_SProductId *product_id, const char *dataset_name)
Definition: epr_dsd.c:96
void transform_array_short_to_float(void *sourceArray, EPR_SBandId *band_id, float *raster_buffer, epr_uint nel)
Definition: epr_band.c:1644
void transform_array_int_to_float(void *sourceArray, EPR_SBandId *band_id, float *raster_buffer, epr_uint nel)
Definition: epr_band.c:1668
EPR_SPtrArray * epr_create_flag_coding(EPR_SProductId *product_id, const char *flag_coding_name)
Definition: epr_bitmask.c:333
epr_uint epr_get_scene_width(const EPR_SProductId *product_id)
Definition: epr_product.c:357
epr_uint epr_get_raster_elem_size(const EPR_SRaster *raster)
Definition: epr_band.c:1039
EPR_FLineDecoder select_line_decode_function(EPR_EDataTypeId band_tid, EPR_ESampleModel band_smod, EPR_EDataTypeId raw_tid)
Definition: epr_band.c:1088
What value is used by your function when the data value is bad Default is BAD_FLT l2prod product_id[0]
Definition: HOWTO_Add_a_product.txt:102
epr_uint epr_get_field_elem_as_uint(const EPR_SField *field, epr_uint elem_index)
Definition: epr_typconv.c:363
EPR_SRecord * epr_read_record(EPR_SDatasetId *dataset_id, epr_uint record_index, EPR_SRecord *record)
Definition: epr_dataset.c:269
EPR_SRaster * epr_create_bitmask_raster(epr_uint source_width, epr_uint source_height, epr_uint source_step_x, epr_uint source_step_y)
Definition: epr_band.c:472
void decode_line_uchar_3_to_i_to_uint(void *source_array, EPR_SBandId *band_id, int offset_x, int raster_width, int step_x, void *raster_buffer, int raster_pos)
Definition: epr_band.c:1521
int epr_read_band_annotation_data(EPR_SBandId *band_id, int offset_x, int offset_y, EPR_SRaster *raster)
Definition: epr_band.c:820
#define EPR_ATS_NUM_PER_POINT_ACROSS_LOCAT
Definition: epr_core.h:74
float epr_get_scaling_factor(EPR_SProductId *product_id, const char *str)
Definition: epr_band.c:352
void * epr_get_ptr_array_elem_at(const EPR_SPtrArray *ptr_array, unsigned int index)
Definition: epr_ptrarray.c:122
void decode_line_short_1_of_2_to_float(void *source_array, EPR_SBandId *band_id, int offset_x, int raster_width, int step_x, void *raster_buffer, int raster_pos)
Definition: epr_band.c:1292
void(* EPR_FLineDecoder)(void *sourceArray, EPR_SBandId *band_id, int xo, int raster_width, int s_x, void *raster_buffer, int raster_pos)
Definition: epr_band.h:208
int epr_add_ptr_array_elem(EPR_SPtrArray *ptr_array, void *elem)
Definition: epr_ptrarray.c:75
EPR_EScalingMethod epr_str_to_scaling_method(const char *str)
Definition: epr_band.c:429
void decode_line_uchar_1_of_1_to_uchar(void *source_array, EPR_SBandId *band_id, int offset_x, int raster_width, int step_x, void *raster_buffer, int raster_pos)
Definition: epr_band.c:1352
void decode_line_uchar_1_of_2_to_uchar(void *source_array, EPR_SBandId *band_id, int offset_x, int raster_width, int step_x, void *raster_buffer, int raster_pos)
Definition: epr_band.c:1371
void epr_zero_invalid_pixels(EPR_SRaster *raster, EPR_SRaster *bm_raster)
Definition: epr_band.c:1752
float epr_get_field_elem_as_float(const EPR_SField *field, epr_uint elem_index)
Definition: epr_typconv.c:435
void epr_set_err(EPR_EErrCode err_code, const char *err_message)
Definition: epr_core.c:221
void mirror_ushort_array(epr_ushort *raster_buffer, epr_uint raster_width, epr_uint raster_height)
Definition: epr_band.c:1722
void decode_line_uchar_1_of_1_to_float(void *source_array, EPR_SBandId *band_id, int offset_x, int raster_width, int step_x, void *raster_buffer, int raster_pos)
Definition: epr_band.c:1173
void transform_array_ushort_to_float(void *sourceArray, EPR_SBandId *band_id, float *raster_buffer, epr_uint nel)
Definition: epr_band.c:1656
void decode_line_uchar_1_of_2_to_float(void *source_array, EPR_SBandId *band_id, int offset_x, int raster_width, int step_x, void *raster_buffer, int raster_pos)
Definition: epr_band.c:1461
EPR_SRecord * epr_create_record(EPR_SDatasetId *dataset_id)
Definition: epr_dataset.c:241
float epr_interpolate2D(float wi, float wj, float x00, float x10, float x01, float x11)
Definition: epr_band.c:1639
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)
Definition: epr_band.c:1557
epr_uint epr_get_scene_height(const EPR_SProductId *product_id)
Definition: epr_product.c:374
EPR_SDatasetRef epr_get_ref_struct(EPR_SProductId *product_id, const char *str)
Definition: epr_band.c:383
void decode_line_uchar_2_to_f_to_float(void *source_array, EPR_SBandId *band_id, int offset_x, int raster_width, int step_x, void *raster_buffer, int raster_pos)
Definition: epr_band.c:1429
EPR_ESampleModel epr_str_to_sample_offset(const char *str)
Definition: epr_band.c:448
epr_uint epr_get_num_records(const EPR_SDatasetId *dataset_id)
Definition: epr_dataset.c:184
char * epr_str_tok(const char *str, const char *seps, int *pos)
Definition: epr_string.c:122
EPR_SBandId * epr_get_band_id(EPR_SProductId *product_id, const char *band_name)
Definition: epr_band.c:237
EPR_FArrayTransformer select_transform_array_function(EPR_EDataTypeId band_tid, EPR_EDataTypeId raw_tid)
Definition: epr_band.c:1155
void(* EPR_FArrayTransformer)(void *sourceArray, EPR_SBandId *band_id, float *raster_buffer, epr_uint nel)
Definition: epr_band.h:221
void * epr_get_raster_line_addr(const EPR_SRaster *raster, epr_uint y)
Definition: epr_band.c:1063
int epr_read_band_raster(EPR_SBandId *band_id, int offset_x, int offset_y, EPR_SRaster *raster)
Definition: epr_band.c:593
void * epr_get_raster_elem_addr(const EPR_SRaster *raster, epr_uint offset)
Definition: epr_band.c:1047
How many dimensions is the output array Default is Not sure if anything above will work correctly strcpy(l2prod->title, "no title yet")
void decode_line_ushort_1_of_1_to_ushort(void *source_array, EPR_SBandId *band_id, int offset_x, int raster_width, int step_x, void *raster_buffer, int raster_pos)
Definition: epr_band.c:1410
void mirror_uint_array(epr_uint *raster_buffer, epr_uint raster_width, epr_uint raster_height)
Definition: epr_band.c:1737
void decode_line_char_1_of_1_to_float(void *source_array, EPR_SBandId *band_id, int offset_x, int raster_width, int step_x, void *raster_buffer, int raster_pos)
Definition: epr_band.c:1203
int epr_read_bitmask_raster(EPR_SProductId *product_id, const char *bm_expr, int offset_x, int offset_y, EPR_SRaster *raster)
Definition: epr_bitmask.c:99
int epr_read_band_measurement_data(EPR_SBandId *band_id, int offset_x, int offset_y, EPR_SRaster *raster)
Definition: epr_band.c:689
const EPR_SField * epr_get_field_at(const EPR_SRecord *record, epr_uint field_index)
Definition: epr_record.c:360
EPR_SPtrArray * epr_create_ptr_array(unsigned int capacity)
Definition: epr_ptrarray.c:29
void transform_array_uint_to_float(void *sourceArray, EPR_SBandId *band_id, float *raster_buffer, epr_uint nel)
Definition: epr_band.c:1680