DP3
Public Member Functions | List of all members
dp3::parmdb::SourceDBRep Class Referenceabstract

Abstract base class for a table holding source parameters. More...

#include <SourceDB.h>

Inheritance diagram for dp3::parmdb::SourceDBRep:
dp3::parmdb::SourceDBBlob dp3::parmdb::SourceDBCasa

Public Member Functions

 SourceDBRep (const ParmDBMeta &ptm, bool forceNew)
 This creates the underlying ParmDB object. More...
 
virtual ~SourceDBRep ()
 
virtual unsigned int addPatch (const std::string &patchName, int catType, double apparentBrightness, double ra, double dec, bool check)=0
 
virtual void addSource (const SourceInfo &sourceInfo, const std::string &patchName, int catType, double apparentBrightness, const ParmMap &defaultParameters, double ra, double dec, bool check)=0
 
virtual bool atEnd ()=0
 Tell if we are the end of the file. More...
 
virtual void checkDuplicates ()=0
 
virtual void clearTables ()=0
 Clear database or table. More...
 
virtual void deleteSources (const std::string &sourceNamePattern)=0
 Delete the sources records matching the given (filename like) pattern. More...
 
virtual std::vector< std::string > findDuplicatePatches ()=0
 Find non-unique patch names. More...
 
virtual std::vector< std::string > findDuplicateSources ()=0
 Find non-unique source names. More...
 
virtual void getNextSource (SourceData &src)=0
 
ParmDBgetParmDB ()
 Get the associated ParmDB. More...
 
const ParmDBMetagetParmDBMeta () const
 Get the name and type of the SourceDB. More...
 
virtual std::vector< std::string > getPatches (int category, const std::string &pattern, double minBrightness, double maxBrightness)=0
 
virtual std::vector< PatchInfogetPatchInfo (int category, const std::string &pattern, double minBrightness, double maxBrightness)=0
 Get the info of selected patches (default all patches). More...
 
virtual std::vector< SourceDatagetPatchSourceData (const std::string &patchName)=0
 Get all data of the sources belonging to the given patch. More...
 
virtual std::vector< SourceInfogetPatchSources (const std::string &patchName)=0
 Get the sources belonging to the given patch. More...
 
virtual SourceInfo getSource (const std::string &sourceName)=0
 Get the source type of the given source. More...
 
virtual std::vector< SourceInfogetSources (const std::string &pattern)=0
 Get the info of all sources matching the given (filename like) pattern. More...
 
void link ()
 Link to the DBRep by incrementing the count. More...
 
virtual bool patchExists (const std::string &patchName)=0
 Test if the patch already exists. More...
 
virtual void rewind ()=0
 Reset to the beginning of the file. More...
 
virtual bool sourceExists (const std::string &sourceName)=0
 Test if the source already exists. More...
 
int unlink ()
 Unlink by decrementing the count. More...
 
virtual void updatePatch (unsigned int patchId, double apparentBrightness, double ra, double dec)=0
 Update the ra/dec and apparent brightness of a patch. More...
 
virtual void lock (bool lockForWrite)
 
virtual void unlock ()
 
virtual void addSource (const SourceInfo &sourceInfo, const std::string &patchName, const ParmMap &defaultParameters, double ra, double dec, bool check)=0
 
virtual void addSource (const SourceData &source, bool check)=0
 

Detailed Description

Abstract base class for a table holding source parameters.

Constructor & Destructor Documentation

◆ SourceDBRep()

dp3::parmdb::SourceDBRep::SourceDBRep ( const ParmDBMeta ptm,
bool  forceNew 
)

This creates the underlying ParmDB object.

◆ ~SourceDBRep()

virtual dp3::parmdb::SourceDBRep::~SourceDBRep ( )
virtual

Member Function Documentation

◆ addPatch()

virtual unsigned int dp3::parmdb::SourceDBRep::addPatch ( const std::string &  patchName,
int  catType,
double  apparentBrightness,
double  ra,
double  dec,
bool  check 
)
pure virtual

