casa
$Rev:20696$
|
Add noise from specified distribution to a lattice. More...
#include <LatticeAddNoise.h>
Public Member Functions | |
LatticeAddNoise () | |
Default constructor. | |
LatticeAddNoise (Random::Types type, const Vector< Double > ¶meters) | |
Constructor. | |
LatticeAddNoise (const LatticeAddNoise &other) | |
Copy constructor (copy semantics) | |
LatticeAddNoise & | operator= (const LatticeAddNoise &other) |
Assignment (copy semantics) | |
~LatticeAddNoise () | |
Destructor. | |
void | set (Random::Types type, const Vector< Double > ¶meters) |
Set a new distribution. | |
void | add (MaskedLattice< Float > &lattice) |
Add noise of given type to lattice. | |
void | add (MaskedLattice< Complex > &lattice) |
void | add (Lattice< Float > &lattice) |
void | add (Lattice< Complex > &lattice) |
Private Member Functions | |
void | addNoiseToArray (Array< Float > &data) |
Add noise to array. | |
void | addNoiseToArray (Array< Complex > &data) |
void | makeDistribution () |
Make noise generator. | |
Private Attributes | |
Random::Types | itsType |
Vector< Double > | itsParameters |
MLCG | itsGen |
Random * | itsNoise |
Add noise from specified distribution to a lattice.
Public interface
This class allows you to add noise from one of many enumerated types to a Lattice. If the Lattice is Complex, then the noise is added to real and imaginary separately.
Vector<Double> pars(2): pars(0) = 0.5; // Mean pars(1) = 0.2; // Variance LatticeAddNoise lan(Random::NORMAL, pars); ArrayLattice<Float> lat(IPosition(2,100,100)); lan.add(lat);
Definition at line 82 of file LatticeAddNoise.h.
Default constructor.
casa::LatticeAddNoise::LatticeAddNoise | ( | Random::Types | type, |
const Vector< Double > & | parameters | ||
) |
Constructor.
An exception will occur if we cannot generate the distribution (e.g. illegal parameters).
casa::LatticeAddNoise::LatticeAddNoise | ( | const LatticeAddNoise & | other | ) |
Copy constructor (copy semantics)
Destructor.
void casa::LatticeAddNoise::add | ( | MaskedLattice< Float > & | lattice | ) |
Add noise of given type to lattice.
For Complex, the noise is added to real and imaginary separately. Any mask is ignored when adding the noise. I.e. noise is added to masked pixels.
void casa::LatticeAddNoise::add | ( | MaskedLattice< Complex > & | lattice | ) |
void casa::LatticeAddNoise::add | ( | Lattice< Float > & | lattice | ) |
void casa::LatticeAddNoise::add | ( | Lattice< Complex > & | lattice | ) |
void casa::LatticeAddNoise::addNoiseToArray | ( | Array< Float > & | data | ) | [private] |
Add noise to array.
For Complex, noise is added to real and imaginary separately.
void casa::LatticeAddNoise::addNoiseToArray | ( | Array< Complex > & | data | ) | [private] |
void casa::LatticeAddNoise::makeDistribution | ( | ) | [private] |
Make noise generator.
LatticeAddNoise& casa::LatticeAddNoise::operator= | ( | const LatticeAddNoise & | other | ) |
Assignment (copy semantics)
void casa::LatticeAddNoise::set | ( | Random::Types | type, |
const Vector< Double > & | parameters | ||
) |
Set a new distribution.
An exception will occur if we cannot generate the distribution (e.g. illegal parameters).
MLCG casa::LatticeAddNoise::itsGen [private] |
Definition at line 122 of file LatticeAddNoise.h.
Random* casa::LatticeAddNoise::itsNoise [private] |
Definition at line 123 of file LatticeAddNoise.h.
Vector<Double> casa::LatticeAddNoise::itsParameters [private] |
Definition at line 121 of file LatticeAddNoise.h.
Random::Types casa::LatticeAddNoise::itsType [private] |
Definition at line 120 of file LatticeAddNoise.h.