Isis Developer Reference
Isis::ObservationNumberList Class Reference

Create a list of observation numbers from a file or serial number list. More...

#include <ObservationNumberList.h>

Inheritance diagram for Isis::ObservationNumberList:
Inheritance graph
Collaboration diagram for Isis::ObservationNumberList:
Collaboration graph

Public Member Functions

 ObservationNumberList (const QString &list, bool checkTarget=true)
 Creates an ObservationNumberList from a filename.
 
 ObservationNumberList (SerialNumberList *snlist)
 Creates an ObservationNumberList from a SerialNumberList.
 
 ~ObservationNumberList ()
 Destructor.
 
void add (int isn, const int observationIndex, QString observationNumber)
 Adds a new serial number index / observation number index / observation number to the SerialNumberList.
 
int observationSize () const
 How many unique observations are in the list?
 
int observationNumberMapIndex (const int serialNumberIndex)
 Return a observation index given a serial number index.
 
void remove (SerialNumberList *snlist)
 Removes all of the listed serial numbers from the observation.
 
void remove (const QString &listfile)
 Removes all of the listed serial numbers from the observation.
 
bool hasObservationNumber (const QString &on)
 Determines whether or not the requested observation number exists in the list.
 
QString observationNumber (const QString &filename)
 Return an observation number given a filename.
 
QString observationNumber (int index)
 Return a observation number given an index.
 
std::vector< QString > possibleFileNames (const QString &on)
 Return possible filenames given an observation number.
 
void add (const QString &filename, bool def2filename=false)
 Adds a new filename / serial number pair to the SerialNumberList.
 
void add (const QString &serialNumber, const QString &filename)
 Adds a new filename / and pre-composed serial number pair to the SerialNumberList.
 
void add (const char *serialNumber, const char *filename)
 Overloaded add method that takes char * parameters.
 
bool hasSerialNumber (QString sn)
 Determines whether or not the requested serial number exists in the list.
 
int size () const
 How many serial number / filename combos are in the list.
 
QString fileName (const QString &sn)
 Return a filename given a serial number.
 
QString fileName (int index)
 Return the filename at the given index.
 
QString serialNumber (const QString &filename)
 Return a serial number given a filename.
 
QString serialNumber (int index)
 Return a serial number given an index.
 
QString spacecraftInstrumentId (int index)
 Return the spacecraftname/instrumentid at the given index.
 
QString spacecraftInstrumentId (const QString &sn)
 Return the spacecraftname/instrumentid given a serial number.
 
int serialNumberIndex (const QString &sn)
 Return a list index given a serial number.
 
int fileNameIndex (const QString &filename)
 Return a list index given a filename.
 
std::vector< QString > possibleSerialNumbers (const QString &on)
 Return possible serial numbers given an observation number.
 

Protected Attributes

std::vector< Pairm_pairs
 List of serial number Pair entities.
 
std::map< QString, int > m_serialMap
 Maps serial numbers to their positions in the list.
 
std::map< QString, int > m_fileMap
 Maps filenames to their positions in the list.
 
bool m_checkTarget
 Specifies whether or not to check to make sure the target names match between files added to the serialnumber list.
 
QString m_target
 Target name that the files must have if m_checkTarget is true

 

Detailed Description

Create a list of observation numbers from a file or serial number list.

This class allows for creating observation numbers from a provided file or and existing non-empty SerialNumberList. Internally, it will map the observation numbers that are created to the corresponding serial number for a given observation.

Author
2007-09-17 Debbie A. Cook

Constructor & Destructor Documentation

◆ ObservationNumberList() [1/2]

Isis::ObservationNumberList::ObservationNumberList ( const QString & listfile,
bool checkTarget = true )

Creates an ObservationNumberList from a filename.

Parameters
listfileThe list of files to be given observation numbers
checkTargetBoolean value that specifies whether or not to check to make sure the target names match between files added to the observationnumber list

◆ ObservationNumberList() [2/2]

Isis::ObservationNumberList::ObservationNumberList ( SerialNumberList * snlist)

Creates an ObservationNumberList from a SerialNumberList.

Parameters
snlistThe serial number list from which to generate an observation number list

◆ ~ObservationNumberList()

Isis::ObservationNumberList::~ObservationNumberList ( )

Destructor.

Member Function Documentation

◆ add() [1/4]

void Isis::SerialNumberList::add ( const char * serialNumber,
const char * filename )
inherited

Overloaded add method that takes char * parameters.

Adds a new filename / serial number pair to the SerialNumberList

Parameters
serialNumberThe serial number to be added
filenameThe filename to be added
See also
add(QString, QString)

References Isis::SerialNumberList::add(), and Isis::SerialNumberList::serialNumber().

◆ add() [2/4]

void Isis::SerialNumberList::add ( const QString & filename,
bool def2filename = false )
inherited

Adds a new filename / serial number pair to the SerialNumberList.

Parameters
filenameThe filename to be added
def2filenameIf a serial number could not be found, try to return the filename
Exceptions
IException::User"Unable to find Instrument or Mapping group for comparing target."
IException::User"Unable to find Instrument group for comparing target."
IException::User"Target name from file does not match."
IException::User"Invalid serial number [Unknown] from file."
IException::User"Duplicate serial number from files [file1] and [file2]."
IException::User"FileName cannot be added to serial number list."

References _FILEINFO_, Isis::ObservationNumber::Compose(), Isis::SerialNumber::Compose(), Isis::FileName::expanded(), Isis::SerialNumberList::fileName(), Isis::SerialNumberList::Pair::filename, Isis::PvlObject::findObject(), Isis::SerialNumberList::hasSerialNumber(), Isis::SerialNumberList::m_checkTarget, Isis::SerialNumberList::m_fileMap, Isis::SerialNumberList::m_pairs, Isis::SerialNumberList::m_serialMap, Isis::SerialNumberList::m_target, Isis::SerialNumberList::serialNumberIndex(), and Isis::IException::User.

Referenced by Isis::SerialNumberList::add(), Isis::ControlNetGraphicsItem::buildChildren(), Isis::BundleAdjust::BundleAdjust(), Isis::ImageList::serialNumberList(), Isis::ShapeList::serialNumberList(), and Isis::SerialNumberList::SerialNumberList().

◆ add() [3/4]

void Isis::SerialNumberList::add ( const QString & serialNumber,
const QString & filename )
inherited

Adds a new filename / and pre-composed serial number pair to the SerialNumberList.

Parameters
serialNumberthe serial number to be added
filenamethe filename to be added
Exceptions
IException::User"Unable to find Instrument or Mapping group for comparing target."
IException::User"Target name from file does not match."
IException::User"Invalid serial number [Unknown] from file."
IException::User"Duplicate serial number from files [file1] and [file2]."
IException::User"Unable to find Instrument group need for performing bundle adjustment."
IException::User"Unable to find Spacecraftname or InstrumentId keywords needed for performing bundle adjustment."
IException::User"[SerialNumber, FileName] can not be added to serial number list."
Author
2012-07-12 Tracie Sucharski

References _FILEINFO_, Isis::FileName::expanded(), Isis::SerialNumberList::fileName(), Isis::SerialNumberList::Pair::filename, Isis::PvlObject::findObject(), Isis::SerialNumberList::hasSerialNumber(), Isis::SerialNumberList::m_checkTarget, Isis::SerialNumberList::m_fileMap, Isis::SerialNumberList::m_pairs, Isis::SerialNumberList::m_serialMap, Isis::SerialNumberList::m_target, Isis::SerialNumberList::observationNumber(), Isis::SerialNumberList::serialNumber(), Isis::SerialNumberList::serialNumberIndex(), and Isis::IException::User.

◆ add() [4/4]

void Isis::ObservationNumberList::add ( int isn,
const int observationIndex,
QString observationNumber )

Adds a new serial number index / observation number index / observation number to the SerialNumberList.

Parameters
isnThe serial number index of the observation set to be added
observationIndexThe observation number index of the observation set to be added
observationNumberThe observation number of the observation set to be added

References observationNumber().

Referenced by remove().

◆ fileName() [1/2]

QString Isis::SerialNumberList::fileName ( const QString & sn)
inherited

Return a filename given a serial number.

Parameters
snThe serial number of the desired filename
Exceptions
IException::Programmer"Unable to get the FileName. The given serial number does not exist in the list."
Returns
QString The filename matching the input serial number

References _FILEINFO_, Isis::SerialNumberList::hasSerialNumber(), Isis::SerialNumberList::m_pairs, Isis::SerialNumberList::m_serialMap, and Isis::IException::Programmer.

