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

Data access the a local parameter database. More...

#include <ParmFacadeLocal.h>

Inheritance diagram for dp3::parmdb::ParmFacadeLocal:
dp3::parmdb::ParmFacadeRep

Public Member Functions

 ParmFacadeLocal (const std::string &tableName, bool create=false)
 Make a connection to a new or existing ParmTable. More...
 
 ~ParmFacadeLocal () override
 The destructor disconnects. More...
 
void addDefValues (const casacore::Record &, bool check) override
 Add one or more default values. More...
 
void addValues (const casacore::Record &rec) override
 Add the values for the given parameter names and domain. More...
 
void clearTables () override
 Clear the tables, thus remove all parameter values and default values. More...
 
void deleteDefValues (const std::string &parmNamePattern) override
 Delete the default value records for the given parameters. More...
 
void deleteValues (const std::string &parmNamePattern, double freqv1, double freqv2, double timev1, double timev2, bool asStartEnd) override
 Delete the records for the given parameters and domain. More...
 
void flush (bool fsync) override
 Flush the possible changes to disk. More...
 
casacore::Record getCoeff (const std::string &parmNamePattern, double freqv1, double freqv2, double timev1, double timev2, bool asStartEnd) override
 Get coefficients, errors, and domains they belong to. More...
 
std::vector< double > getDefaultSteps () const override
 Get the default step values for the axes. More...
 
std::vector< std::string > getDefNames (const std::string &parmNamePattern) const override
 
casacore::Record getDefValues (const std::string &parmNamePattern) const override
 Get the default values of parameters matching the pattern. More...
 
std::vector< std::string > getNames (const std::string &parmNamePattern, bool includeDefaults) const override
 
std::vector< double > getRange (const std::string &parmNamePattern) const override
 
casacore::Record getValues (const std::string &parmNamePattern, const std::vector< double > &freqv1, const std::vector< double > &freqv2, const std::vector< double > &timev1, const std::vector< double > &timev2, bool asStartEnd, bool includeDefaults) override
 
casacore::Record getValues (const std::string &parmNamePattern, double freqv1, double freqv2, double freqStep, double timev1, double timev2, double timeStep, bool asStartEnd, bool includeDefaults) override
 
casacore::Record getValuesGrid (const std::string &parmNamePattern, double freqv1, double freqv2, double timev1, double timev2, bool asStartEnd) override
 
void setDefaultSteps (const std::vector< double > &) override
 Set the default step values. More...
 
void lock (bool lockForWrite) override
 
void unlock () override
 
- Public Member Functions inherited from dp3::parmdb::ParmFacadeRep
virtual ~ParmFacadeRep ()
 The destructor disconnects. More...
 

Additional Inherited Members

- Public Types inherited from dp3::parmdb::ParmFacadeRep
typedef std::shared_ptr< ParmFacadeRepShPtr
 Define a shared_ptr for this class. More...
 

Detailed Description

Data access the a local parameter database.

ParmFacadeLocal is the high level interface to a local Parameter Data Base. The current version assumes it is an AIPS++ table; with a few extra constructor arguments it can easily be changed to other types of databases.

The class provides a few functions:

The parameter names can be given as a pattern. This is the same as a file name pattern that can be given in the UNIX shells (e.g. RA:*). Thus it is not a full regular expression.

Constructor & Destructor Documentation

◆ ParmFacadeLocal()

dp3::parmdb::ParmFacadeLocal::ParmFacadeLocal ( const std::string &  tableName,
bool  create = false 
)

Make a connection to a new or existing ParmTable.

◆ ~ParmFacadeLocal()

dp3::parmdb::ParmFacadeLocal::~ParmFacadeLocal ( )
override

The destructor disconnects.

Member Function Documentation

◆ addDefValues()

void dp3::parmdb::ParmFacadeLocal::addDefValues ( const casacore::Record &  ,
bool  check 
)
overridevirtual

Add one or more default values.

Implements dp3::parmdb::ParmFacadeRep.

◆ addValues()

void dp3::parmdb::ParmFacadeLocal::addValues ( const casacore::Record &  rec)
overridevirtual

Add the values for the given parameter names and domain.

Implements dp3::parmdb::ParmFacadeRep.

◆ clearTables()

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

Clear the tables, thus remove all parameter values and default values.

Implements dp3::parmdb::ParmFacadeRep.

◆ deleteDefValues()

void dp3::parmdb::ParmFacadeLocal::deleteDefValues ( const std::string &  parmNamePattern)
overridevirtual

Delete the default value records for the given parameters.

Implements dp3::parmdb::ParmFacadeRep.

