Loading...
Searching...
No Matches
casacore::LatticeAddNoise Class Reference
lattices package (libcasa_lattices) » LatticeMath_module

More...

`#include <LatticeAddNoise.h>`

## Public Member Functions

| LatticeAddNoise ()
| Default constructor.
| LatticeAddNoise (Random::Types type, const Vector< Double > &parameters, Int seed1=0, Int seed2=1)
| 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 > &parameters)
| Set a new distribution.
template<class T>
void | add (Lattice< T > &lattice)
| Add noise of given type to lattice.
template<class T>
void | add (MaskedLattice< T > &lattice)

## Private Member Functions

void | addNoiseToArray (Array< Float > &data)
| Add noise to array.
void | addNoiseToArray (Array< Complex > &data)
void | addNoiseToArray (Array< Double > &data)
void | addNoiseToArray (Array< DComplex > &data)
void | makeDistribution ()
| Make noise generator.

## Private Attributes

Random::Types | itsType
Vector< Double > | itsParameters
MLCG | itsGen
Random * | itsNoise

## Detailed Description

Add noise from specified distribution to a lattice

### Intended use:

Public interface

### Review Status

Date Reviewed:
  yyyy/mm/dd

### Prerequisite

- Lattice
- Random

### Synopsis

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.

### Example

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);
casacore::ArrayLattice
Definition ArrayLattice.h:144
casacore::IPosition
Definition IPosition.h:117
casacore::LatticeAddNoise::LatticeAddNoise
LatticeAddNoise()
Default constructor.
casacore::Random::NORMAL
@ NORMAL
2 parameters, the mean and variance.
Definition Random.h:455
casacore::Vector
Definition Vector.h:82

Definition at line 79 of file LatticeAddNoise.h.

## Constructor & Destructor Documentation

## LatticeAddNoise() [1/3]

casacore::LatticeAddNoise::LatticeAddNoise | ( |  | ) |

Default constructor.

Referenced by LatticeAddNoise(), and operator=().

## LatticeAddNoise() [2/3]

casacore::LatticeAddNoise::LatticeAddNoise | ( | Random::Types | type,
|  | const Vector< Double > & | parameters,
|  | Int | seed1 = 0,
|  | Int | seed2 = 1 )

Constructor.

An exception will occur if we cannot generate the distribution (e.g. illegal parameters). seed1 and seed2 are used to seed the MLCG object.

## LatticeAddNoise() [3/3]

casacore::LatticeAddNoise::LatticeAddNoise | ( | const LatticeAddNoise & | other | ) |

Copy constructor (copy semantics).

References LatticeAddNoise().

## ~LatticeAddNoise()

casacore::LatticeAddNoise::~LatticeAddNoise | ( |  | ) |

Destructor.

## Member Function Documentation

## add() [1/2]

template<class T>

void casacore::LatticeAddNoise::add | ( | Lattice< T > & | lattice | ) |

Add noise of given type to lattice.

For complex types, 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.

## add() [2/2]

template<class T>

void casacore::LatticeAddNoise::add | ( | MaskedLattice< T > & | lattice | ) |

## addNoiseToArray() [1/4]

void casacore::LatticeAddNoise::addNoiseToArray | ( | Array< Complex > & | data | ) |

private

## addNoiseToArray() [2/4]

void casacore::LatticeAddNoise::addNoiseToArray | ( | Array< DComplex > & | data | ) |

private

## addNoiseToArray() [3/4]

void casacore::LatticeAddNoise::addNoiseToArray | ( | Array< Double > & | data | ) |

private

## addNoiseToArray() [4/4]

void casacore::LatticeAddNoise::addNoiseToArray | ( | Array< Float > & | data | ) |

private

Add noise to array.

For Complex, noise is added to real and imaginary separately.

## makeDistribution()

void casacore::LatticeAddNoise::makeDistribution | ( |  | ) |

private

Make noise generator.

## operator=()

LatticeAddNoise & casacore::LatticeAddNoise::operator= | ( | const LatticeAddNoise & | other | ) |

Assignment (copy semantics).

References LatticeAddNoise().

## set()

void casacore::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).

## Member Data Documentation

## itsGen

MLCG casacore::LatticeAddNoise::itsGen

private

Definition at line 120 of file LatticeAddNoise.h.

## itsNoise

Random* casacore::LatticeAddNoise::itsNoise

private

Definition at line 121 of file LatticeAddNoise.h.

## itsParameters

Vector<Double> casacore::LatticeAddNoise::itsParameters

private

Definition at line 119 of file LatticeAddNoise.h.

## itsType

Random::Types casacore::LatticeAddNoise::itsType

private

Definition at line 118 of file LatticeAddNoise.h.

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

- lattices/LatticeMath/LatticeAddNoise.h