Isis 3 Programmer Reference
|
Create a list of observation numbers from a file or serial number list. More...
#include <ObservationNumberList.h>
Classes | |
struct | ObservationSet |
An observation consiting of a serial number index to the ObservationNumberList, an observation number index to the ObservationNumberList, and the observation number. More... | |
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... | |
Private Member Functions | |
void | init (SerialNumberList *snlist) |
Initiates the ObservationNumberList. More... | |
Private Attributes | |
std::multimap< int, int > | m_indexMap |
Maps serial number index to observation number index. More... | |
int | m_numberObservations |
Count of observations in the observation number list. More... | |
std::vector< ObservationSet > | m_sets |
List of observation sets. 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.
Definition at line 43 of file ObservationNumberList.h.
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 |
Definition at line 26 of file ObservationNumberList.cpp.
References init().
Isis::ObservationNumberList::ObservationNumberList | ( | SerialNumberList * | snlist | ) |
Creates an ObservationNumberList from a SerialNumberList.
snlist | The serial number list from which to generate an observation number list |
Definition at line 37 of file ObservationNumberList.cpp.
References init().
Isis::ObservationNumberList::~ObservationNumberList | ( | ) |
Destructor.
Definition at line 84 of file ObservationNumberList.cpp.
|
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 |
Definition at line 227 of file SerialNumberList.cpp.
References Isis::SerialNumberList::add(), and Isis::SerialNumberList::serialNumber().
|
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." |
Definition at line 121 of file SerialNumberList.cpp.
References Isis::ObservationNumber::Compose(), Isis::SerialNumber::Compose(), Isis::FileName::expanded(), Isis::SerialNumberList::fileName(), Isis::PvlObject::findGroup(), Isis::PvlObject::findObject(), Isis::PvlObject::hasGroup(), Isis::PvlContainer::hasKeyword(), 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::QnetTool::openGround(), Isis::ImageList::serialNumberList(), Isis::MatchTool::serialNumberList(), Isis::ShapeList::serialNumberList(), Isis::SerialNumberList::SerialNumberList(), Isis::StereoTool::setFiles(), and Isis::ControlPointEditWidget::setGroundSourceInfo().
|
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." |
Definition at line 251 of file SerialNumberList.cpp.
References Isis::FileName::expanded(), Isis::SerialNumberList::fileName(), Isis::PvlObject::findGroup(), Isis::PvlObject::findObject(), Isis::PvlObject::hasGroup(), Isis::PvlContainer::hasKeyword(), 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.
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 |
Definition at line 154 of file ObservationNumberList.cpp.
References m_indexMap, m_sets, and observationNumber().
|
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." |
Definition at line 399 of file SerialNumberList.cpp.
References Isis::SerialNumberList::hasSerialNumber(), Isis::SerialNumberList::m_pairs, Isis::SerialNumberList::m_serialMap, and Isis::IException::Programmer.
Referenced by Isis::SerialNumberList::add(), Isis::QnetTool::addMeasure(), Isis::ControlPointEditWidget::checkReference(), Isis::QnetTool::checkReference(), 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::InterestOperator::FindOverlapByImageFootPrint(), Isis::ControlNetStatistics::GenerateImageStats(), Isis::ImageOverlapSet::HandleError(), Isis::InterestOperator::InterestByMeasure(), Isis::InterestOperator::InterestByPoint(), Isis::ControlPointEditWidget::loadGroundMeasure(), Isis::QnetTool::loadGroundMeasure(), Isis::QnetFileTool::loadImage(), Isis::MatchTool::loadMeasureTable(), Isis::QnetTool::loadMeasureTable(), Isis::MatchTool::loadPoint(), Isis::QnetTool::loadPoint(), Isis::ControlPointEditWidget::loadPoint(), Isis::ControlPointEditWidget::openReferenceRadius(), Isis::QnetTool::openReferenceRadius(), 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::ControlPointEditWidget::selectLeftMeasure(), Isis::MatchTool::selectLeftMeasure(), Isis::ControlPointEditWidget::selectRightMeasure(), Isis::MatchTool::selectRightMeasure(), Isis::MatchTool::serialNumberList(), Isis::QnetNewMeasureDialog::setFiles(), Isis::NewControlPointDialog::setFiles(), Isis::QnetFixedPointDialog::setFiles(), Isis::ControlNet::SetImages(), and Isis::ControlPointEditWidget::validateMeasureChange().
|
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." |
Definition at line 537 of file SerialNumberList.cpp.
References 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." |
Definition at line 517 of file SerialNumberList.cpp.
References Isis::FileName::expanded(), Isis::SerialNumberList::m_fileMap, and Isis::IException::Programmer.
Referenced by Isis::QnetTool::addMeasure(), 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 |
Definition at line 185 of file ObservationNumberList.cpp.
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 |
Definition at line 373 of file SerialNumberList.cpp.
References Isis::SerialNumberList::m_serialMap.
Referenced by Isis::SerialNumberList::add(), Isis::QnetTool::drawAllMeasurments(), Isis::SerialNumberList::fileName(), Isis::QnetTool::openGround(), remove(), Isis::SerialNumberList::serialNumberIndex(), Isis::MatchTool::serialNumberList(), Isis::StereoTool::setFiles(), Isis::ControlNet::SetImages(), and Isis::SerialNumberList::spacecraftInstrumentId().
|
private |
Initiates the ObservationNumberList.
snlist | The already created SerialNumberList used to create the ObservationNumberList object |
IException::User | "Serial numberList is empty" |
Definition at line 51 of file ObservationNumberList.cpp.
References add(), m_numberObservations, observationNumber(), Isis::SerialNumberList::observationNumber(), Isis::SerialNumberList::size(), and Isis::IException::User.
Referenced by ObservationNumberList().
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" |
Definition at line 226 of file ObservationNumberList.cpp.
References Isis::FileName::expanded(), Isis::SerialNumberList::fileNameIndex(), Isis::SerialNumberList::m_fileMap, Isis::SerialNumberList::m_pairs, and Isis::IException::Programmer.
Referenced by add(), hasObservationNumber(), init(), 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" |
Definition at line 246 of file ObservationNumberList.cpp.
References 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" |
Definition at line 204 of file ObservationNumberList.cpp.
References m_indexMap, Isis::IException::Programmer, Isis::SerialNumberList::serialNumberIndex(), and Isis::toString().
int Isis::ObservationNumberList::observationSize | ( | ) | const |
How many unique observations are in the list?
Definition at line 172 of file ObservationNumberList.cpp.
References m_numberObservations.
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" |
Definition at line 267 of file ObservationNumberList.cpp.
References 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." |
Definition at line 613 of file SerialNumberList.cpp.
References Isis::SerialNumberList::m_pairs, Isis::SerialNumberList::observationNumber(), Isis::IException::Programmer, and Isis::SerialNumberList::serialNumber().
void Isis::ObservationNumberList::remove | ( | const QString & | listfile | ) |
Removes all of the listed serial numbers from the observation.
listfile | The list of SerialNumbers to remove |
Definition at line 137 of file ObservationNumberList.cpp.
References remove().
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" |
Definition at line 95 of file ObservationNumberList.cpp.
References add(), Isis::SerialNumberList::hasSerialNumber(), m_indexMap, m_numberObservations, m_sets, observationNumber(), Isis::SerialNumberList::size(), and Isis::IException::User.
Referenced by 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." |
Definition at line 426 of file SerialNumberList.cpp.
References Isis::FileName::expanded(), Isis::SerialNumberList::fileNameIndex(), Isis::SerialNumberList::m_fileMap, Isis::SerialNumberList::m_pairs, and Isis::IException::Programmer.
Referenced by Isis::SerialNumberList::add(), Isis::QnetTool::addMeasure(), Isis::ControlMeasureEditWidget::blinkStartRight(), 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::ControlNetStatistics::InitSerialNumMap(), Isis::MatchTool::mouseButtonRelease(), Isis::QnetTool::mouseButtonRelease(), Isis::ObservationNumber::PossibleSerial(), Isis::SerialNumberList::possibleSerialNumbers(), Isis::ControlPointEditWidget::selectLeftMeasure(), Isis::MatchTool::selectLeftMeasure(), Isis::QnetTool::selectLeftMeasure(), Isis::ControlPointEditWidget::selectRightMeasure(), Isis::MatchTool::selectRightMeasure(), Isis::QnetTool::selectRightMeasure(), 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." |
Definition at line 446 of file SerialNumberList.cpp.
References 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." |
Definition at line 490 of file SerialNumberList.cpp.
References Isis::SerialNumberList::hasSerialNumber(), Isis::SerialNumberList::m_serialMap, and Isis::IException::Programmer.
Referenced by Isis::SerialNumberList::add(), Isis::QnetTool::addMeasure(), Isis::ControlPointEditWidget::createTemporaryGroundMeasure(), Isis::QnetSetAprioriDialog::fillReferenceAprioriLineEdits(), Isis::QnetPointDistanceFilter::filter(), Isis::QnetTool::findPointLocation(), observationNumberMapIndex(), Isis::SerialNumberList::remove(), and Isis::ControlPointEditWidget::setShapesForPoint().
|
inherited |
How many serial number / filename combos are in the list.
Definition at line 384 of file SerialNumberList.cpp.
References Isis::SerialNumberList::m_pairs.
Referenced by Isis::QnetTool::addMeasure(), 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(), init(), Isis::ControlNetStatistics::InitSerialNumMap(), Isis::BundleAdjust::numberOfImages(), Isis::ObservationNumber::PossibleSerial(), Isis::ControlNetStatistics::PrintImageStats(), remove(), Isis::QnetNavTool::resetList(), Isis::QnetNewMeasureDialog::setFiles(), Isis::NewControlPointDialog::setFiles(), Isis::QnetFixedPointDialog::setFiles(), and Isis::ControlNet::SetImages().
|
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." |
Definition at line 585 of file SerialNumberList.cpp.
References Isis::SerialNumberList::hasSerialNumber(), Isis::SerialNumberList::m_pairs, Isis::SerialNumberList::m_serialMap, and Isis::IException::Programmer.
|
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." |
Definition at line 559 of file SerialNumberList.cpp.
References Isis::SerialNumberList::m_pairs, Isis::IException::Programmer, and Isis::toString().
|
protectedinherited |
Specifies whether or not to check to make sure the target names match between files added to the serialnumber list.
Definition at line 112 of file SerialNumberList.h.
Referenced by Isis::SerialNumberList::add(), and Isis::SerialNumberList::SerialNumberList().
|
protectedinherited |
Maps filenames to their positions in the list.
Definition at line 106 of file SerialNumberList.h.
Referenced by Isis::SerialNumberList::add(), Isis::SerialNumberList::fileNameIndex(), observationNumber(), Isis::SerialNumberList::remove(), and Isis::SerialNumberList::serialNumber().
|
private |
Maps serial number index to observation number index.
Definition at line 76 of file ObservationNumberList.h.
Referenced by add(), observationNumberMapIndex(), and remove().
|
private |
Count of observations in the observation number list.
Definition at line 77 of file ObservationNumberList.h.
Referenced by init(), observationSize(), and remove().
|
protectedinherited |
List of serial number Pair entities.
Definition at line 104 of file SerialNumberList.h.
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.
Definition at line 105 of file SerialNumberList.h.
Referenced by Isis::SerialNumberList::add(), Isis::SerialNumberList::fileName(), Isis::SerialNumberList::hasSerialNumber(), Isis::SerialNumberList::remove(), Isis::SerialNumberList::serialNumberIndex(), and Isis::SerialNumberList::spacecraftInstrumentId().
|
private |
List of observation sets.
Definition at line 78 of file ObservationNumberList.h.
|
protectedinherited |
Target name that the files must have if m_checkTarget is true
Definition at line 113 of file SerialNumberList.h.
Referenced by Isis::SerialNumberList::add(), and Isis::SerialNumberList::SerialNumberList().