Referenced by Isis::SerialNumberList::add(), Isis::SerialNumberList::add(), Isis::SerialNumber::ComposeObservation(), Isis::ControlPointEditWidget::createControlPoint(), Isis::QnetTool::createFixedPoint(), Isis::QnetTool::createPoint(), Isis::ControlNetFilter::CubeConvexHullFilter(), Isis::ControlNetFilter::CubeDistanceFilter(), Isis::ControlNetFilter::CubeNameExpressionFilter(), Isis::ControlNetFilter::CubeNumPointsFilter(), Isis::ControlPointEditWidget::deletePoint(), Isis::MatchTool::deletePoint(), Isis::QnetTool::deletePoint(), Isis::BundleAdjust::fileName(), Isis::QnetCubeNameFilter::filter(), Isis::InterestOperator::FindCnetRef(), Isis::InterestOperator::FindOverlapByImageFootPrint(), Isis::ControlNetStatistics::GenerateImageStats(), Isis::BundleAdjust::imageLists(), Isis::InterestOperator::InterestByMeasure(), Isis::InterestOperator::InterestByPoint(), Isis::QnetFileTool::loadImage(), Isis::ControlNetFilter::PointCubeNamesFilter(), Isis::ControlNetFilter::PointDistanceFilter(), Isis::ControlNetFilter::PointLatLonFilter(), Isis::ControlNetFilter::PointMeasurePropertiesFilter(), Isis::ControlNetFilter::PrintCubeFileSerialNum(), Isis::ControlNetStatistics::PrintImageStats(), Isis::InterestOperator::ProcessLocked_Point_Reference(), Isis::SerialNumberList::remove(), Isis::NewControlPointDialog::setFiles(), Isis::QnetFixedPointDialog::setFiles(), Isis::LidarData::SetImages(), Isis::ControlNet::SetImages(), Isis::ChipViewportsWidget::setPoint(), and Isis::ControlNetGraphicsItem::snToFileName().

◆ fileName() [2/2]

QString Isis::SerialNumberList::fileName ( int index)
inherited

Return the filename at the given index.

Parameters
indexThe index of the desired filename
Exceptions
IException::Programmer"Unable to get the FileName. The given index is invalid."
Returns
QString The filename at the given index

References _FILEINFO_, Isis::SerialNumberList::m_pairs, Isis::IException::Programmer, and Isis::toString().

◆ fileNameIndex()

int Isis::SerialNumberList::fileNameIndex ( const QString & filename)
inherited

Return a list index given a filename.

Parameters
filenameThe filename to be searched for
Exceptions
IException::Programmer"Unable to get the FileName index. The given file name does not exist in the list."
Returns
int The index of the input filename

References _FILEINFO_, Isis::FileName::expanded(), Isis::SerialNumberList::m_fileMap, and Isis::IException::Programmer.

Referenced by Isis::ControlPointEditWidget::createControlPoint(), Isis::QnetTool::createFixedPoint(), Isis::QnetTool::createPoint(), observationNumber(), and Isis::SerialNumberList::serialNumber().

◆ hasObservationNumber()

bool Isis::ObservationNumberList::hasObservationNumber ( const QString & on)

Determines whether or not the requested observation number exists in the list.

Parameters
onThe observation number to be checked for
Returns
bool

References Isis::SerialNumberList::m_pairs, and observationNumber().

◆ hasSerialNumber()

bool Isis::SerialNumberList::hasSerialNumber ( QString sn)
inherited

◆ observationNumber() [1/2]

QString Isis::ObservationNumberList::observationNumber ( const QString & filename)

Return an observation number given a filename.

Parameters
filenameThe filename to be matched
Exceptions
IException::Programmer"Requested filename does not exist in the list"
Returns
QString The observation number corresponding to the input filename

References _FILEINFO_, Isis::FileName::expanded(), Isis::SerialNumberList::fileNameIndex(), Isis::SerialNumberList::m_fileMap, Isis::SerialNumberList::m_pairs, and Isis::IException::Programmer.

Referenced by add(), hasObservationNumber(), possibleFileNames(), and remove().

◆ observationNumber() [2/2]

QString Isis::ObservationNumberList::observationNumber ( int index)

Return a observation number given an index.

Parameters
indexThe index of the desired observation number
Exceptions
IException::Programmer"Index is invalid"
Returns
QString The observation number returned

References _FILEINFO_, Isis::SerialNumberList::m_pairs, Isis::IException::Programmer, and Isis::toString().

◆ observationNumberMapIndex()

int Isis::ObservationNumberList::observationNumberMapIndex ( const int serialNumberIndex)

Return a observation index given a serial number index.

Parameters
serialNumberIndexThe index of the serial number to map
Exceptions
IException::Programmer"Serial Number Index is invalid"
Returns
int The observation index mapped to the serial number

References _FILEINFO_, Isis::IException::Programmer, Isis::SerialNumberList::serialNumberIndex(), and Isis::toString().

◆ observationSize()

int Isis::ObservationNumberList::observationSize ( ) const

How many unique observations are in the list?

Returns
int Returns number of unique observations currently in the list

◆ possibleFileNames()

vector< QString > Isis::ObservationNumberList::possibleFileNames ( const QString & on)

