Skip to content
Snippets Groups Projects
Commit 79a14e51 authored by Jordi Inglada's avatar Jordi Inglada
Browse files

TEST: modify test to accept the reflectance mode parameter

parent 30ee7273
No related branches found
No related tags found
No related merge requests found
......@@ -92,6 +92,7 @@ add_test(siTuReduceSpectralResponse ${Simulation_TESTS2}
${SPECTRUM_DB}/jpl/beckman/minerals/Arsenate/txt/A01Ac.txt
${INPUTDATA}/Radiometry/SPOT5/HRG2/rep6S.dat
4 #nb band
0 #reflectance mode
)
add_test(siTvReduceSpectralResponse ${Simulation_TESTS2}
......@@ -101,6 +102,7 @@ add_test(siTvReduceSpectralResponse ${Simulation_TESTS2}
${INPUTDATA}/SpectralResponse1.txt
${INPUTDATA}/Radiometry/Test/rep6S.dat
4 #nb band
0 #reflectance mode
${TEMP}/siTvReduceSpectralResponse.txt
)
......
......@@ -24,11 +24,11 @@
int otbReduceSpectralResponse(int argc, char * argv[])
{
if ((argc != 4) && (argc != 5))
if ((argc != 5) && (argc != 6))
{
std::cout << argv[0] << std::endl << "\t" << "<Spectral_response_filename>";
std::cout << "\t" << "<RSR_filename>" << "\t" << "<Nb total satellite band>";
std::cout << "\t" << "(<Output_filename>)" << std::endl;
std::cout << "\t" << "<reflectance mode>" << "\t" << "(<Output_filename>)" << std::endl;
return EXIT_FAILURE;
}
......@@ -44,6 +44,7 @@ int otbReduceSpectralResponse(int argc, char * argv[])
const std::string spectreFile(argv[1]);
const std::string RSRfile(argv[2]);
unsigned int nbBand = atoi(argv[3]);
bool reflectanceMode(atoi(argv[4]));
//Instantiation
ResponsePointerType mySpectralResponse = ResponseType::New();
......@@ -63,6 +64,8 @@ int otbReduceSpectralResponse(int argc, char * argv[])
myReduceResponse->SetInputSatRSR(myRSR);
/** Load the spectral response of the object in the simulator*/
myReduceResponse->SetInputSpectralResponse(mySpectralResponse);
/** Set the reflectance or luminance mode */
myReduceResponse->SetReflectanceMode(reflectanceMode);
//Load file into vector
/** Print the input spectral response*/
......@@ -75,9 +78,9 @@ int otbReduceSpectralResponse(int argc, char * argv[])
myReduceResponse->CalculateResponse();
/** Print the Reduce SR*/
std::cout << myReduceResponse << std::endl;
if (argc == 5)
if (argc == 6)
{
char * outputName = argv[4];
char * outputName = argv[5];
std::ofstream outputFile(outputName, std::ios::out);
outputFile << myReduceResponse << std::endl;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment