An official website of the United States government
Here’s how you know
Official websites use .gov
A
.gov website belongs to an official government
organization in the United States.
Secure .gov websites use HTTPS
A
lock
( ) or https:// means you’ve safely connected to
the .gov website. Share sensitive information only on official,
secure websites.
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. | |
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< Pair > | m_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. | |
Private Member Functions | |
void | init (SerialNumberList *snlist) |
Initiates the ObservationNumberList. | |
Private Attributes | |
std::multimap< int, int > | m_indexMap |
Maps serial number index to observation number index. | |
int | m_numberObservations |
Count of observations in the observation number list. | |
std::vector< ObservationSet > | m_sets |
List of observation sets. | |
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.
2007-09-17 Debbie A. Cook - Original version
2008-01-11 Christopher Austin - Made class more general, inheriting SerialNumberList among others
2008-05-01 Debbie A. Cook - Removed upper bound check in ObservationNumberMapIndex because when entries are removed from the observation list, the serialNumberIndex may exceed the size of the map
2008-06-18 Steven Koechle - Fixed Documentation Errors
2008-10-30 Steven Lambright - Fixed problem with definition of struct quad, pointed out by "novus0x2a" (Support Board Member)
2016-06-02 Ian Humphrey - Changed inherited protected members from p_ to m_. References #3967.
2016-06-03 Ian Humphrey - Updated documentation and coding standards. Updated unit test. Fixes #3990.
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(), and Isis::SerialNumberList::SerialNumberList().
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(), and Isis::SerialNumberList::SerialNumberList().
Isis::ObservationNumberList::~ObservationNumberList | ( | ) |
Destructor.
Definition at line 84 of file ObservationNumberList.cpp.
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 |
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 add(), and 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." |
2007-06-04 Tracie Sucharski - Expand filename to include full path before adding to list.
2010-11-24 Tracie Sucharski - Added bool def2filename parameter. This will allow level 2 images to be added to a serial number list.
2010-11-29 Tracie Sucharski - Only read the Instrument group if m_checkTarget is True. If def2filename is True, check for Mapping group if Target does not exist.
Definition at line 121 of file SerialNumberList.cpp.
References Isis::ObservationNumber::Compose(), Isis::SerialNumber::Compose(), Isis::FileName::expanded(), fileName(), Isis::PvlObject::findGroup(), Isis::PvlObject::findObject(), Isis::PvlObject::hasGroup(), Isis::PvlContainer::hasKeyword(), hasSerialNumber(), m_checkTarget, m_fileMap, m_pairs, m_serialMap, m_target, serialNumberIndex(), and Isis::IException::User.
Referenced by add(), SerialNumberList(), Isis::ImageList::serialNumberList(), Isis::MatchTool::serialNumberList(), and Isis::ShapeList::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." |
Definition at line 251 of file SerialNumberList.cpp.
References Isis::FileName::expanded(), fileName(), Isis::PvlObject::findGroup(), Isis::PvlObject::findObject(), Isis::PvlObject::hasGroup(), Isis::PvlContainer::hasKeyword(), hasSerialNumber(), m_checkTarget, m_fileMap, m_pairs, m_serialMap, m_target, observationNumber(), serialNumber(), serialNumberIndex(), and Isis::IException::User.
|
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 hasSerialNumber(), m_pairs, m_serialMap, and Isis::IException::Programmer.
Referenced by add(), add(), Isis::SerialNumber::ComposeObservation(), Isis::QnetPointCubeNameFilter::createCubeList(), Isis::MatchTool::deletePoint(), Isis::ImageOverlapSet::FindImageOverlaps(), Isis::ImageOverlapSet::HandleError(), Isis::ImageOverlapSet::HandleError(), Isis::ImageOverlapSet::HandleError(), Isis::MatchTool::loadMeasureTable(), Isis::MatchTool::loadPoint(), remove(), Isis::MatchTool::selectLeftMeasure(), Isis::MatchTool::selectRightMeasure(), Isis::MatchTool::serialNumberList(), Isis::QnetFixedPointDialog::setFiles(), Isis::QnetNewMeasureDialog::setFiles(), Isis::ControlNet::SetImages(), and Isis::LidarData::SetImages().
|
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 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." |
2007-06-04 Tracie Sucharski - Expand filename to include full path before searching list.
2007-07-11 Stuart Sides - Fixed bug where the correct index was not returned.
Definition at line 517 of file SerialNumberList.cpp.
References Isis::FileName::expanded(), m_fileMap, and Isis::IException::Programmer.
Referenced by Isis::ObservationNumberList::observationNumber(), and 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 m_serialMap.
Referenced by add(), add(), fileName(), Isis::ObservationNumberList::remove(), serialNumberIndex(), Isis::MatchTool::serialNumberList(), Isis::ControlNet::SetImages(), Isis::LidarData::SetImages(), and 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::SerialNumberList(), Isis::SerialNumberList::size(), and Isis::IException::User.
Referenced by ObservationNumberList(), and 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 m_pairs, observationNumber(), Isis::IException::Programmer, and 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(), and Isis::SerialNumberList::SerialNumberList().
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::SerialNumberList(), 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(), fileNameIndex(), m_fileMap, m_pairs, and Isis::IException::Programmer.
Referenced by add(), add(), Isis::ImageOverlapSet::FindImageOverlaps(), Isis::MatchTool::mouseButtonRelease(), Isis::ObservationNumber::PossibleSerial(), possibleSerialNumbers(), Isis::MatchTool::selectLeftMeasure(), Isis::MatchTool::selectRightMeasure(), Isis::QnetNewMeasureDialog::setFiles(), Isis::ControlNet::SetImages(), and Isis::LidarData::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 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 hasSerialNumber(), m_serialMap, and Isis::IException::Programmer.
Referenced by add(), add(), Isis::ObservationNumberList::observationNumberMapIndex(), and remove().
|
inherited |
How many serial number / filename combos are in the list.
Definition at line 384 of file SerialNumberList.cpp.
References m_pairs.
Referenced by Isis::QnetPointCubeNameFilter::createCubeList(), Isis::ImageOverlapSet::FindAllOverlaps(), Isis::ImageOverlapSet::FindImageOverlaps(), Isis::ObservationNumberList::init(), Isis::ObservationNumber::PossibleSerial(), Isis::ObservationNumberList::remove(), Isis::QnetNavTool::resetList(), Isis::QnetFixedPointDialog::setFiles(), Isis::QnetNewMeasureDialog::setFiles(), Isis::ControlNet::SetImages(), and Isis::LidarData::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 hasSerialNumber(), m_pairs, 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 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 add(), add(), SerialNumberList(), and SerialNumberList().
|
protectedinherited |
Maps filenames to their positions in the list.
Definition at line 106 of file SerialNumberList.h.
Referenced by add(), add(), fileNameIndex(), Isis::ObservationNumberList::observationNumber(), remove(), and 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 add(), add(), fileName(), fileName(), Isis::ObservationNumberList::hasObservationNumber(), Isis::ObservationNumberList::observationNumber(), Isis::ObservationNumberList::observationNumber(), observationNumber(), Isis::ObservationNumberList::possibleFileNames(), possibleSerialNumbers(), remove(), serialNumber(), serialNumber(), size(), spacecraftInstrumentId(), and spacecraftInstrumentId().
|
protectedinherited |
Maps serial numbers to their positions in the list.
Definition at line 105 of file SerialNumberList.h.
Referenced by add(), add(), fileName(), hasSerialNumber(), remove(), serialNumberIndex(), and 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 add(), add(), SerialNumberList(), and SerialNumberList().