◆ deleteValues()

void dp3::parmdb::ParmFacadeLocal::deleteValues ( const std::string &  parmNamePattern,
double  freqv1,
double  freqv2,
double  timev1,
double  timev2,
bool  asStartEnd 
)
overridevirtual

Delete the records for the given parameters and domain.

Implements dp3::parmdb::ParmFacadeRep.

◆ flush()

void dp3::parmdb::ParmFacadeLocal::flush ( bool  fsync)
overridevirtual

Flush the possible changes to disk.

Implements dp3::parmdb::ParmFacadeRep.

◆ getCoeff()

casacore::Record dp3::parmdb::ParmFacadeLocal::getCoeff ( const std::string &  parmNamePattern,
double  freqv1,
double  freqv2,
double  timev1,
double  timev2,
bool  asStartEnd 
)
overridevirtual

Get coefficients, errors, and domains they belong to.

Implements dp3::parmdb::ParmFacadeRep.

◆ getDefaultSteps()

std::vector<double> dp3::parmdb::ParmFacadeLocal::getDefaultSteps ( ) const
overridevirtual

Get the default step values for the axes.

Implements dp3::parmdb::ParmFacadeRep.

◆ getDefNames()

std::vector<std::string> dp3::parmdb::ParmFacadeLocal::getDefNames ( const std::string &  parmNamePattern) const
overridevirtual

Get default parameter names matching the pattern. An empty name pattern is the same as * (all parm names).

Implements dp3::parmdb::ParmFacadeRep.

◆ getDefValues()

casacore::Record dp3::parmdb::ParmFacadeLocal::getDefValues ( const std::string &  parmNamePattern) const
overridevirtual

Get the default values of parameters matching the pattern.

Implements dp3::parmdb::ParmFacadeRep.

◆ getNames()

std::vector<std::string> dp3::parmdb::ParmFacadeLocal::getNames ( const std::string &  parmNamePattern,
bool  includeDefaults 
) const
overridevirtual

Get parameter names in the table matching the pattern. An empty name pattern is the same as * (all parm names).

Implements dp3::parmdb::ParmFacadeRep.

◆ getRange()

std::vector<double> dp3::parmdb::ParmFacadeLocal::getRange ( const std::string &  parmNamePattern) const
overridevirtual

Get the domain range (as startx,endx,starty,endy) of the given parameters in the table. This is the minimum start value and maximum end value for all parameters. An empty name pattern is the same as * (all parm names).

Implements dp3::parmdb::ParmFacadeRep.

◆ getValues() [1/2]

casacore::Record dp3::parmdb::ParmFacadeLocal::getValues ( const std::string &  parmNamePattern,
const std::vector< double > &  freqv1,
const std::vector< double > &  freqv2,
const std::vector< double > &  timev1,
const std::vector< double > &  timev2,
bool  asStartEnd,
bool  includeDefaults 
)
overridevirtual

Get the values of the given parameters on the given grid where v1/v2 represents center/width or start/end. The Record contains a map of parameter name to Array<double>.

Implements dp3::parmdb::ParmFacadeRep.

◆ getValues() [2/2]

casacore::Record dp3::parmdb::ParmFacadeLocal::getValues ( const std::string &  parmNamePattern,
double  freqv1,
double  freqv2,
double  freqStep,
double  timev1,
double  timev2,
double  timeStep,
bool  asStartEnd,
bool  includeDefaults 
)
overridevirtual

Get the values of the given parameters on the given regular grid where v1/v2 represents center/width or start/end. The Record contains a map of parameter name to Array<double>.

Implements dp3::parmdb::ParmFacadeRep.

◆ getValuesGrid()

casacore::Record dp3::parmdb::ParmFacadeLocal::getValuesGrid ( const std::string &  parmNamePattern,
double  freqv1,
double  freqv2,
double  timev1,
double  timev2,
bool  asStartEnd 
)
overridevirtual

Get the values of the given parameters for the given domain. The Record contains a map of parameter name to Array<value>. Furthermore it contains a subrecord "_grid" containing the grid axes used for each parameters. Their names have the form parmname/xx where xx is freqs, freqwidths, times, and timewidths. Their values are the center and width of each cell.

Implements dp3::parmdb::ParmFacadeRep.

◆ lock()

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

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.

Implements dp3::parmdb::ParmFacadeRep.

◆ setDefaultSteps()

void dp3::parmdb::ParmFacadeLocal::setDefaultSteps ( const std::vector< double > &  )
overridevirtual

Set the default step values.

Implements dp3::parmdb::ParmFacadeRep.

◆ unlock()

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

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