diff --git a/app/otbSARAltAmbig.cxx b/app/otbSARAltAmbig.cxx index 22fed36ef7b3f94bce9d924318bc831563f66a4c..1ae050ad9a677726bcf6cdacb3eaa4da68021d87 100644 --- a/app/otbSARAltAmbig.cxx +++ b/app/otbSARAltAmbig.cxx @@ -119,8 +119,8 @@ private: SarSensorModelAdapter::Point3DType satelliteVelocity; SarSensorModelAdapter::Point3DType R; - demGeoPoint[0] = lat; - demGeoPoint[1] = lon; + demGeoPoint[0] = lon; + demGeoPoint[1] = lat; demGeoPoint[2] = height; SarSensorModelAdapter::WorldToCartesian(demGeoPoint, xyzCart); @@ -129,6 +129,13 @@ private: m_SarSensorModelAdapter->WorldToSatPositionAndVelocity(demGeoPoint, satellitePosition, satelliteVelocity); otbAppLogINFO(<<"Satellite Position : " << satellitePosition[0] << " " << satellitePosition[1] << " " << satellitePosition[2]); otbAppLogINFO(<<"Satellite Velocity : " << satelliteVelocity[0] << " " << satelliteVelocity[1] << " " << satelliteVelocity[2]); + // Calculate lambda + double radarFreq = atof(sarKWL.GetMetadataByKey("support_data.radar_frequency").c_str()); + const double C = 299792458.; + + float lambda = C/radarFreq; + otbAppLogINFO(<<"Lambda : " << lambda); + // Incidence R[0] = xyzCart[0] - satellitePosition[0]; R[1] = xyzCart[1] - satellitePosition[1]; @@ -137,10 +144,10 @@ private: double normeS = sqrt(satellitePosition[0]*satellitePosition[0] + satellitePosition[1]*satellitePosition[1] + satellitePosition[2]*satellitePosition[2]); - double normeCible = sqrt(xyzCart[0]*xyzCart[0] + xyzCart[1]*xyzCart[1] + xyzCart[2]*xyzCart[2]); - double normeR = sqrt(R[0]*R[0] + R[1]*R[1] + R[2]*R[2]); + double normeCible = sqrt(xyzCart[0] * xyzCart[0] + xyzCart[1] * xyzCart[1] + xyzCart[2] * xyzCart[2]); + double normeR = sqrt(R[0] * R[0] + R[1] * R[1] + R[2] * R[2]); - double incidence = acos((normeS*normeS - normeR*normeR - normeCible *normeCible) / + double incidence = acos((normeS * normeS - normeR * normeR - normeCible * normeCible) / (2 * normeCible * normeR) ) * 180. / M_PI; otbAppLogINFO(<<"Incidence : " << incidence); @@ -169,6 +176,9 @@ private: // Rm projection otbAppLogINFO(<< -(vecti[0]*rm[0]+vecti[1]*rm[1]+vecti[2]*rm[2])/normeRm); + otbAppLogINFO(<< -(vectj[0]*rm[0]+vectj[1]*rm[1]+vectj[2]*rm[2])/normeRm); + otbAppLogINFO(<< -(vectk[0]*rm[0]+vectk[1]*rm[1]+vectk[2]*rm[2])/normeRm); + } };