Commit 9d6d0167 authored by Manuel Grizonnet's avatar Manuel Grizonnet

ENH: return orientation as azimuth if incidences angles are not available in metadata

parent ddc9ce8a
......@@ -708,29 +708,43 @@ PleiadesImageMetadataInterface::GetSatAzimuth() const
itk::ExposeMetaData<ImageKeywordlistType>(dict, MetaDataKey::OSSIMKeywordlistKey, imageKeywordlist);
}
if (!imageKeywordlist.HasKey("support_data.scene_orientation") || !imageKeywordlist.HasKey("support_data.along_track_incidence_angle") || !imageKeywordlist.HasKey("support_data.across_track_incidence_angle"))
if (!imageKeywordlist.HasKey("support_data.scene_orientation"))
{
return 0;
}
else if (!imageKeywordlist.HasKey("support_data.along_track_incidence_angle") || !imageKeywordlist.HasKey("support_data.across_track_incidence_angle"))
{
// MSD: for the moment take only topCenter value
std::string valueString = imageKeywordlist.GetMetadataByKey("support_data.scene_orientation");
double cap = atof(valueString.c_str());
// MSD: for the moment take only topCenter value
std::string valueString = imageKeywordlist.GetMetadataByKey("support_data.scene_orientation");
double cap = atof(valueString.c_str());
//return only orientation if across/along track incidence are not available
return cap;
}
else
{
//Got orientation and incidences angle which allow to compute satellite
// azimuthal angle
// MSD: for the moment take only topCenter value
std::string valueString = imageKeywordlist.GetMetadataByKey("support_data.scene_orientation");
double cap = atof(valueString.c_str());
valueString = imageKeywordlist.GetMetadataByKey("support_data.along_track_incidence_angle");
double along = atof(valueString.c_str());
valueString = imageKeywordlist.GetMetadataByKey("support_data.along_track_incidence_angle");
double along = atof(valueString.c_str());
valueString = imageKeywordlist.GetMetadataByKey("support_data.across_track_incidence_angle");
double ortho = atof(valueString.c_str());
valueString = imageKeywordlist.GetMetadataByKey("support_data.across_track_incidence_angle");
double ortho = atof(valueString.c_str());
//Compute Satellite azimuthal angle using the azimuthal angle and the along
//and across track incidence angle
//Compute Satellite azimuthal angle using the azimuthal angle and the along
//and across track incidence angle
double satAz = (cap - vcl_atan2(vcl_tan(ortho * CONST_PI_180),vcl_tan(along * CONST_PI_180)) * CONST_180_PI);
double satAz = (cap - vcl_atan2(vcl_tan(ortho * CONST_PI_180),vcl_tan(along * CONST_PI_180)) * CONST_180_PI);
satAz = fmod(satAz,360);
satAz = fmod(satAz,360);
return satAz;
return satAz;
}
}
PleiadesImageMetadataInterface::VariableLengthVectorType
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment