52 QString msg = QObject::tr(
"Input calibration file [%1] must have 2 lines: "
53 "one containing wavelength centers and one containing widths").
54 arg(smileDefFilename.toString());
81 QString msg = QObject::tr(
"Unable to open input cube [%1] and read it into a spectral "
82 "definition.").arg(smileDefFilename.toString());
102 if ( (b >
m_sectionList->at(i)) && (b < m_sectionList->at(i+1)) ) {
130 const int band)
const {
140 Spectel SpectralDefinition2D::findSpectelByWavelength(
const double wavelength,
141 const int sectionNumber)
const {
152 const int sectionNumber)
const {
154 double bestdiff = DBL_MAX;
163 end = spectrum->length();
169 for (
int i=start; i<end; i++) {
170 diff = spectrum->at(i).centerWavelength() - wavelength;
171 if (std::abs(diff) < std::abs(bestdiff)) {
178 return spectrum->at(bestband);
191 for(
int band=0; band<
m_spectelList->at(samp)->size(); band++){
193 temp+=
"Spectel at (s,b) (";
194 temp+= QString::number(samp);
196 temp+= QString::number(band);
197 temp+=
") : Wavelength=";
214 if (in.
Band() == 1) {
226 if (in.Sample() == 1) {
229 int index = in.Band() - 1;
233 (((spectrum->at(index-2).centerWavelength() <
234 spectrum->at(index-1).centerWavelength()) &&
235 (spectrum->at(index-1).centerWavelength() >
236 spectrum->at(index).centerWavelength())) ||
237 ((spectrum->at(index-2).centerWavelength() >
238 spectrum->at(index-1).centerWavelength()) &&
239 (spectrum->at(index-1).centerWavelength() <
240 spectrum->at(index).centerWavelength())))) {
SpectralDefinition2D(FileName smileDefFilename)
Construct a SpectralDefinition2D object using a filename.
Buffer for reading and writing cube data.
File name manipulation and expansion.
~SpectralDefinition2D()
destructor
int m_numSections
The number of sections of this Spectral Definition.
int Sample(const int index=0) const
Returns the sample position associated with a shape buffer index.
void operator()(Buffer &in) const
Internal function used to help read-in a calibration cube.
Isis::Cube * SetInputCube(const QString ¶meter, int requirements=0)
Opens an input cube specified by the user and verifies requirements are met.
QList< QList< Spectel > * > * m_spectelList
Internally represent the samples x 2 lines x n bands calibration file Outside list is the sample inde...
int Band(const int index=0) const
Returns the band position associated with a shape buffer index.
void SetText(const QString &text)
Changes the value of the text string reported just before 0% processed.
double filterWidth() const
Gets wavelength width associated with spectel.
#define _FILEINFO_
Macro for the filename and line number.
QString toString()
Returns QString representation of SpectralDefinition2D.
A type of error that could only have occurred due to a mistake on the user's part (e...
A type of error that cannot be classified as any of the other error types.
int bandCount() const
Returns the number of virtual bands for the cube.
void ProcessCubeInPlace(const Functor &funct, bool threaded=true)
Isis::Progress * Progress()
This method returns a pointer to a Progress object.
int m_nl
Number of lines in input Cube.
int m_nb
Number of bands in input Cube.
int m_ns
Number of samples in input Cube.
QList< int > * m_sectionList
The list of sections.
void SetProcessingDirection(ProcessingDirection direction)
Set the direction the data will be read, either all lines in a single band proceeding to the next ban...
Stores information about a "Spectral pixel" or spectel.
Spectel findSpectel(const int sample, const int line, const int band) const
Get the Spectel at some sample, line, band (associated with your input/calibration file) ...
double centerWavelength() const
Gets central wavelength of spectel.
virtual int sectionCount() const
Returns the number of sections in the calibration image.
int sectionNumber(int s, int l, int b) const
returns section number given (s,l,b)
void Finalize()
Cleans up by closing cubes and freeing memory.
IO Handler for Isis Cubes.