Add a patch and return its patchId. Nomally ra and dec should be filled in, but for moving patches (e.g. sun) this is not needed.
Optionally it is checked if the patch already exists.

Implemented in dp3::parmdb::SourceDBCasa, and dp3::parmdb::SourceDBBlob.

◆ addSource() [1/3]

virtual void dp3::parmdb::SourceDBRep::addSource ( const SourceData source,
bool  check 
)
pure virtual

◆ addSource() [2/3]

virtual void dp3::parmdb::SourceDBRep::addSource ( const SourceInfo sourceInfo,
const std::string &  patchName,
const ParmMap defaultParameters,
double  ra,
double  dec,
bool  check 
)
pure virtual

Add a source to a patch. Its ra and dec and default parameters will be stored as default values in the associated ParmDB tables. The names of the parameters will be succeeded by a colon and the source name. The map should contain the parameters belonging to the source type. Missing parameters will default to 0.
Optionally it is checked if the source already exists.

Implemented in dp3::parmdb::SourceDBCasa, and dp3::parmdb::SourceDBBlob.

◆ addSource() [3/3]

virtual void dp3::parmdb::SourceDBRep::addSource ( const SourceInfo sourceInfo,
const std::string &  patchName,
int  catType,
double  apparentBrightness,
const ParmMap defaultParameters,
double  ra,
double  dec,
bool  check 
)
pure virtual

Add a source which forms a patch in itself (with the same name).
Optionally it is checked if the patch or source already exists.

Implemented in dp3::parmdb::SourceDBCasa, and dp3::parmdb::SourceDBBlob.

◆ atEnd()

virtual bool dp3::parmdb::SourceDBRep::atEnd ( )
pure virtual

Tell if we are the end of the file.

Implemented in dp3::parmdb::SourceDBCasa, and dp3::parmdb::SourceDBBlob.

◆ checkDuplicates()

virtual void dp3::parmdb::SourceDBRep::checkDuplicates ( )
pure virtual

Check for duplicate patches or sources. An exception is thrown if that is the case.

Implemented in dp3::parmdb::SourceDBCasa, and dp3::parmdb::SourceDBBlob.

◆ clearTables()

virtual void dp3::parmdb::SourceDBRep::clearTables ( )
pure virtual

Clear database or table.

Implemented in dp3::parmdb::SourceDBCasa, and dp3::parmdb::SourceDBBlob.

◆ deleteSources()

virtual void dp3::parmdb::SourceDBRep::deleteSources ( const std::string &  sourceNamePattern)
pure virtual

Delete the sources records matching the given (filename like) pattern.

Implemented in dp3::parmdb::SourceDBCasa, and dp3::parmdb::SourceDBBlob.

◆ findDuplicatePatches()

virtual std::vector<std::string> dp3::parmdb::SourceDBRep::findDuplicatePatches ( )
pure virtual

Find non-unique patch names.

Implemented in dp3::parmdb::SourceDBCasa, and dp3::parmdb::SourceDBBlob.

◆ findDuplicateSources()

virtual std::vector<std::string> dp3::parmdb::SourceDBRep::findDuplicateSources ( )
pure virtual

Find non-unique source names.

Implemented in dp3::parmdb::SourceDBCasa, and dp3::parmdb::SourceDBBlob.

◆ getNextSource()

virtual void dp3::parmdb::SourceDBRep::getNextSource ( SourceData src)
pure virtual

Get the next source from the table. An exception is thrown if there are no more sources.

Implemented in dp3::parmdb::SourceDBCasa, and dp3::parmdb::SourceDBBlob.

◆ getParmDB()

ParmDB& dp3::parmdb::SourceDBRep::getParmDB ( )
inline

Get the associated ParmDB.

◆ getParmDBMeta()

const ParmDBMeta& dp3::parmdb::SourceDBRep::getParmDBMeta ( ) const
inline

Get the name and type of the SourceDB.

