Isis 3 Programmer Reference
Isis::Spectel Class Reference

Stores information about a "Spectral pixel" or spectel. More...

#include <Spectel.h>

Inheritance diagram for Isis::Spectel:
Inheritance graph
Collaboration diagram for Isis::Spectel:
Collaboration graph

Public Member Functions

 Spectel ()
 Constructs an empty Spectel. More...
 
 Spectel (int sample, int line, int band, double DN, double center, double width)
 Constructs a Spectel using its l,s,b coordinates, its DN value, and its wavelength. More...
 
 Spectel (Pixel pixel, double center, double width)
 Constructs a Spectel, given a Pixel, center wavelength, and width. More...
 
 Spectel (const Spectel &spectel)
 Constructs a Spectel, given a Spectel. More...
 
virtual ~Spectel ()
 Default destructor. More...
 
Specteloperator= (const Spectel &other)
 Copy assignment operator. More...
 
double centerWavelength () const
 Gets central wavelength of spectel. More...
 
double filterWidth () const
 Gets wavelength width associated with spectel. More...
 
int line () const
 
int sample () const
 
int band () const
 
double DN () const
 
unsigned char To8Bit ()
 Converts internal pixel value to an unsigned char pixel with special pixel translations. More...
 
short int To16Bit ()
 Converts internal pixel value to a short int pixel with special pixel translations. More...
 
short unsigned int To16Ubit ()
 Converts internal pixel value to a short int pixel with special pixel translations. More...
 
float To32Bit ()
 Converts internal pixel value to float with special pixel translations. More...
 
double ToDouble ()
 Converts stored pixel value to a double. More...
 
float ToFloat ()
 Converts internal pixel value to float with pixel translations and care for overflows (underflows are assumed to cast to 0!) More...
 
std::string ToString ()
 Returns the name of the pixel type as a string. More...
 
bool IsSpecial ()
 Returns true if the input pixel is special. More...
 
bool IsValid ()
 Returns true if the input pixel is valid. More...
 
bool IsNull ()
 Returns true if the input pixel is null. More...
 
bool IsHigh ()
 Returns true if the input pixel is one of the high saturation types. More...
 
bool IsLow ()
 Returns true if the input pixel is one of the low saturation types. More...
 
bool IsHrs ()
 Returns true if the input pixel is high representation saturation. More...
 
bool IsHis ()
 Returns true if the input pixel is high instrument saturation. More...
 
bool IsLis ()
 Returns true if the input pixel is low instrument saturation. More...
 
bool IsLrs ()
 Returns true if the input pixel is low representation saturation. More...
 

Static Public Member Functions

static unsigned char To8Bit (const double d)
 Converts double pixels to unsigned char pixels with special pixel translations. More...
 
static short int To16Bit (const double d)
 Converts double pixels to short int pixels with special pixel translations. More...
 
static short unsigned int To16UBit (const double d)
 Converts double pixels to short unsigned int pixels with special pixel translations. More...
 
static float To32Bit (const double d)
 Converts double pixels to float pixels with special pixel translations. More...
 
static double ToDouble (const unsigned char t)
 Converts unsigned char pixels to double pixels with special pixel translations. More...
 
static double ToDouble (const short int t)
 Converts short int pixels to double pixels with special pixel translations. More...
 
static double ToDouble (const short unsigned int t)
 Converts short unsigned int pixels to double pixels with special pixel translations. More...
 
static double ToDouble (const float t)
 Converts float pixels to double pixels with special pixel translations. More...
 
static float ToFloat (const unsigned char d)
 Converts unsigned char to float with pixel translations and care for overflows (underflows are assumed to cast to 0!) More...
 
static float ToFloat (const short int d)
 Converts short int to float with pixel translations and care for overflows (underflows are assumed to cast to 0!) More...
 
static float ToFloat (const short unsigned int d)
 Converts short unsigned int to float with pixel translations and care for overflows (underflows are assumed to cast to 0!) More...
 
static float ToFloat (const double d)
 Converts double to float with pixel translations and care for overflows (underflows are assumed to cast to 0!) More...
 
static std::string ToString (double d)
 Takes a double pixel value and returns the name of the pixel type as a string. More...
 
static bool IsSpecial (const double d)
 Returns true if the input pixel is special. More...
 
static bool IsSpecial (const float f)
 Returns true if the input pixel is special. More...
 
static bool IsValid (const double d)
 Returns true if the input pixel is valid. More...
 
static bool IsNull (const double d)
 Returns true if the input pixel is null. More...
 
static bool IsHigh (const double d)
 Returns true if the input pixel is one of the high saturation types. More...
 
static bool IsLow (const double d)
 Returns true if the input pixel is one of the low saturation types. More...
 
static bool IsHrs (const double d)
 Returns true if the input pixel is high representation saturation. More...
 
static bool IsHis (const double d)
 Returns true if the input pixel is high instrument saturation. More...
 
static bool IsLis (const double d)
 Returns true if the input pixel is low instrument saturation. More...
 
static bool IsLrs (const double d)
 Returns true if the input pixel is low representation saturation. More...
 

Private Attributes

double m_center
 Center wavelength associated with pixel. More...
 
double m_width
 Wavelength width (FWHM) associated with pixel. More...
 
int m_line
 line coordinate of pixel More...
 
int m_sample
 sample coordinate of pixel More...
 
int m_band
 band coordinate of pixel More...
 
double m_DN
 DN of pixel. More...
 

Detailed Description

Stores information about a "Spectral pixel" or spectel.

Author
2015-05-11 Kristin Berry (5/11/2015)
History:
2015-06-09 Stuart Sides - Added empty constructor and constness
History:
2015-08-04 Kristin Berry - Added copy constructor, copy assignment operator, virtual destructor, and a constructor that takes a Pixel, center, and width.

Definition at line 26 of file Spectel.h.

Constructor & Destructor Documentation

◆ Spectel() [1/4]

Isis::Spectel::Spectel ( )

Constructs an empty Spectel.

Author
2015-06-11 Stuart Sides

Definition at line 18 of file Spectel.cpp.

References m_center, m_width, and Isis::Null.

◆ Spectel() [2/4]

Isis::Spectel::Spectel ( int  sample,
int  line,
int  band,
double  DN,
double  center,
double  width 
)

Constructs a Spectel using its l,s,b coordinates, its DN value, and its wavelength.

Author
2015-05-08 Kristin Berry (5/8/2015)
Parameters
linespectel line coordinate
samplespectel sample coordinate
bandspectel band coordinate
DNspectel value
centercenter wavelength of spectel
widthwavelength width of spectel

Definition at line 38 of file Spectel.cpp.

References m_center, and m_width.

◆ Spectel() [3/4]

Isis::Spectel::Spectel ( Pixel  pixel,
double  center,
double  width 
)

Constructs a Spectel, given a Pixel, center wavelength, and width.

Author
2015-08-09 Kristin Berry
Parameters
pixelPixel used to create the Spectel
centerCenter wavelength of the Spectel
widthWidth of the Spectel

Definition at line 54 of file Spectel.cpp.

References m_center, and m_width.

◆ Spectel() [4/4]

Isis::Spectel::Spectel ( const Spectel spectel)

Constructs a Spectel, given a Spectel.

Author
2015-08-06 Kristin Berry
Parameters
spectelSpectel to copy

Definition at line 67 of file Spectel.cpp.

References centerWavelength(), filterWidth(), m_center, and m_width.

◆ ~Spectel()

Isis::Spectel::~Spectel ( )
virtual

Default destructor.

Definition at line 75 of file Spectel.cpp.

Member Function Documentation

◆ band()

int Isis::Pixel::band ( ) const
inherited
Returns
int The band coordinate of the Pixel

Definition at line 92 of file Pixel.cpp.

Referenced by Isis::Pixel::operator=(), and Isis::Pixel::Pixel().

◆ centerWavelength()

double Isis::Spectel::centerWavelength ( ) const

Gets central wavelength of spectel.

Author
kberry (5/11/2015)
Returns
double center wavelength of spectel

Definition at line 95 of file Spectel.cpp.

References m_center.

Referenced by Isis::SpectralDefinition1D::findSpectel(), operator=(), Spectel(), and Isis::SpectralDefinition2D::toString().

◆ DN()

double Isis::Pixel::DN ( ) const
inherited
Returns
double The DN value of the Pixel

Definition at line 98 of file Pixel.cpp.

Referenced by Isis::Pixel::operator=(), and Isis::Pixel::Pixel().

◆ filterWidth()

double Isis::Spectel::filterWidth ( ) const

Gets wavelength width associated with spectel.

Author
kberry (5/11/2015)
Returns
double wavelength width of spectel

Definition at line 107 of file Spectel.cpp.

References m_width.

Referenced by operator=(), Spectel(), and Isis::SpectralDefinition2D::toString().

◆ IsHigh() [1/2]

bool Isis::Pixel::IsHigh ( )
inlineinherited

Returns true if the input pixel is one of the high saturation types.

Returns
bool

Definition at line 180 of file Pixel.h.

References Isis::Pixel::m_DN.

◆ IsHigh() [2/2]

static bool Isis::Pixel::IsHigh ( const double  d)
inlinestaticinherited

Returns true if the input pixel is one of the high saturation types.

Parameters
dPixel value to test
Returns
bool

Definition at line 171 of file Pixel.h.

◆ IsHis() [1/2]

bool Isis::Pixel::IsHis ( )
inlineinherited

Returns true if the input pixel is high instrument saturation.

Returns
bool

Definition at line 240 of file Pixel.h.

References Isis::Pixel::m_DN.

◆ IsHis() [2/2]

static bool Isis::Pixel::IsHis ( const double  d)
inlinestaticinherited

Returns true if the input pixel is high instrument saturation.

Parameters
dPixel value to test
Returns
bool

Definition at line 231 of file Pixel.h.

◆ IsHrs() [1/2]

bool Isis::Pixel::IsHrs ( )
inlineinherited

Returns true if the input pixel is high representation saturation.

Returns
bool

Definition at line 220 of file Pixel.h.

References Isis::Pixel::m_DN.

◆ IsHrs() [2/2]

static bool Isis::Pixel::IsHrs ( const double  d)
inlinestaticinherited

Returns true if the input pixel is high representation saturation.

Parameters
dPixel value to test
Returns
bool

Definition at line 211 of file Pixel.h.

◆ IsLis() [1/2]

bool Isis::Pixel::IsLis ( )
inlineinherited

Returns true if the input pixel is low instrument saturation.

Returns
bool

Definition at line 260 of file Pixel.h.

References Isis::Pixel::m_DN.

◆ IsLis() [2/2]

static bool Isis::Pixel::IsLis ( const double  d)
inlinestaticinherited

Returns true if the input pixel is low instrument saturation.

Parameters
dPixel value to test
Returns
bool

Definition at line 251 of file Pixel.h.

◆ IsLow() [1/2]

bool Isis::Pixel::IsLow ( )
inlineinherited

Returns true if the input pixel is one of the low saturation types.

Returns
bool

Definition at line 200 of file Pixel.h.

References Isis::Pixel::m_DN.

◆ IsLow() [2/2]

static bool Isis::Pixel::IsLow ( const double  d)
inlinestaticinherited

Returns true if the input pixel is one of the low saturation types.

Parameters
dPixel value to test
Returns
bool

Definition at line 191 of file Pixel.h.

◆ IsLrs() [1/2]

bool Isis::Pixel::IsLrs ( )
inlineinherited

Returns true if the input pixel is low representation saturation.

Returns
bool

Definition at line 280 of file Pixel.h.

References Isis::Pixel::m_DN.

◆ IsLrs() [2/2]

static bool Isis::Pixel::IsLrs ( const double  d)
inlinestaticinherited

Returns true if the input pixel is low representation saturation.

Parameters
dPixel value to test
Returns
bool

Definition at line 271 of file Pixel.h.

◆ IsNull() [1/2]

bool Isis::Pixel::IsNull ( )
inlineinherited

Returns true if the input pixel is null.

Returns
bool

Definition at line 160 of file Pixel.h.

References Isis::Pixel::m_DN.

◆ IsNull() [2/2]

static bool Isis::Pixel::IsNull ( const double  d)
inlinestaticinherited

Returns true if the input pixel is null.

Parameters
dPixel value to test
Returns
bool

Definition at line 151 of file Pixel.h.

◆ IsSpecial() [1/3]

bool Isis::Pixel::IsSpecial ( )
inlineinherited

Returns true if the input pixel is special.

Not special implies it is valid to use in computations.

Returns
bool

Definition at line 105 of file Pixel.h.

References Isis::Pixel::m_DN.

◆ IsSpecial() [2/3]

static bool Isis::Pixel::IsSpecial ( const double  d)
inlinestaticinherited

Returns true if the input pixel is special.

Not special implies it is valid to use in computations.

Parameters
dPixel value to test
Returns
bool

Definition at line 95 of file Pixel.h.

◆ IsSpecial() [3/3]

static bool Isis::Pixel::IsSpecial ( const float  f)
inlinestaticinherited

Returns true if the input pixel is special.

Not special implies it is valid to use in computations. This method applies to a 4-byte floating point rather than an 8-byte double.

Parameters
fPixel value to test
Returns
bool

Definition at line 118 of file Pixel.h.

◆ IsValid() [1/2]

bool Isis::Pixel::IsValid ( )
inlineinherited

Returns true if the input pixel is valid.

Valid implies the pixel is neither hrs, lrs, his, lis, nor null.

Returns
bool

Definition at line 140 of file Pixel.h.

References Isis::Pixel::m_DN.

◆ IsValid() [2/2]

static bool Isis::Pixel::IsValid ( const double  d)
inlinestaticinherited

Returns true if the input pixel is valid.

Valid implies the pixel is neither hrs, lrs, his, lis, nor null.

Parameters
dPixel value to test
Returns
bool

Definition at line 130 of file Pixel.h.

◆ line()

int Isis::Pixel::line ( ) const
inherited
Returns
int The line coordinate of the Pixel

Definition at line 80 of file Pixel.cpp.

Referenced by Isis::Pixel::operator=(), and Isis::Pixel::Pixel().

◆ operator=()

Spectel & Isis::Spectel::operator= ( const Spectel other)

Copy assignment operator.

Definition at line 80 of file Spectel.cpp.

References centerWavelength(), filterWidth(), m_center, m_width, and Isis::Pixel::operator=().

◆ sample()

int Isis::Pixel::sample ( ) const
inherited
Returns
int The sample coordinate of the Pixel

Definition at line 86 of file Pixel.cpp.

Referenced by Isis::Pixel::operator=(), and Isis::Pixel::Pixel().

◆ To16Bit() [1/2]

short int Isis::Pixel::To16Bit ( )
inherited

Converts internal pixel value to a short int pixel with special pixel translations.

Returns
short int The short int pixel value

Definition at line 189 of file Pixel.cpp.

◆ To16Bit() [2/2]

short int Isis::Pixel::To16Bit ( const double  d)
staticinherited

Converts double pixels to short int pixels with special pixel translations.

Parameters
dDouble pixel value to be converted to a double
Returns
short int The short int pixel value

Definition at line 152 of file Pixel.cpp.

◆ To16Ubit()

short unsigned int Isis::Pixel::To16Ubit ( )
inherited

Converts internal pixel value to a short int pixel with special pixel translations.

Returns
short unsigned int The short int pixel value

Definition at line 237 of file Pixel.cpp.

◆ To16UBit()

short unsigned int Isis::Pixel::To16UBit ( const double  d)
staticinherited

Converts double pixels to short unsigned int pixels with special pixel translations.

Parameters
dDouble pixel value to be converted to a double
Returns
short unsigned int The short int pixel value

Definition at line 200 of file Pixel.cpp.

◆ To32Bit() [1/2]

float Isis::Pixel::To32Bit ( )
inherited

Converts internal pixel value to float with special pixel translations.

Returns
float The float pixel value

Definition at line 267 of file Pixel.cpp.

◆ To32Bit() [2/2]

float Isis::Pixel::To32Bit ( const double  d)
staticinherited

Converts double pixels to float pixels with special pixel translations.

Parameters
dDouble pixel value to be converted to a double
Returns
float The float pixel value

Definition at line 248 of file Pixel.cpp.

◆ To8Bit() [1/2]

unsigned char Isis::Pixel::To8Bit ( )
inherited

Converts internal pixel value to an unsigned char pixel with special pixel translations.

Returns
unsigned char The unsigned char pixel value

Definition at line 140 of file Pixel.cpp.

◆ To8Bit() [2/2]

unsigned char Isis::Pixel::To8Bit ( const double  d)
staticinherited

Converts double pixels to unsigned char pixels with special pixel translations.

Parameters
dDouble pixel value to be converted to a double
Returns
unsigned char The unsigned char pixel value

Definition at line 111 of file Pixel.cpp.

◆ ToDouble() [1/5]

double Isis::Pixel::ToDouble ( )
inherited

Converts stored pixel value to a double.

Returns
double The double pixel value

Definition at line 359 of file Pixel.cpp.

◆ ToDouble() [2/5]

