diff --git a/Testing/Code/Radiometry/CMakeLists.txt b/Testing/Code/Radiometry/CMakeLists.txt index 585c2ccca36d7979692799bb09aeca1281684c9d..60c69af12395933bb3ebedcbc017db64857ea735 100755 --- a/Testing/Code/Radiometry/CMakeLists.txt +++ b/Testing/Code/Radiometry/CMakeLists.txt @@ -455,10 +455,9 @@ ADD_TEST(raTvAtmosphericCorrectionSequencementTest ${RADIOMETRY_TESTS} # LuminanceToReflectance parameters 27.3 #elevation et azimuth solaire 4 #day - 12 #mounth + 12 #month ${INPUTDATA}/atmosphericCorrectionSequencement_solar_illumination.txt # AtmosphericCorrectionParametersTo6SAtmosphericRadiativeTerms parameters - 27.3 152.7 2.5 -77.0 diff --git a/Testing/Code/Radiometry/otbAtmosphericCorrectionSequencement.cxx b/Testing/Code/Radiometry/otbAtmosphericCorrectionSequencement.cxx index 23dd5452048a63bd5ebd73a8f37ab66392229e21..38e66bd11bda59cb56e435d396a25ea1140b1528 100755 --- a/Testing/Code/Radiometry/otbAtmosphericCorrectionSequencement.cxx +++ b/Testing/Code/Radiometry/otbAtmosphericCorrectionSequencement.cxx @@ -40,13 +40,13 @@ int otbAtmosphericCorrectionSequencementTest( int argc, char *argv[] ) { - if( argc != 20 ) + if( argc != 19 ) { std::cerr << "Missing Parameters " << std::endl; std::cerr << "Usage: " << argv[0]; std::cerr << " inputImage , outputImage," << std::endl; - std::cerr << " alphaBetaFileName , zenithalSolarRadius , day, month , solarIlluminationFileName," << std::endl; - std::cerr << " solarZenithalAngle , solarAzimutalAngle , viewingZenithalAngle , viewingAzimutalAngle," << std::endl; + std::cerr << " alphaBetaFileName , solarZenithalAngle , day, month , solarIlluminationFileName," << std::endl; + std::cerr << " solarAzimutalAngle , viewingZenithalAngle , viewingAzimutalAngle," << std::endl; std::cerr << " atmosphericPressure , waterVaporAmount , ozoneAmount , aerosolModel , AerosolOptical," << std::endl; std::cerr << " wavelenghtSpectralBandFileName , adjencyEffect6SCorrectionWindowRadius, pixelSpacingInKilometers" << std::endl; std::cerr << std::endl; @@ -178,7 +178,7 @@ int otbAtmosphericCorrectionSequencementTest( int argc, char *argv[] ) std::string sString; ValuesVectorType vector; - fin.open(argv[17]); + fin.open(argv[16]); fin >> nbBands; for(unsigned int i=0 ; i<nbBands ; i++) { @@ -205,18 +205,18 @@ int otbAtmosphericCorrectionSequencementTest( int argc, char *argv[] ) // Set parameters - dataAtmosphericCorrectionParameters->SetSolarZenithalAngle(static_cast<double>(atof(argv[8]))); - dataAtmosphericCorrectionParameters->SetSolarAzimutalAngle(static_cast<double>(atof(argv[9]))); - dataAtmosphericCorrectionParameters->SetViewingZenithalAngle(static_cast<double>(atof(argv[10]))); - dataAtmosphericCorrectionParameters->SetViewingAzimutalAngle(static_cast<double>(atof(argv[11]))); + dataAtmosphericCorrectionParameters->SetSolarZenithalAngle(filterLuminanceToReflectance->GetZenithalSolarAngle()); + dataAtmosphericCorrectionParameters->SetSolarAzimutalAngle(static_cast<double>(atof(argv[8]))); + dataAtmosphericCorrectionParameters->SetViewingZenithalAngle(static_cast<double>(atof(argv[9]))); + dataAtmosphericCorrectionParameters->SetViewingAzimutalAngle(static_cast<double>(atof(argv[10]))); dataAtmosphericCorrectionParameters->SetMonth(month); dataAtmosphericCorrectionParameters->SetDay(day); - dataAtmosphericCorrectionParameters->SetAtmosphericPressure(static_cast<double>(atof(argv[12]))); - dataAtmosphericCorrectionParameters->SetWaterVaporAmount(static_cast<double>(atof(argv[13]))); - dataAtmosphericCorrectionParameters->SetOzoneAmount(static_cast<double>(atof(argv[14]))); - AerosolModelType aerosolModel = static_cast<AerosolModelType>(::atoi(argv[15])); + dataAtmosphericCorrectionParameters->SetAtmosphericPressure(static_cast<double>(atof(argv[11]))); + dataAtmosphericCorrectionParameters->SetWaterVaporAmount(static_cast<double>(atof(argv[12]))); + dataAtmosphericCorrectionParameters->SetOzoneAmount(static_cast<double>(atof(argv[13]))); + AerosolModelType aerosolModel = static_cast<AerosolModelType>(::atoi(argv[14])); dataAtmosphericCorrectionParameters->SetAerosolModel(aerosolModel); - dataAtmosphericCorrectionParameters->SetAerosolOptical(static_cast<double>(atof(argv[16]))); + dataAtmosphericCorrectionParameters->SetAerosolOptical(static_cast<double>(atof(argv[15]))); AtmosphericCorrectionParametersTo6SRadiativeTermsType::Pointer filterAtmosphericCorrectionParametersTo6SRadiativeTerms = AtmosphericCorrectionParametersTo6SRadiativeTermsType::New(); filterAtmosphericCorrectionParametersTo6SRadiativeTerms->SetInput( dataAtmosphericCorrectionParameters ); @@ -235,8 +235,8 @@ int otbAtmosphericCorrectionSequencementTest( int argc, char *argv[] ) SurfaceAdjencyEffect6SCorrectionSchemeFilterType::Pointer filterSurfaceAdjencyEffect6SCorrectionSchemeFilter = SurfaceAdjencyEffect6SCorrectionSchemeFilterType::New(); filterSurfaceAdjencyEffect6SCorrectionSchemeFilter->SetAtmosphericRadiativeTerms(filterAtmosphericCorrectionParametersTo6SRadiativeTerms->GetOutput()); - filterSurfaceAdjencyEffect6SCorrectionSchemeFilter->SetWindowRadius(atoi(argv[18])); - filterSurfaceAdjencyEffect6SCorrectionSchemeFilter->SetPixelSpacingInKilometers(static_cast<double>(atof(argv[19]))); + filterSurfaceAdjencyEffect6SCorrectionSchemeFilter->SetWindowRadius(atoi(argv[17])); + filterSurfaceAdjencyEffect6SCorrectionSchemeFilter->SetPixelSpacingInKilometers(static_cast<double>(atof(argv[18]))); filterSurfaceAdjencyEffect6SCorrectionSchemeFilter->SetZenithalViewingAngle(dataAtmosphericCorrectionParameters->GetViewingZenithalAngle()); filterSurfaceAdjencyEffect6SCorrectionSchemeFilter->SetInput(filterReflectanceToSurfaceReflectanceImageFilter->GetOutput());