◆ getPatches()

virtual std::vector<std::string> dp3::parmdb::SourceDBRep::getPatches ( int  category,
const std::string &  pattern,
double  minBrightness,
double  maxBrightness 
)
pure virtual

Get patch names in order of category and decreasing apparent flux. category < 0 means all categories. A brightness < 0 means no test on brightness.

Implemented in dp3::parmdb::SourceDBCasa, and dp3::parmdb::SourceDBBlob.

◆ getPatchInfo()

virtual std::vector<PatchInfo> dp3::parmdb::SourceDBRep::getPatchInfo ( int  category,
const std::string &  pattern,
double  minBrightness,
double  maxBrightness 
)
pure virtual

Get the info of selected patches (default all patches).

Implemented in dp3::parmdb::SourceDBCasa, and dp3::parmdb::SourceDBBlob.

◆ getPatchSourceData()

virtual std::vector<SourceData> dp3::parmdb::SourceDBRep::getPatchSourceData ( const std::string &  patchName)
pure virtual

Get all data of the sources belonging to the given patch.

Implemented in dp3::parmdb::SourceDBCasa, and dp3::parmdb::SourceDBBlob.

◆ getPatchSources()

virtual std::vector<SourceInfo> dp3::parmdb::SourceDBRep::getPatchSources ( const std::string &  patchName)
pure virtual

Get the sources belonging to the given patch.

Implemented in dp3::parmdb::SourceDBCasa, and dp3::parmdb::SourceDBBlob.

◆ getSource()

virtual SourceInfo dp3::parmdb::SourceDBRep::getSource ( const std::string &  sourceName)
pure virtual

Get the source type of the given source.

Implemented in dp3::parmdb::SourceDBCasa, and dp3::parmdb::SourceDBBlob.

◆ getSources()

virtual std::vector<SourceInfo> dp3::parmdb::SourceDBRep::getSources ( const std::string &  pattern)
pure virtual

Get the info of all sources matching the given (filename like) pattern.

Implemented in dp3::parmdb::SourceDBCasa, and dp3::parmdb::SourceDBBlob.

◆ link()

void dp3::parmdb::SourceDBRep::link ( )
inline

Link to the DBRep by incrementing the count.

◆ lock()

virtual void dp3::parmdb::SourceDBRep::lock ( bool  lockForWrite)
virtual

Writelock and unlock the database tables. The user does not need to lock/unlock, but it can increase performance if many small accesses have to be done. The default implementation does nothing.

Reimplemented in dp3::parmdb::SourceDBCasa, and dp3::parmdb::SourceDBBlob.

◆ patchExists()

virtual bool dp3::parmdb::SourceDBRep::patchExists ( const std::string &  patchName)
pure virtual

Test if the patch already exists.

Implemented in dp3::parmdb::SourceDBCasa, and dp3::parmdb::SourceDBBlob.

◆ rewind()

virtual void dp3::parmdb::SourceDBRep::rewind ( )
pure virtual

Reset to the beginning of the file.

Implemented in dp3::parmdb::SourceDBCasa, and dp3::parmdb::SourceDBBlob.

◆ sourceExists()

virtual bool dp3::parmdb::SourceDBRep::sourceExists ( const std::string &  sourceName)
pure virtual

Test if the source already exists.

Implemented in dp3::parmdb::SourceDBCasa, and dp3::parmdb::SourceDBBlob.

◆ unlink()

int dp3::parmdb::SourceDBRep::unlink ( )
inline

Unlink by decrementing the count.

◆ unlock()

virtual void dp3::parmdb::SourceDBRep::unlock ( )
virtual

◆ updatePatch()

virtual void dp3::parmdb::SourceDBRep::updatePatch ( unsigned int  patchId,
double  apparentBrightness,
double  ra,
double  dec 
)
pure virtual

Update the ra/dec and apparent brightness of a patch.

Implemented in dp3::parmdb::SourceDBCasa, and dp3::parmdb::SourceDBBlob.


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