draco.synthesis.noise
Add the effects of instrumental noise into the simulation.
This is separated out into multiple tasks. The first, ReceiverTemperature
adds in the effects of instrumental noise bias into the data. The second,
SampleNoise
, takes a timestream which is assumed to be the expected (or
average) value and returns an observed time stream. The :class: GaussianNoise
adds in the effects of a Gaussian distributed noise into visibility data.
The :class: GaussianNoiseDataset replaces visibility data with Gaussian distributed noise,
using the variance of the noise estimate in the existing data.
Classes
Add Gaussian distributed noise to a visibility dataset. |
|
Generates a Gaussian distributed noise dataset using the noise estimates of an existing dataset. |
|
Generates multiple Gaussian distributed noise datasets. |
|
Add a basic receiver temperature term into the data. |
|
Add properly distributed noise to a visibility dataset. |
- class draco.synthesis.noise.GaussianNoise[source]
Bases:
SingleTask
,RandomTask
Add Gaussian distributed noise to a visibility dataset.
Note that this is an approximation to the actual noise distribution good only when T_recv >> T_sky and delta_time * delta_freq >> 1.
- ndays
Multiplies the number of samples in each measurement.
- Type:
float
- set_weights
Set the weights to the appropriate values.
- Type:
bool
- add_noise
Add Gaussian noise to the visibilities. By default this is True, but it may be desirable to only set the weights.
- Type:
bool
- recv_temp
The temperature of the noise to add.
- Type:
bool
Initialize pipeline task.
May be overridden with no arguments. Will be called after any config.Property attributes are set and after ‘input’ and ‘requires’ keys are set up.
- process(data)[source]
Generate a noisy dataset.
- Parameters:
data (
containers.SiderealStream
orcontainers.TimeStream
) – The expected (i.e. noiseless) visibility dataset. Note the modification is done in place.- Returns:
data_noise – The sampled (i.e. noisy) visibility dataset.
- Return type:
same as parameter data
- setup(manager=None)[source]
Set the telescope instance if a manager object is given.
This is used to simulate noise for visibilities that are stacked over redundant baselines.
- Parameters:
manager (manager.ProductManager, optional) – The telescope/manager used to set the redundancy. If not set, redundancy is derived from the data.
- class draco.synthesis.noise.GaussianNoiseDataset[source]
Bases:
SingleTask
,RandomTask
Generates a Gaussian distributed noise dataset using the noise estimates of an existing dataset.
- dataset
The dataset to fill with gaussian noise. If set to ‘vis’, will ensure autos are real. If not set, will look for a default dataset in a list of known containers.
- Type:
string
Initialize pipeline task.
May be overridden with no arguments. Will be called after any config.Property attributes are set and after ‘input’ and ‘requires’ keys are set up.
- process(data)[source]
Generates a Gaussian distributed noise dataset given the provided dataset’s visibility weights.
- Parameters:
data (
VisContainer
) – Any dataset which contains a vis and weight attribute. Note the modification is done in place.- Returns:
data_noise – The previous dataset with the visibility replaced with a Gaussian distributed noise realisation.
- Return type:
same as parameter data
- class draco.synthesis.noise.MultipleGaussianNoiseDatasets[source]
Bases:
GaussianNoiseDataset
Generates multiple Gaussian distributed noise datasets.
- niter
Number of Gaussian noise datasets to generate.
- Type:
int
Initialize pipeline task.
May be overridden with no arguments. Will be called after any config.Property attributes are set and after ‘input’ and ‘requires’ keys are set up.
- process()[source]
Generate a noise realization.
The variance will be set to the inverse of the weight dataset of the container provided on setup.
- setup(data1, data2=None)[source]
Save the data as a class attribute.
If multiple input containers are provided, the class alternates between them when generating the noise realization. This enables cross power spectrum analysis.
- Parameters:
data1 (
VisContainer
) – Any dataset which contains a vis and weight attribute.data2 (
VisContainer
) – Any dataset which contains a vis and weight attribute.
- class draco.synthesis.noise.ReceiverTemperature[source]
Bases:
SingleTask
Add a basic receiver temperature term into the data.
This class adds in an uncorrelated, frequency and time independent receiver noise temperature to the data. As it is uncorrelated this will only affect the auto-correlations. Note this only adds in the offset to the visibility, to add the corresponding random fluctuations to subsequently use the
SampleNoise
task.- recv_temp
The receiver temperature in Kelvin.
- Type:
float
Initialize pipeline task.
May be overridden with no arguments. Will be called after any config.Property attributes are set and after ‘input’ and ‘requires’ keys are set up.
- class draco.synthesis.noise.SampleNoise[source]
Bases:
SingleTask
,RandomTask
Add properly distributed noise to a visibility dataset.
This task draws properly (complex Wishart) distributed samples from an input visibility dataset which is assumed to represent the expectation.
See http://link.springer.com/article/10.1007%2Fs10440-010-9599-x for a discussion of the Bartlett decomposition for complex Wishart distributed quantities.
- sample_frac
Multiplies the number of samples in each measurement. For instance this could be a duty cycle if the correlator was not keeping up, or could be larger than one if multiple measurements were combined.
- Type:
float
- set_weights
Set the weights to the appropriate values.
- Type:
bool
Initialize pipeline task.
May be overridden with no arguments. Will be called after any config.Property attributes are set and after ‘input’ and ‘requires’ keys are set up.
- process(data_exp)[source]
Generate a noisy dataset.
- Parameters:
data_exp (
containers.SiderealStream
orcontainers.TimeStream
) – The expected (i.e. noiseless) visibility dataset. Must be the full triangle. Make sure you have added an instrumental noise bias if you want instrumental noise.- Returns:
data_samp – The sampled (i.e. noisy) visibility dataset.
- Return type:
same as parameter data_exp