double Isis::Pixel::ToDouble ( const float  d)
staticinherited

Converts float pixels to double pixels with special pixel translations.

Parameters
dFloat pixel value to be converted to a double
Returns
double The double pixel value

Definition at line 340 of file Pixel.cpp.

◆ ToDouble() [3/5]

double Isis::Pixel::ToDouble ( const short int  d)
staticinherited

Converts short int pixels to double pixels with special pixel translations.

Parameters
dShort int pixel value to be converted to a double
Returns
double The double pixel value

Definition at line 301 of file Pixel.cpp.

◆ ToDouble() [4/5]

double Isis::Pixel::ToDouble ( const short unsigned int  d)
staticinherited

Converts short unsigned int pixels to double pixels with special pixel translations.

Parameters
dShort unsigned int pixel value to be converted to a double
Returns
double The double pixel value

Definition at line 320 of file Pixel.cpp.

◆ ToDouble() [5/5]

double Isis::Pixel::ToDouble ( const unsigned char  d)
staticinherited

Converts unsigned char pixels to double pixels with special pixel translations.

Parameters
dUnsigned char pixel value to be converted to a double
Returns
double The double pixel value

Definition at line 280 of file Pixel.cpp.

◆ ToFloat() [1/5]

float Isis::Pixel::ToFloat ( )
inherited

Converts internal pixel value to float with pixel translations and care for overflows (underflows are assumed to cast to 0!)

Returns
float The float pixel value

Definition at line 457 of file Pixel.cpp.

◆ ToFloat() [2/5]

float Isis::Pixel::ToFloat ( const double  t)
staticinherited

Converts double to float with pixel translations and care for overflows (underflows are assumed to cast to 0!)

Parameters
tDouble pixel value to be converted to a float
Returns
float The float pixel value

Definition at line 437 of file Pixel.cpp.

◆ ToFloat() [3/5]

float Isis::Pixel::ToFloat ( const short int  t)
staticinherited

Converts short int to float with pixel translations and care for overflows (underflows are assumed to cast to 0!)

Parameters
tShort int pixel value to be converted to a float
Returns
float The float pixel value

Definition at line 395 of file Pixel.cpp.

◆ ToFloat() [4/5]

float Isis::Pixel::ToFloat ( const short unsigned int  t)
staticinherited

Converts short unsigned int to float with pixel translations and care for overflows (underflows are assumed to cast to 0!)

Parameters
tShort unsigned int pixel value to be converted to a float
Returns
float The float pixel value

Definition at line 416 of file Pixel.cpp.

◆ ToFloat() [5/5]

float Isis::Pixel::ToFloat ( const unsigned char  t)
staticinherited

Converts unsigned char to float with pixel translations and care for overflows (underflows are assumed to cast to 0!)

Parameters
tUnsigned char pixel value to be converted to a float
Returns
float The float pixel value

Definition at line 374 of file Pixel.cpp.

◆ ToString() [1/2]

string Isis::Pixel::ToString ( )
inherited

Returns the name of the pixel type as a string.

Returns
string The name of the pixel type

Definition at line 488 of file Pixel.cpp.

References Isis::ToString().

◆ ToString() [2/2]

string Isis::Pixel::ToString ( double  d)
staticinherited

Takes a double pixel value and returns the name of the pixel type as a string.

Parameters
dPixel value
Returns
string The name of the pixel type

Definition at line 469 of file Pixel.cpp.

References Isis::IsSpecial().

Member Data Documentation

◆ m_band

int Isis::Pixel::m_band
privateinherited

band coordinate of pixel

Definition at line 292 of file Pixel.h.

◆ m_center

double Isis::Spectel::m_center
private

Center wavelength associated with pixel.

Definition at line 41 of file Spectel.h.

Referenced by centerWavelength(), operator=(), and Spectel().

◆ m_DN

◆ m_line

int Isis::Pixel::m_line
privateinherited

line coordinate of pixel

Definition at line 286 of file Pixel.h.

◆ m_sample

int Isis::Pixel::m_sample
privateinherited

sample coordinate of pixel

Definition at line 289 of file Pixel.h.

◆ m_width

double Isis::Spectel::m_width
private

Wavelength width (FWHM) associated with pixel.

Definition at line 43 of file Spectel.h.

Referenced by filterWidth(), operator=(), and Spectel().


The documentation for this class was generated from the following files: