Skip to content

Fix support for ASA_WVI_1P #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/epr_dddb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1615,7 +1615,7 @@ static const struct RecordDescriptor ASAR_Wave_Geolocation_ADSR_asar_rec_data[]
{"attach_flag", e_tid_uchar, "flag", 1, "1", "Attachment Flag (set to 1 if unable to compute the cross spectra for a given SLC imagette (i.e. no Cross Spectra MDSR corresponding to this ADSR), set to 0 otherwise)"},
{"center_lat", e_tid_int, "(1e-6) degrees", 4, "1", "Geodetic latitude of center point (positive north) This is the center point of the wave cell. It is calculated after the cross spectra processing, and thus may differ from the center sample latitude of the SLC imagette if slant range to ground range conve"},
{"center_long", e_tid_int, "(1e-6) degrees", 4, "1", "Geodetic longitude of center point (positive east)This is the center point of the wave cell. It is calculated after the cross spectra processing, and thus may differ from the center sample latitude of the SLC imagette if slant range to ground range conver"},
{"spare_1", e_tid_spare, NULL, 4, "1", "Spare"}
{"heading", e_tid_float, "deg", 4, "1", "Subsatellite Track Heading. Relative to North of centre point."}
};

static const struct RecordDescriptor ASAR_Wave_Param_ADSR_asar_rec_data[] = {
Expand Down Expand Up @@ -3192,7 +3192,7 @@ static const struct DatasetDescriptor ASA_WVI_1P_dataset_data[] = {
{"GEOLOCATION_ADS", "GEOLOCATION ADS", ASAR_Wave_Geolocation_ADSR_asar_rec_data, "Wave Mode Geolocation ADS"},
{"PROCESSING_PARAMS_ADS", "PROCESSING PARAMS ADS", ASAR_Wave_Param_ADSR_asar_rec_data, "Wave Mode processing parameters"},
{"CROSS_SPECTRA_MDS", "CROSS SPECTRA MDS", ASAR_Spectra_MDSR_asar_rec_data, "Measurement Data Set containing spectra. 1 MDSR per spectra."},
{"SLC_IMAGETTE_MDS", "SLC IMAGETTE MDS", ASAR_Image_MDSR_SLC_asar_rec_data, "Measurement Data Set for a single imagette (corresponds to one spectrum MDSR)"},
{"SLC_IMAGETTE_MDS_000", "SLC IMAGETTE MDS 000", ASAR_Image_MDSR_SLC_asar_rec_data, "Measurement Data Set for a single imagette (corresponds to one spectrum MDSR)"},
{"SLC_IMAGETTE_MDS_001", "SLC IMAGETTE MDS 001", ASAR_Image_MDSR_SLC_asar_rec_data, "Measurement Data Set for a single imagette (corresponds to one spectrum MDSR)"},
{"SLC_IMAGETTE_MDS_002", "SLC IMAGETTE MDS 002", ASAR_Image_MDSR_SLC_asar_rec_data, "Measurement Data Set for a single imagette (corresponds to one spectrum MDSR)"},
{"SLC_IMAGETTE_MDS_003", "SLC IMAGETTE MDS 003", ASAR_Image_MDSR_SLC_asar_rec_data, "Measurement Data Set for a single imagette (corresponds to one spectrum MDSR)"},
Expand Down
14 changes: 9 additions & 5 deletions src/epr_msph.c
Original file line number Diff line number Diff line change
Expand Up @@ -529,8 +529,8 @@ void epr_set_header_field_values(EPR_SRecord* record, EPR_SPtrArray* header_valu

uint epr_compare_param(EPR_SProductId* product_id)
{
EPR_SDSD* dsd;
uint of;
EPR_SDSD* dsd = NULL;
uint dsd_index = 0;

epr_clear_err();

Expand All @@ -539,10 +539,14 @@ uint epr_compare_param(EPR_SProductId* product_id)
return 0UL;
}

of = epr_api.epr_head_size;
dsd = (EPR_SDSD*)epr_get_ptr_array_elem_at(product_id->dsd_array, 0);
for (dsd_index = 0; dsd_index < product_id->dsd_array->length; dsd_index++) {
dsd = (EPR_SDSD*)epr_get_ptr_array_elem_at(product_id->dsd_array, dsd_index);
if (dsd->ds_offset > 0)
break;
}

if (dsd->ds_offset == epr_api.epr_head_size)
return of;
return epr_api.epr_head_size;

return 0UL;
}
5 changes: 3 additions & 2 deletions src/epr_param.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,9 @@ int epr_set_dyn_dddb_params(EPR_SProductId* product_id)
/* AATSR does NOT have any dynamic parameters in DDDB */

/* ASAR */
else if ((strcmp(EPR_ENVISAT_PRODUCT_ASAR, epr_sub_string((char*)product_field->elems, 0, 3)) == 0) ||
(strcmp(EPR_ENVISAT_PRODUCT_SAR, epr_sub_string((char*)product_field->elems, 0, 3)) == 0)) {
else if (((strcmp(EPR_ENVISAT_PRODUCT_ASAR, epr_sub_string((char*)product_field->elems, 0, 3)) == 0) ||
(strcmp(EPR_ENVISAT_PRODUCT_SAR, epr_sub_string((char*)product_field->elems, 0, 3)) == 0)) &&
(strncmp(product_id->id_string, "ASA_WVI_1P", 10) != 0)) {

field = epr_get_field(product_id->sph_record, "LINE_LENGTH");
if (field == NULL) {
Expand Down
14 changes: 6 additions & 8 deletions src/epr_product.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,16 +208,14 @@ EPR_SProductId* epr_open_product(const char* product_file_path) {

epr_log(e_log_info, "creating band identifiers");
product_id->band_ids = epr_create_band_ids(product_id);
if (product_id->band_ids == NULL) {
epr_close_product(product_id);
return NULL;
}

/* Get scene size */
product_id->scene_width = epr_compute_scene_width(product_id);
product_id->scene_height = epr_compute_scene_height(product_id);
sprintf(message_buffer, "product scene raster size: %u x %u", product_id->scene_width, product_id->scene_height);
epr_log(e_log_debug, message_buffer);
if (product_id->band_ids != NULL) {
product_id->scene_width = epr_compute_scene_width(product_id);
product_id->scene_height = epr_compute_scene_height(product_id);
sprintf(message_buffer, "product scene raster size: %u x %u", product_id->scene_width, product_id->scene_height);
epr_log(e_log_debug, message_buffer);
}

return product_id;
}
Expand Down