Isis 3 Developer Reference
|
Create a list of observation numbers from a file or serial number list. More...
#include <ObservationNumberList.h>
Public Member Functions | |
ObservationNumberList (const QString &list, bool checkTarget=true) | |
Creates an ObservationNumberList from a filename. More... | |
ObservationNumberList (SerialNumberList *snlist) | |
Creates an ObservationNumberList from a SerialNumberList. More... | |
~ObservationNumberList () | |
Destructor. More... | |
void | add (int isn, const int observationIndex, QString observationNumber) |
Adds a new serial number index / observation number index / observation number to the SerialNumberList. More... | |
int | observationSize () const |
How many unique observations are in the list? More... | |
int | observationNumberMapIndex (const int serialNumberIndex) |
Return a observation index given a serial number index. More... | |
void | remove (SerialNumberList *snlist) |
Removes all of the listed serial numbers from the observation. More... | |
void | remove (const QString &listfile) |
Removes all of the listed serial numbers from the observation. More... | |
bool | hasObservationNumber (const QString &on) |
Determines whether or not the requested observation number exists in the list. More... | |
QString | observationNumber (const QString &filename) |
Return an observation number given a filename. More... | |
QString | observationNumber (int index) |
Return a observation number given an index. More... | |
std::vector< QString > | possibleFileNames (const QString &on) |
Return possible filenames given an observation number. More... | |
void | add (const QString &filename, bool def2filename=false) |
Adds a new filename / serial number pair to the SerialNumberList. More... | |
void | add (const QString &serialNumber, const QString &filename) |
Adds a new filename / and pre-composed serial number pair to the SerialNumberList. More... | |
void | add (const char *serialNumber, const char *filename) |
Overloaded add method that takes char * parameters. More... | |
bool | hasSerialNumber (QString sn) |
Determines whether or not the requested serial number exists in the list. More... | |
int | size () const |
How many serial number / filename combos are in the list. More... | |
QString | fileName (const QString &sn) |
Return a filename given a serial number. More... | |
QString | fileName (int index) |
Return the filename at the given index. More... | |
QString | serialNumber (const QString &filename) |
Return a serial number given a filename. More... | |
QString | serialNumber (int index) |
Return a serial number given an index. More... | |
QString | spacecraftInstrumentId (int index) |
Return the spacecraftname/instrumentid at the given index. More... | |
QString | spacecraftInstrumentId (const QString &sn) |
Return the spacecraftname/instrumentid given a serial number. More... | |
int | serialNumberIndex (const QString &sn) |
Return a list index given a serial number. More... | |
int | fileNameIndex (const QString &filename) |
Return a list index given a filename. More... | |
std::vector< QString > | possibleSerialNumbers (const QString &on) |
Return possible serial numbers given an observation number. More... | |
Protected Attributes | |
std::vector< Pair > | m_pairs |
List of serial number Pair entities. More... | |
std::map< QString, int > | m_serialMap |
Maps serial numbers to their positions in the list. More... | |
std::map< QString, int > | m_fileMap |
Maps filenames to their positions in the list. More... | |
bool | m_checkTarget |
Specifies whether or not to check to make sure the target names match between files added to the serialnumber list. More... | |
QString | m_target |
Target name that the files must have if m_checkTarget is true. More... | |
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.
Isis::ObservationNumberList::ObservationNumberList | ( | const QString & | listfile, |
bool | checkTarget = true |
||
) |
Creates an ObservationNumberList from a filename.
listfile | The list of files to be given observation numbers |
checkTarget | Boolean value that specifies whether or not to check to make sure the target names match between files added to the observationnumber list |
Isis::ObservationNumberList::ObservationNumberList | ( | SerialNumberList * | snlist | ) |
Creates an ObservationNumberList from a SerialNumberList.
snlist | The serial number list from which to generate an observation number list |
Isis::ObservationNumberList::~ObservationNumberList | ( | ) |
Destructor.
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.
isn | The serial number index of the observation set to be added |
observationIndex | The observation number index of the observation set to be added |
observationNumber | The observation number of the observation set to be added |
References observationNumber().
Referenced by remove().
|
inherited |
Adds a new filename / serial number pair to the SerialNumberList.
filename | The filename to be added |
def2filename | If a serial number could not be found, try to return the filename |
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::findGroup(), Isis::PvlObject::findObject(), Isis::PvlObject::hasGroup(), Isis::PvlContainer::hasKeyword(), Isis::SerialNumberList::hasSerialNumber(), Isis::SerialNumberList::Pair::instrumentId, Isis::SerialNumberList::m_checkTarget, Isis::SerialNumberList::m_fileMap, Isis::SerialNumberList::m_pairs, Isis::SerialNumberList::m_serialMap, Isis::SerialNumberList::m_target, Isis::SerialNumberList::Pair::observationNumber, Isis::SerialNumberList::Pair::serialNumber, Isis::SerialNumberList::serialNumberIndex(), Isis::SerialNumberList::Pair::spacecraftName, and Isis::IException::User.
Referenced by Isis::SerialNumberList::add(), Isis::ControlNetGraphicsItem::buildChildren(), Isis::BundleAdjust::BundleAdjust(), Isis::ShapeList::serialNumberList(), Isis::ImageList::serialNumberList(), and Isis::SerialNumberList::SerialNumberList().
|
inherited |
Adds a new filename / and pre-composed serial number pair to the SerialNumberList.
serialNumber | the serial number to be added |
filename | the filename to be added |
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." |
References _FILEINFO_, Isis::FileName::expanded(), Isis::SerialNumberList::fileName(), Isis::SerialNumberList::Pair::filename, Isis::PvlObject::findGroup(), Isis::PvlObject::findObject(), Isis::PvlObject::hasGroup(), Isis::PvlContainer::hasKeyword(), Isis::SerialNumberList::hasSerialNumber(), Isis::SerialNumberList::Pair::instrumentId, 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::Pair::observationNumber, Isis::SerialNumberList::serialNumber(), Isis::SerialNumberList::Pair::serialNumber, Isis::SerialNumberList::serialNumberIndex(), Isis::SerialNumberList::Pair::spacecraftName, and Isis::IException::User.
|
inherited |
Overloaded add method that takes char * parameters.
Adds a new filename / serial number pair to the SerialNumberList
serialNumber | The serial number to be added |
filename | The filename to be added |
References Isis::SerialNumberList::add(), and Isis::SerialNumberList::serialNumber().
|
inherited |
Return a filename given a serial number.
sn | The serial number of the desired filename |
IException::Programmer | "Unable to get the FileName. The given serial number does not exist in the list." |
References _FILEINFO_, Isis::SerialNumberList::hasSerialNumber(), Isis::SerialNumberList::m_pairs, Isis::SerialNumberList::m_serialMap, and Isis::IException::Programmer.
Referenced by Isis::SerialNumberList::add(), Isis::SerialNumber::ComposeObservation(), Isis::ControlPointEditWidget::createControlPoint(), Isis::QnetPointCubeNameFilter::createCubeList(), 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::QnetCubeNameFilter::filter(), Isis::InterestOperator::FindCnetRef(), Isis::ImageOverlapSet::FindImageOverlaps(), Isis::ControlNetStatistics::GenerateImageStats(), 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::QnetNewMeasureDialog::setFiles(), Isis::QnetFixedPointDialog::setFiles(), Isis::NewControlPointDialog::setFiles(), Isis::ControlNet::SetImages(), Isis::ChipViewportsWidget::setPoint(), and Isis::ControlNetGraphicsItem::snToFileName().
|
inherited |
Return the filename at the given index.
index | The index of the desired filename |
IException::Programmer | "Unable to get the FileName. The given index is invalid." |
References _FILEINFO_, Isis::SerialNumberList::m_pairs, Isis::IException::Programmer, and Isis::toString().
|
inherited |
Return a list index given a filename.
filename | The filename to be searched for |
IException::Programmer | "Unable to get the FileName index. The given file name does not exist in the list." |
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().
bool Isis::ObservationNumberList::hasObservationNumber | ( | const QString & | on | ) |
Determines whether or not the requested observation number exists in the list.
on | The observation number to be checked for |
References Isis::SerialNumberList::m_pairs, and observationNumber().
|
inherited |
Determines whether or not the requested serial number exists in the list.
sn | The serial number to be checked for |
References Isis::SerialNumberList::m_serialMap.
Referenced by Isis::SerialNumberList::add(), Isis::MatchTool::deletePoint(), Isis::SerialNumberList::fileName(), remove(), Isis::SerialNumberList::serialNumberIndex(), Isis::ControlNet::SetImages(), and Isis::SerialNumberList::spacecraftInstrumentId().
QString Isis::ObservationNumberList::observationNumber | ( | const QString & | filename | ) |
Return an observation number given a filename.
filename | The filename to be matched |
IException::Programmer | "Requested filename does not exist in the list" |
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().
QString Isis::ObservationNumberList::observationNumber | ( | int | index | ) |
Return a observation number given an index.
index | The index of the desired observation number |
IException::Programmer | "Index is invalid" |
References _FILEINFO_, Isis::SerialNumberList::m_pairs, Isis::IException::Programmer, and Isis::toString().
int Isis::ObservationNumberList::observationNumberMapIndex | ( | const int | serialNumberIndex | ) |
Return a observation index given a serial number index.
serialNumberIndex | The index of the serial number to map |
IException::Programmer | "Serial Number Index is invalid" |
References _FILEINFO_, Isis::IException::Programmer, Isis::SerialNumberList::serialNumberIndex(), and Isis::toString().
int Isis::ObservationNumberList::observationSize | ( | ) | const |
How many unique observations are in the list?
vector< QString > Isis::ObservationNumberList::possibleFileNames | ( | const QString & | on | ) |
Return possible filenames given an observation number.
on | The observation number of the desired filename |
IException::Programmer | "Requested observation number does not exist in the list" |
References _FILEINFO_, Isis::SerialNumberList::m_pairs, observationNumber(), and Isis::IException::Programmer.
|
inherited |
Return possible serial numbers given an observation number.
on | The observation number of the possible serial number |
IException::Programmer | "Unable to get the possible serial numbers. The given observation number does not exist in the list." |
References _FILEINFO_, Isis::SerialNumberList::m_pairs, Isis::SerialNumberList::observationNumber(), Isis::IException::Programmer, and Isis::SerialNumberList::serialNumber().
void Isis::ObservationNumberList::remove | ( | SerialNumberList * | snlist | ) |
Removes all of the listed serial numbers from the observation.
snlist | The list of SerialNumbers to remove |
IException::User | "Cannot remove, serial number list is empty" |
References _FILEINFO_, add(), Isis::SerialNumberList::hasSerialNumber(), observationNumber(), Isis::SerialNumberList::size(), and Isis::IException::User.
void Isis::ObservationNumberList::remove | ( | const QString & | listfile | ) |
Removes all of the listed serial numbers from the observation.
listfile | The list of SerialNumbers to remove |
|
inherited |
Return a serial number given a filename.
filename | The filename to be matched |
IException::Programmer | "Unable to get the SerialNumber. The given file name does not exist in the list." |
References _FILEINFO_, Isis::FileName::expanded(), Isis::SerialNumberList::fileNameIndex(), Isis::SerialNumberList::m_fileMap, Isis::SerialNumberList::m_pairs, and Isis::IException::Programmer.
Referenced by Isis::SerialNumberList::add(), Isis::ControlPointEditWidget::createControlPoint(), Isis::QnetTool::createFixedPoint(), Isis::QnetTool::createPoint(), Isis::ControlNetFilter::CubeConvexHullFilter(), Isis::ControlNetFilter::CubeDistanceFilter(), Isis::ControlNetFilter::CubeNameExpressionFilter(), Isis::ControlNetFilter::CubeNumPointsFilter(), Isis::QnetCubeDistanceFilter::filter(), Isis::QnetPointCubeNameFilter::filter(), Isis::ImageOverlapSet::FindImageOverlaps(), Isis::MatchTool::mouseButtonRelease(), Isis::QnetTool::mouseButtonRelease(), Isis::ObservationNumber::PossibleSerial(), Isis::SerialNumberList::possibleSerialNumbers(), Isis::StereoTool::rubberBandComplete(), Isis::QnetNewMeasureDialog::setFiles(), and Isis::ControlNet::SetImages().
|
inherited |
Return a serial number given an index.
index | The index of the desired serial number |
IException::Programmer | "Unable to get the SerialNumber. The given index is invalid." |
References _FILEINFO_, Isis::SerialNumberList::m_pairs, Isis::IException::Programmer, and Isis::toString().
|
inherited |
Return a list index given a serial number.
sn | The serial number searched for |
IException::Programmer | "Unable to get the SerialNumber index. The given serial number does not exist in the list." |
References _FILEINFO_, Isis::SerialNumberList::hasSerialNumber(), Isis::SerialNumberList::m_serialMap, and Isis::IException::Programmer.
Referenced by Isis::SerialNumberList::add(), Isis::QnetPointDistanceFilter::filter(), observationNumberMapIndex(), and Isis::SerialNumberList::remove().
|
inherited |
How many serial number / filename combos are in the list.
References Isis::SerialNumberList::m_pairs.
Referenced by Isis::ControlPointEditWidget::createControlPoint(), Isis::QnetPointCubeNameFilter::createCubeList(), Isis::QnetTool::createFixedPoint(), Isis::QnetTool::createPoint(), Isis::ControlNetFilter::CubeConvexHullFilter(), Isis::ControlNetFilter::CubeDistanceFilter(), Isis::ControlNetFilter::CubeNameExpressionFilter(), Isis::ControlNetFilter::CubeNumPointsFilter(), Isis::ImageOverlapSet::FindAllOverlaps(), Isis::ImageOverlapSet::FindImageOverlaps(), Isis::ControlNetStatistics::GenerateControlNetStats(), Isis::BundleAdjust::numberOfImages(), Isis::ObservationNumber::PossibleSerial(), Isis::ControlNetStatistics::PrintImageStats(), remove(), Isis::QnetNavTool::resetList(), Isis::QnetNewMeasureDialog::setFiles(), Isis::QnetFixedPointDialog::setFiles(), Isis::NewControlPointDialog::setFiles(), Isis::ControlNet::SetImages(), and Isis::ControlNetGraphicsItem::snToFileName().
|
inherited |
Return the spacecraftname/instrumentid at the given index.
index | The index of the desired spacecraftname/instrumentid |
IException::Programmer | "Unable to get the Spacecraft InstrumentId. The given index is invalid." |
References _FILEINFO_, Isis::SerialNumberList::m_pairs, Isis::IException::Programmer, and Isis::toString().
|
inherited |
Return the spacecraftname/instrumentid given a serial number.
sn | The serial number of the desired spacecraftname/instrumentid |
IException::Programmer | "Unable to get the Spacecraft InstrumentId. The given serial number does not exist in the list." |
References _FILEINFO_, Isis::SerialNumberList::hasSerialNumber(), Isis::SerialNumberList::m_pairs, Isis::SerialNumberList::m_serialMap, and Isis::IException::Programmer.
|
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(), and Isis::SerialNumberList::SerialNumberList().
|
protectedinherited |
Maps filenames to their positions in the list.
Referenced by Isis::SerialNumberList::add(), Isis::SerialNumberList::fileNameIndex(), observationNumber(), Isis::SerialNumberList::remove(), and Isis::SerialNumberList::serialNumber().
|
protectedinherited |
List of serial number Pair entities.
Referenced by Isis::SerialNumberList::add(), Isis::SerialNumberList::fileName(), hasObservationNumber(), observationNumber(), Isis::SerialNumberList::observationNumber(), possibleFileNames(), Isis::SerialNumberList::possibleSerialNumbers(), Isis::SerialNumberList::remove(), Isis::SerialNumberList::serialNumber(), Isis::SerialNumberList::size(), and Isis::SerialNumberList::spacecraftInstrumentId().
|
protectedinherited |
Maps serial numbers to their positions in the list.
Referenced by Isis::SerialNumberList::add(), Isis::SerialNumberList::fileName(), Isis::SerialNumberList::hasSerialNumber(), Isis::SerialNumberList::remove(), Isis::SerialNumberList::serialNumberIndex(), and Isis::SerialNumberList::spacecraftInstrumentId().
|
protectedinherited |
Target name that the files must have if m_checkTarget is true.
Referenced by Isis::SerialNumberList::add(), and Isis::SerialNumberList::SerialNumberList().