|
DP3
|
Data access the parameter database. More...
#include <ParmFacade.h>
Public Member Functions | |
| ParmFacade (const std::string &tableName, bool create=false) | |
| ~ParmFacade () | |
| The destructor closes the parm table. More... | |
| void | addDefValues (const casacore::Record &rec, bool check=true) |
| void | addValues (const casacore::Record &rec) |
| void | clearTables () |
| Clear the tables, thus remove all parameter values and default values. More... | |
| void | deleteDefValues (const std::string &parmNamePattern) |
| Delete the default value records for the given parameters. More... | |
| void | deleteValues (const std::string &parmNamePattern, double freqv1=-1e30, double freqv2=1e30, double timev1=-1e30, double timev2=1e30, bool asStartEnd=true) |
| Delete the records for the given parameters and domain. More... | |
| void | flush (bool fsync=false) |
| Flush the possible changes to disk. More... | |
| casacore::Record | getCoeff (const std::string &parmNamePattern, double freqv1=-1e30, double freqv2=1e30, double timev1=-1e30, double timev2=1e30, bool asStartEnd=true) |
| std::vector< double > | getDefaultSteps () const |
| Get the default step values for the frequency and time axis. More... | |
| std::vector< std::string > | getDefNames (const std::string &parmNamePattern=std::string()) const |
| casacore::Record | getDefValues (const std::string &parmNamePattern=std::string()) const |
| std::vector< std::string > | getNames (const std::string &parmNamePattern=std::string(), bool includeDefaults=false) const |
| std::vector< double > | getRange (const std::string &parmNamePattern=std::string()) const |
| 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=true, bool includeDefaults=false) |
| casacore::Record | getValuesGrid (const std::string &parmNamePattern, double freqv1=-1e30, double freqv2=1e30, double timev1=-1e30, double timev2=1e30, bool asStartEnd=true) |
| void | setDefaultSteps (const std::vector< double > &steps) |
| Set the default step values for the frequency and time axis. More... | |
| string | version (const std::string &type) const |
| Get the version info (tree, top, full or other) More... | |
| std::map< std::string, std::vector< double > > | getValuesMap (const std::string &parmNamePattern, double freqv1, double freqv2, double freqStep, double timev1, double timev2, double timeStep, bool asStartEnd=false, bool includeDefaults=false) |
| std::map< std::string, std::vector< double > > | getValuesMap (const std::string &parmNamePattern, double freqv1, double freqv2, double timev1, double timev2, bool asStartEnd=false, bool includeDefaults=false) |
| casacore::Record | getValues (const std::string &parmNamePattern, double freqv1, double freqv2, double freqStep, double timev1, double timev2, double timeStep, bool asStartEnd=true, bool includeDefaults=false) |
| casacore::Record | getValues (const std::string &parmNamePattern, double freqv1=-1e30, double freqv2=1e30, double timev1=-1e30, double timev2=1e30, bool asStartEnd=true, bool includeDefaults=false) |
| void | lock (bool lockForWrite) |
| void | unlock () |
Data access the parameter database.
ParmFacade is the high level interface to the Parameter Data Base. The current version assumes it is a Casacore 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.
| dp3::parmdb::ParmFacade::ParmFacade | ( | const std::string & | tableName, |
| bool | create = false |
||
| ) |
Make a connection to the given ParmTable. If create=true, a new local ParmTable is created. Otherwise the local or distributed ParmTable must exist. A distributed ParmTable should be given by means of the VDS-file as created by the scripts setupparmdb and setupsourcedb.
| dp3::parmdb::ParmFacade::~ParmFacade | ( | ) |
The destructor closes the parm table.
|
inline |
Add one or more default values. The name of each field in the record is the parameter name. The values are subrecords containing the parameter values, etc.
By default it checks if the name does not exist.
|
inline |
Add the values for the given parameter names and domain. The name of each field in the record is the parameter name. The values are subrecords containing the domains, parameter values, etc.
It checks if no values exist for the parameters and domains yet.
|
inline |
Clear the tables, thus remove all parameter values and default values.
|
inline |
Delete the default value records for the given parameters.
|
inline |
Delete the records for the given parameters and domain.
|
inline |
Flush the possible changes to disk.
|
inline |
Get the coefficients and possible errors for the given parameters and domains. The Record contains a map of parameter name to a subrecord. The subrecord contains a map of 'v_i' to a subrecord where v_i represents the i-th domain. Each subrecord contains the fields coeff, error, and domain. Each of these fields contain an array of doubles containing the values. The error array is empty if no errors are stored.
|
inline |
Get the default step values for the frequency and time axis.
|
inline |
Get default parameter names in the table matching the pattern. An empty name pattern is the same as * (all parm names).
|
inline |
Get default values of parameters in the table matching the pattern. An empty name pattern is the same as * (all parm names).
|
inline |
Get parameter names in the table matching the pattern. An empty name pattern is the same as * (all parm names).
|
inline |
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).
|
inline |
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>.
|
inline |
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>. If freqStep and timeStep are not given (or given as <=0), the default freq and time step from the ParmDB will be used.
| casacore::Record dp3::parmdb::ParmFacade::getValues | ( | const std::string & | parmNamePattern, |
| double | freqv1 = -1e30, |
||
| double | freqv2 = 1e30, |
||
| double | timev1 = -1e30, |
||
| double | timev2 = 1e30, |
||
| bool | asStartEnd = true, |
||
| bool | includeDefaults = false |
||
| ) |
|
inline |
Get the values of the given parameters for the given domain. The Record contains a map of parameter name to subrecords. Each subrecord has the fields values, freqs, freqwidths, times, and timewidths giving the values and domains. The domain values are the center and width of each cell.
| std::map<std::string, std::vector<double> > dp3::parmdb::ParmFacade::getValuesMap | ( | const std::string & | parmNamePattern, |
| double | freqv1, | ||
| double | freqv2, | ||
| double | freqStep, | ||
| double | timev1, | ||
| double | timev2, | ||
| double | timeStep, | ||
| bool | asStartEnd = false, |
||
| bool | includeDefaults = false |
||
| ) |
Get the values of the given parameters on the given regular grid where v1/v2 represents center/width or start/end. The vector values in the map are in fact 2-dim arrays with axes freq and time. If freqStep and timeStep are not given (or given as <=0), the default freq and time step from the ParmDB will be used.
|
inline |
|
inline |
The following functions are only implemented for a local ParmDB. The ParmFacadeDistr functions throw an exception. 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.
|
inline |
Set the default step values for the frequency and time axis.
|
inline |
| string dp3::parmdb::ParmFacade::version | ( | const std::string & | type | ) | const |
Get the version info (tree, top, full or other)