noise module
Provides classes to generate noise for data cubes.
- class martini.noise.GaussianNoise(rms: Quantity, Unit("Jy / beam")]=<Quantity 1. Jy / beam>, seed: int = 0)[source]
Bases:
_BaseNoiseImplementation of a simple Gaussian noise model.
Provides a
generate()method producing a cube of Gaussian noise.- Parameters:
- generate(datacube: DataCube, beam: _BaseBeam) Annotated[Quantity, Unit('Jy / arcsec2')][source]
Create a cube containing Gaussian noise.
Some numpy functions such as
numpy.random.normal()strip units, so need to handle them explicitly.- Parameters:
datacube (DataCube) – This method will be called passing the
DataCubeinstance as an argument; its attributes can thus be accessed here.datacube._array.shapeis particularly relevant.beam (_BaseBeam) – This method will be called passing the object derived from
_BaseBeam(for example aGaussianBeam) as an argument. Its attributes can thus be accessed here. The beam size is needed to estimate the pre-convolution rms required to obtain the desired post-convolution rms.
- Returns:
Quantity, with dimensions of flux density. Noise realization with size matching the_array.- Return type:
- reset_rng() None
Reset the random number generator to its initial state.