DP3
Public Types | Public Member Functions | Static Public Member Functions | List of all members
dp3::parmdb::ParmValue Class Reference

A class containing the values of a parameter. More...

#include <ParmValue.h>

Public Types

enum  FunkletType { Scalar = 0 , Polc = 1 , PolcLog = 2 }
 Define the possible funklet types. More...
 
typedef std::shared_ptr< ParmValueShPtr
 Define a shared pointer for this type. More...
 

Public Member Functions

 ParmValue (const ParmValue &)
 Copy constructor makes a deep copy. More...
 
 ParmValue (double value=0.)
 Construct with the given scalar value. More...
 
 ~ParmValue ()
 
const GridgetGrid () const
 Get the grid. More...
 
bool hasErrors () const
 Are there errors? If false, the result of getErrors is undefined. More...
 
ParmValueoperator= (const ParmValue &)
 Assignment makes a deep copy. More...
 
bool rescale (double sx, double ex, double sy, double ey, const Box &oldDomain)
 
void setCoeff (const casacore::Array< double > &)
 Set as an array of coefficients. More...
 
void setErrors (const casacore::Array< double > &)
 
void setScalar (double value)
 Set as a single scalar value. More...
 
void setScalars (const Grid &, const casacore::Array< double > &)
 
unsigned int nx () const
 
unsigned int ny () const
 
const casacore::Array< double > & getValues () const
 
casacore::Array< double > & getValues ()
 
const casacore::Array< double > & getErrors () const
 
casacore::Array< double > & getErrors ()
 
int getRowId () const
 
void setRowId (int rowId)
 
void clearRowId ()
 

Static Public Member Functions

static casacore::Matrix< double > scale2 (const casacore::Matrix< double > &coeff, double offx, double offy, double scalex, double scaley)
 

Detailed Description

A class containing the values of a parameter.

ParmValue holds the values of a given parameter and domain. The object does not hold the name and domain info itself. Instead its parent object ParmValueSet holds this information. The value is a 2-dim array holding scalar values or the coefficients of a 2-dim funklet. Thus if the parm is a scalar, a ParmValue object can hold the values of multiple domains. If it's a funklet, only one domain is held.

Member Typedef Documentation

◆ ShPtr

typedef std::shared_ptr<ParmValue> dp3::parmdb::ParmValue::ShPtr

Define a shared pointer for this type.

Member Enumeration Documentation

◆ FunkletType

Define the possible funklet types.

Enumerator
Scalar 

A constant scalar.

Polc 

A polynomial.

PolcLog 

A polynomial of logs.

Constructor & Destructor Documentation

◆ ParmValue() [1/2]

dp3::parmdb::ParmValue::ParmValue ( double  value = 0.)
explicit

Construct with the given scalar value.

◆ ParmValue() [2/2]

dp3::parmdb::ParmValue::ParmValue ( const ParmValue )

Copy constructor makes a deep copy.

◆ ~ParmValue()

dp3::parmdb::ParmValue::~ParmValue ( )

Member Function Documentation

◆ clearRowId()

void dp3::parmdb::ParmValue::clearRowId ( )
inline

◆ getErrors() [1/2]

casacore::Array<double>& dp3::parmdb::ParmValue::getErrors ( )
inline

◆ getErrors() [2/2]

const casacore::Array<double>& dp3::parmdb::ParmValue::getErrors ( ) const
inline

Get the arrays with errors. Undefined if getErrors()==false.

◆ getGrid()

const Grid& dp3::parmdb::ParmValue::getGrid ( ) const
inline

Get the grid.

◆ getRowId()

int dp3::parmdb::ParmValue::getRowId ( ) const
inline

Get/set the rowid to remember where the value is stored in the ParmDB.

◆ getValues() [1/2]

casacore::Array<double>& dp3::parmdb::ParmValue::getValues ( )
inline

◆ getValues() [2/2]

const casacore::Array<double>& dp3::parmdb::ParmValue::getValues ( ) const
inline

Get the values.

◆ hasErrors()

bool dp3::parmdb::ParmValue::hasErrors ( ) const
inline

Are there errors? If false, the result of getErrors is undefined.

◆ nx()

unsigned int dp3::parmdb::ParmValue::nx ( ) const
inline

Get the value shape.

◆ ny()

unsigned int dp3::parmdb::ParmValue::ny ( ) const
inline

◆ operator=()

ParmValue& dp3::parmdb::ParmValue::operator= ( const ParmValue )

Assignment makes a deep copy.

◆ rescale()

bool dp3::parmdb::ParmValue::rescale ( double  sx,
double  ex,
double  sy,
double  ey,
const Box oldDomain 
)

If needed rescale polynomial coefficients from the old domain to the new domain given by the start and end values. It returns true if rescaling was actually done.

◆ scale2()

static casacore::Matrix<double> dp3::parmdb::ParmValue::scale2 ( const casacore::Matrix< double > &  coeff,
double  offx,
double  offy,
double  scalex,
double  scaley 
)
static

Return the scaled coefficients of a 2D polynomial using the given offset and scale factor.

◆ setCoeff()

void dp3::parmdb::ParmValue::setCoeff ( const casacore::Array< double > &  )

Set as an array of coefficients.

◆ setErrors()

void dp3::parmdb::ParmValue::setErrors ( const casacore::Array< double > &  )

Set the errors. They must have the same shape as the values, so the values must have been set before.

◆ setRowId()

void dp3::parmdb::ParmValue::setRowId ( int  rowId)
inline

◆ setScalar()

void dp3::parmdb::ParmValue::setScalar ( double  value)

Set as a single scalar value.

◆ setScalars()

void dp3::parmdb::ParmValue::setScalars ( const Grid ,
const casacore::Array< double > &   
)

Set as an array of scalar values with the grid. The shape of grid and values must match.


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