10 #ifndef LOFAR_PARMDB_SOURCEDBCASA_H
11 #define LOFAR_PARMDB_SOURCEDBCASA_H
15 #include <casacore/tables/Tables/Table.h>
16 #include <casacore/casa/version.h>
41 void lock(
bool lockForWrite)
override;
65 unsigned int addPatch(
const std::string& patchName,
int catType,
66 double apparentBrightness,
double ra,
double dec,
70 void updatePatch(
unsigned int patchId,
double apparentBrightness,
double ra,
82 const ParmMap& defaultParameters,
double ra,
double dec,
90 int catType,
double apparentBrightness,
91 const ParmMap& defaultParameters,
double ra,
double dec,
97 std::vector<std::string>
getPatches(
int category,
const std::string& pattern,
99 double maxBrightness)
override;
102 std::vector<PatchInfo>
getPatchInfo(
int category,
const std::string& pattern,
103 double minBrightness,
104 double maxBrightness)
override;
108 const std::string& patchName)
override;
112 const std::string& patchName)
override;
118 std::vector<SourceInfo>
getSources(
const std::string& pattern)
override;
138 void createTables(
const std::string& tableName);
141 void addSrc(
const SourceInfo& sourceInfo,
unsigned int patchId,
142 const ParmMap& defaultParameters,
double ra,
double dec);
145 void writePatch(
double apparentBrightness,
double ra,
double dec,
149 std::vector<std::string> findDuplicates(casacore::Table& table,
150 const std::string& columnName);
157 std::vector<SourceInfo> readSources(
const casacore::Table& table);
160 casacore::Table selectPatches(
int category,
const std::string& pattern,
161 double minBrightness,
162 double maxBrightness)
const;
165 double getDefaultParmValue(
const std::string& name);
167 casacore::Table itsPatchTable;
168 casacore::Table itsSourceTable;
169 std::set<std::string> itsPatchSet;
170 std::set<std::string> itsSourceSet;
172 casacore::Vector<common::rownr_t> itsRowNr;
Base class for a table holding sources and their parameters.
A map of parameter name to value set.
Definition: ParmMap.h:30
Class for a Casa table holding source parameters.
Definition: SourceDBCasa.h:30
std::vector< std::string > getPatches(int category, const std::string &pattern, double minBrightness, double maxBrightness) override
void addSource(const SourceInfo &sourceInfo, const std::string &patchName, const ParmMap &defaultParameters, double ra, double dec, bool check) override
void lock(bool lockForWrite) override
std::vector< SourceData > getPatchSourceData(const std::string &patchName) override
Get all data of the sources belonging to the given patch.
SourceDBCasa(const ParmDBMeta &pdm, bool forceNew)
SourceInfo getSource(const std::string &sourceName) override
Get the source info of the given source.
bool patchExists(const std::string &patchName) override
Test if the patch already exists.
std::vector< std::string > findDuplicateSources() override
Find non-unique source names.
bool atEnd() override
Tell if we are the end of the file.
void addSource(const SourceInfo &sourceInfo, const std::string &patchName, int catType, double apparentBrightness, const ParmMap &defaultParameters, double ra, double dec, bool check) override
void getNextSource(SourceData &src) override
bool sourceExists(const std::string &sourceName) override
Test if the source already exists.
void clearTables() override
Clear database or table.
std::vector< PatchInfo > getPatchInfo(int category, const std::string &pattern, double minBrightness, double maxBrightness) override
Get the info of all patches (name, ra, dec).
std::vector< std::string > findDuplicatePatches() override
Find non-unique patch names.
void deleteSources(const std::string &sourceNamePattern) override
Delete the sources records matching the given (filename like) pattern.
void addSource(const SourceData &source, bool check) override
void checkDuplicates() override
void rewind() override
Reset to the beginning of the file.
std::vector< SourceInfo > getSources(const std::string &pattern) override
Get the info of all sources matching the given (filename like) pattern.
unsigned int addPatch(const std::string &patchName, int catType, double apparentBrightness, double ra, double dec, bool check) override
std::vector< SourceInfo > getPatchSources(const std::string &patchName) override
Get the sources belonging to the given patch.
void updatePatch(unsigned int patchId, double apparentBrightness, double ra, double dec) override
Update the ra/dec and apparent brightness of a patch.
Abstract base class for a table holding source parameters.
Definition: SourceDB.h:29
Class holding a data of a source.
Definition: SourceData.h:31
Info about a source.
Definition: SourceInfo.h:29
This file has generic helper routines for testing steps.
Definition: AntennaConfig.h:53