Factory functions to select the correct data methods. More...
#include <cstdlib>
#include <map>
#include <string>
#include "Constants.h"
#include "FitsFile.h"
#include "MyException.h"
#include "TableInfo.h"
#include "IllumTable.hxx"
#include <exception>
#include "Options.h"
#include "StringOps.h"
#include "DataMethod.hxx"
#include <limits>
#include "Converter.h"
#include "DataOps.h"
#include "Logger.h"
#include "slalib.h"
#include "htm.h"
#include <float.h>
#include "IllumTable.hxx"
#include <cmath>
#include "ast.h"
#include <algorithm>
#include <time.h>
#include "ProgrammeTable.h"
Go to the source code of this file.
Classes | |
class | DataMethodFactoryException |
Exception thrown if there is some problem in selecting a data method. More... | |
Functions | |
bool | isMagnitudeError (const std::string &name) |
bool | isMagnitude (const std::string &name) |
bool | isAperMag (const std::string &name) |
bool | isWcsQuantity (const std::string &name) |
Does the given name correspond to an attribute calculated from WCS info? | |
std::map< int, StringMap > | makeTargetList (TableInfo &info) |
bool | isFrameID (const std::string &name) |
template<typename DataType > | |
DataMethod< DataType > * | getFrameIDMethod (const std::string &name, TableInfo &info, FitsFile &ff) |
template<typename DataType > | |
DataMethod< DataType > * | getMethod (StringMap &target, TableInfo &info, IllumTable &illum, FitsFile &fpix, FitsFile &fcat) |
Factory functions to select the correct data methods.
DataMethod<DataType>* getFrameIDMethod | ( | const std::string & | name, | |
TableInfo & | info, | |||
FitsFile & | ff | |||
) | [inline] |
Select the appropriate frame ID method (direct or indirect) according to the given name (which corresponds to some frame ID quantity)
References TableInfo::getAttNo(), FitsFile::getFileName(), and TableInfo::getUsingValue().
DataMethod<DataType>* getMethod | ( | StringMap & | target, | |
TableInfo & | info, | |||
IllumTable & | illum, | |||
FitsFile & | fpix, | |||
FitsFile & | fcat | |||
) | [inline] |
Factory function to select (instantiate) the correct DataMethod subclass for the given target list
References ExpectNames::axis1Length, ExpectNames::axis2Length, ExpectNames::b, ExpectNames::catName, ExpectNames::centralDec, ExpectNames::centralRa, ExpectNames::cuEventID, ExpectNames::cx, ExpectNames::cy, ExpectNames::cz, ExpectNames::dec, ExpectNames::decMoon, ExpectNames::decMoonTopo, ExpectNames::deltaMag, ExpectNames::distortCorr, ExpectNames::eta, ExpectNames::fileName, ExpectNames::fileTimeStamp, ExpectNames::filterID, ExpectNames::frameType, Options::getArchive(), TableInfo::getAttNo(), TableInfo::getUsingValue(), ExpectNames::hlCircRadAs, ExpectNames::hlCircRadErrAs, ExpectNames::hlCorSMjRadAs, ExpectNames::hlCorSMnRadAs, ExpectNames::hlGeoRadAs, ExpectNames::hlSMjRadAs, ExpectNames::hlSMnRadAs, ExpectNames::htmID, TagNames::HTMLEVEL, ExpectNames::illumCorr, ExpectNames::illumMoon, ExpectNames::imageExtent, isFrameID(), isMagnitude(), isMagnitudeError(), TableInfo::isTableNumeric(), ExpectNames::julianDayNum, ExpectNames::l, ExpectNames::lambda, ExpectNames::maxDec, ExpectNames::maxRa, ExpectNames::minDec, ExpectNames::minRa, ExpectNames::numAxes, ExpectNames::numDetectors, ExpectNames::objectId, ExpectNames::posAngle, ExpectNames::programmeID, ExpectNames::project, ExpectNames::ra, ExpectNames::raBase, ExpectNames::raMoon, ExpectNames::raMoonTopo, TableInfo::readTag(), ExpectNames::saturatCorr, ExpectNames::skySubScale, StringOps::ToLower(), ExpectNames::totalExpTime, ExpectNames::ukirtRunNo, ExpectNames::utDate, ExpectNames::versionNum, ExpectNames::vistaRunNo, ExpectNames::xPixSize, and ExpectNames::yPixSize.
bool isAperMag | ( | const std::string & | name | ) |
Does the given std::string match an attribute name that corresponds to a corrected aperture magnitude?
References StringOps::hasSubstr(), and isMagnitudeError().
Referenced by makeTargetList().
bool isFrameID | ( | const std::string & | name | ) |
Does the given std::string match an attribute name that corresponds to some sort of frame ID?
References ExpectNames::combiframeID, ExpectNames::confID, ExpectNames::darkID, ExpectNames::diffimID, ExpectNames::flatID, ExpectNames::frinID, ExpectNames::maskID, ExpectNames::mosaicID, ExpectNames::multiframeID, ExpectNames::skyID, and ExpectNames::stackID.
Referenced by getMethod().
bool isMagnitude | ( | const std::string & | name | ) |
Does the given std::string match an attribute name that corresponds to a magnitude?
References StringOps::hasSubstr(), and isMagnitudeError().
Referenced by getMethod(), and makeTargetList().
bool isMagnitudeError | ( | const std::string & | name | ) |
Returns true if the given name corresponds to an magnitude error attribute name
References StringOps::hasSubstr().
Referenced by getMethod(), isAperMag(), and isMagnitude().
bool isWcsQuantity | ( | const std::string & | name | ) |
Does the given name correspond to an attribute calculated from WCS info?
References ExpectNames::centralDec, ExpectNames::centralRa, ExpectNames::imageExtent, ExpectNames::maxDec, ExpectNames::maxRa, ExpectNames::minDec, and ExpectNames::minRa.
Make list of targets from the input schema. A target is one or more attributes that are calculted in one go.
References ExpectNames::axis1Length, ExpectNames::axis2Length, ExpectNames::b, ExpectNames::centralDec, ExpectNames::centralRa, ExpectNames::cx, ExpectNames::cy, ExpectNames::cz, ExpectNames::dec, ExpectNames::decMoon, ExpectNames::decMoonTopo, ExpectNames::deltaMag, ExpectNames::distortCorr, ExpectNames::eta, Options::getArchive(), TableInfo::getFitsColumnName(), TableInfo::getFitsKeywordName(), TableInfo::getName(), TableInfo::getNumAttributes(), TableInfo::getUsingValue(), StringOps::hasSubstr(), ExpectNames::hlCircRadAs, ExpectNames::hlCircRadErrAs, ExpectNames::hlCorSMjRadAs, ExpectNames::hlCorSMnRadAs, ExpectNames::hlGeoRadAs, ExpectNames::hlSMjRadAs, ExpectNames::hlSMnRadAs, ExpectNames::illumCorr, ExpectNames::illumMoon, ExpectNames::imageExtent, isAperMag(), isMagnitude(), ExpectNames::l, ExpectNames::lambda, ExpectNames::maxDec, ExpectNames::maxRa, ExpectNames::minDec, ExpectNames::minRa, ExpectNames::numAxes, ExpectNames::posAngle, ExpectNames::ra, ExpectNames::raMoon, ExpectNames::raMoonTopo, ExpectNames::saturatCorr, StringOps::ToLower(), ExpectNames::xPixSize, and ExpectNames::yPixSize.
Referenced by extractMetadata(), and extractSources().