Return possible filenames given an observation number.

Parameters
onThe observation number of the desired filename
Exceptions
IException::Programmer"Requested observation number does not exist in the list"
Returns
vector<QString> The list of possible filenames matching the input observation number

References _FILEINFO_, Isis::SerialNumberList::m_pairs, observationNumber(), and Isis::IException::Programmer.

◆ possibleSerialNumbers()

std::vector< QString > Isis::SerialNumberList::possibleSerialNumbers ( const QString & on)
inherited

Return possible serial numbers given an observation number.

Parameters
onThe observation number of the possible serial number
Exceptions
IException::Programmer"Unable to get the possible serial numbers. The given observation number does not exist in the list."
Returns
vector<QString> The list of possible serial numbers matching the input observation number

References _FILEINFO_, Isis::SerialNumberList::m_pairs, Isis::SerialNumberList::observationNumber(), Isis::IException::Programmer, and Isis::SerialNumberList::serialNumber().

◆ remove() [1/2]

void Isis::ObservationNumberList::remove ( const QString & listfile)

Removes all of the listed serial numbers from the observation.

Parameters
listfileThe list of SerialNumbers to remove

References remove().

◆ remove() [2/2]

void Isis::ObservationNumberList::remove ( SerialNumberList * snlist)

Removes all of the listed serial numbers from the observation.

Parameters
snlistThe list of SerialNumbers to remove
Exceptions
IException::User"Cannot remove, serial number list is empty"

References _FILEINFO_, add(), observationNumber(), Isis::SerialNumberList::size(), and Isis::IException::User.

Referenced by remove().

◆ serialNumber() [1/2]

◆ serialNumber() [2/2]

QString Isis::SerialNumberList::serialNumber ( int index)
inherited

Return a serial number given an index.

Parameters
indexThe index of the desired serial number
Exceptions
IException::Programmer"Unable to get the SerialNumber. The given index is invalid."
Returns
QString The serial number returned

References _FILEINFO_, Isis::SerialNumberList::m_pairs, Isis::IException::Programmer, and Isis::toString().

◆ serialNumberIndex()

int Isis::SerialNumberList::serialNumberIndex ( const QString & sn)
inherited

Return a list index given a serial number.

Parameters
snThe serial number searched for
Exceptions
IException::Programmer"Unable to get the SerialNumber index. The given serial number does not exist in the list."
Returns
int The index of the serial number

References _FILEINFO_, Isis::SerialNumberList::hasSerialNumber(), Isis::SerialNumberList::m_serialMap, and Isis::IException::Programmer.

Referenced by Isis::SerialNumberList::add(), Isis::SerialNumberList::add(), Isis::QnetPointDistanceFilter::filter(), observationNumberMapIndex(), and Isis::SerialNumberList::remove().

◆ size()

◆ spacecraftInstrumentId() [1/2]

QString Isis::SerialNumberList::spacecraftInstrumentId ( const QString & sn)
inherited

Return the spacecraftname/instrumentid given a serial number.

Parameters
snThe serial number of the desired spacecraftname/instrumentid
Exceptions
IException::Programmer"Unable to get the Spacecraft InstrumentId. The given serial number does not exist in the list."
Returns
QString The spacecraftname/instrumentid matching the input serial number

References _FILEINFO_, Isis::SerialNumberList::hasSerialNumber(), Isis::SerialNumberList::m_pairs, Isis::SerialNumberList::m_serialMap, and Isis::IException::Programmer.

◆ spacecraftInstrumentId() [2/2]

QString Isis::SerialNumberList::spacecraftInstrumentId ( int index)
inherited

Return the spacecraftname/instrumentid at the given index.

Parameters
indexThe index of the desired spacecraftname/instrumentid
Exceptions
IException::Programmer"Unable to get the Spacecraft InstrumentId. The given index is invalid."
Returns
QString The spacecraftname/instrumentid at the given index

References _FILEINFO_, Isis::SerialNumberList::m_pairs, Isis::IException::Programmer, and Isis::toString().

Member Data Documentation

◆ m_checkTarget

bool Isis::SerialNumberList::m_checkTarget
protectedinherited

Specifies whether or not to check to make sure the target names match between files added to the serialnumber list.

Referenced by Isis::SerialNumberList::add(), Isis::SerialNumberList::add(), Isis::SerialNumberList::SerialNumberList(), and Isis::SerialNumberList::SerialNumberList().

◆ m_fileMap

std::map<QString, int> Isis::SerialNumberList::m_fileMap
protectedinherited

◆ m_pairs

◆ m_serialMap

◆ m_target

QString Isis::SerialNumberList::m_target
protectedinherited

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