DP3
Public Member Functions | List of all members
dp3::parmdb::SourceDBBlob Class Reference

Class for a Blob file holding source parameters. More...

#include <SourceDBBlob.h>

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

Public Member Functions

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

Detailed Description

Class for a Blob file holding source parameters.

Constructor & Destructor Documentation

◆ SourceDBBlob()

dp3::parmdb::SourceDBBlob::SourceDBBlob ( const ParmDBMeta pdm,
bool  forceNew 
)

◆ ~SourceDBBlob()

dp3::parmdb::SourceDBBlob::~SourceDBBlob ( )
override

Member Function Documentation

◆ addPatch()

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

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.

Implements dp3::parmdb::SourceDBRep.

◆ addSource() [1/3]

void dp3::parmdb::SourceDBBlob::addSource ( const SourceData source,
bool  check 
)
overridevirtual

◆ addSource() [2/3]

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

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 preceeded by the source name and a colon. 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.

Implements dp3::parmdb::SourceDBRep.

◆ addSource() [3/3]

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

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

Implements dp3::parmdb::SourceDBRep.

◆ atEnd()

bool dp3::parmdb::SourceDBBlob::atEnd ( )
overridevirtual

Tell if we are the end of the file.

Implements dp3::parmdb::SourceDBRep.

◆ checkDuplicates()

void dp3::parmdb::SourceDBBlob::checkDuplicates ( )
overridevirtual

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

Implements dp3::parmdb::SourceDBRep.

◆ clearTables()

void dp3::parmdb::SourceDBBlob::clearTables ( )
overridevirtual

Clear file (i.e. remove everything).

Implements dp3::parmdb::SourceDBRep.

◆ deleteSources()

void dp3::parmdb::SourceDBBlob::deleteSources ( const std::string &  sourceNamePattern)
overridevirtual

Delete the sources records matching the given (filename like) pattern. This is not possible yet.

Implements dp3::parmdb::SourceDBRep.

◆ findDuplicatePatches()

std::vector<std::string> dp3::parmdb::SourceDBBlob::findDuplicatePatches ( )
overridevirtual

Find non-unique patch names.

Implements dp3::parmdb::SourceDBRep.

◆ findDuplicateSources()

std::vector<std::string> dp3::parmdb::SourceDBBlob::findDuplicateSources ( )
overridevirtual

Find non-unique source names.

Implements dp3::parmdb::SourceDBRep.

◆ getNextSource()

void dp3::parmdb::SourceDBBlob::getNextSource ( SourceData src)
overridevirtual

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

Implements dp3::parmdb::SourceDBRep.

◆ getPatches()

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

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

Implements dp3::parmdb::SourceDBRep.

◆ getPatchInfo()

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

Get the info of all patches (name, ra, dec).

Implements dp3::parmdb::SourceDBRep.

◆ getPatchSourceData()

std::vector<SourceData> dp3::parmdb::SourceDBBlob::getPatchSourceData ( const std::string &  patchName)
overridevirtual

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

Implements dp3::parmdb::SourceDBRep.

◆ getPatchSources()

std::vector<SourceInfo> dp3::parmdb::SourceDBBlob::getPatchSources ( const std::string &  patchName)
overridevirtual

Get the sources belonging to the given patch.

Implements dp3::parmdb::SourceDBRep.

◆ getSource()

SourceInfo dp3::parmdb::SourceDBBlob::getSource ( const std::string &  sourceName)
overridevirtual

Get the source info of the given source.

Implements dp3::parmdb::SourceDBRep.

◆ getSources()

std::vector<SourceInfo> dp3::parmdb::SourceDBBlob::getSources ( const std::string &  pattern)
overridevirtual

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

Implements dp3::parmdb::SourceDBRep.

◆ lock()

void dp3::parmdb::SourceDBBlob::lock ( bool  lockForWrite)
overridevirtual

Writelock and unlock the file. It does not do anything.

Reimplemented from dp3::parmdb::SourceDBRep.

◆ patchExists()

bool dp3::parmdb::SourceDBBlob::patchExists ( const std::string &  patchName)
overridevirtual

Test if the patch already exists.

Implements dp3::parmdb::SourceDBRep.

◆ rewind()

void dp3::parmdb::SourceDBBlob::rewind ( )
overridevirtual

Reset to the beginning of the file.

Implements dp3::parmdb::SourceDBRep.

◆ sourceExists()

bool dp3::parmdb::SourceDBBlob::sourceExists ( const std::string &  sourceName)
overridevirtual

Test if the source already exists.

Implements dp3::parmdb::SourceDBRep.

◆ unlock()

void dp3::parmdb::SourceDBBlob::unlock ( )
overridevirtual

Reimplemented from dp3::parmdb::SourceDBRep.

◆ updatePatch()

void dp3::parmdb::SourceDBBlob::updatePatch ( unsigned int  patchId,
double  apparentBrightness,
double  ra,
double  dec 
)
overridevirtual

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

Implements dp3::parmdb::SourceDBRep.


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