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

STYLE: remove old comments and tidy up

parent 79a14e51
No related branches found
No related tags found
No related merge requests found
......@@ -31,50 +31,33 @@ int otbReduceSpectralResponse(int argc, char * argv[])
std::cout << "\t" << "<reflectance mode>" << "\t" << "(<Output_filename>)" << std::endl;
return EXIT_FAILURE;
}
typedef otb::SpectralResponse<double, double> ResponseType;
typedef ResponseType::Pointer ResponsePointerType;
typedef otb::SatelliteRSR<double, double> SatRSRType;
typedef SatRSRType::Pointer SatRSRPointerType;
typedef otb::ReduceSpectralResponse<ResponseType, SatRSRType> ReduceResponseType;
typedef ReduceResponseType::Pointer ReduceResponseTypePointerType;
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();
/** Load the spectral response file*/
mySpectralResponse->Load(spectreFile, 100.0);
SatRSRPointerType myRSR = SatRSRType::New();
/** Set the satelite number of bands */
myRSR->SetNbBands(nbBand);
/** Load the satelite response file*/
myRSR->Load(RSRfile);
ReduceResponseTypePointerType myReduceResponse = ReduceResponseType::New();
//Instantiation
//ResponsePointerType myResponse=ResponseType::New();
ReduceResponseTypePointerType myReduceResponse = ReduceResponseType::New();
/** Load the satelite response in the simulator */
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*/
//std::cout << mySpectralResponse << std::endl;
//itk::Indent ind;
/** Print the input Satelite RSR*/
//std::cout << myRSR << std::endl;
//myResponse->PrintSelf(std::cout, ind);
/** Compute the RSR reduce spectral response*/
myReduceResponse->CalculateResponse();
/** Print the Reduce SR*/
std::cout << myReduceResponse << std::endl;
......@@ -82,10 +65,8 @@ int otbReduceSpectralResponse(int argc, char * argv[])
{
char * outputName = argv[5];
std::ofstream outputFile(outputName, std::ios::out);
outputFile << myReduceResponse << std::endl;
}
else std::cout << myReduceResponse << std::endl;
return EXIT_SUCCESS;
}
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