NRAO Home > CASA > CASA Toolkit Reference Manual
image.addnoise - Function

1.1.1 Add noise to the image


Description

This function adds noise to the image. You may zero the image first before the noise is added if you wish.

The noise can be drawn from one of many distributions.

For each distribution, you must supply the type via the type argument (minimum match is active) and parameters via the pars argument. Briefly:

Arguments





Inputs

type

Type of distribution, normal

allowed:

string

Default:

normal

pars

Parameters of distribution

allowed:

doubleArray

Default:

0.0 1.0

region

Region selection. See ”help par.region” for details. Default is to use the full image.

allowed:

any

Default:

variant

zero

Zero image first?

allowed:

bool

Default:

false

seeds

Seeds to use for the random number generator. If not specified, seeds are created based on the current time.

allowed:

intArray

Default:

Returns
bool

Example

 
 
"""  
ia.maketestimage()  
ia.addnoise(type=’normal’, pars=[0.5, 1], zero=T, seeds=[1,2])  
ia.statistics()  
ia.close()  
"""  
 
A test image is created, zeroed, and noise of mean 0.5 and variance 1  
from a normal distribution added. Specifying the same combination of seeds  
ensures the same random number sequence is created each time addnoise is called.  
To have different sequences created during the same casapy session, use the default  
value (which is an empty list).  
 

__________________________________________________________________


More information about CASA may be found at the CASA web page

Copyright 2016 Associated Universities Inc., Washington, D.C.

This code is available under the terms of the GNU General Public Lincense


Home | Contact Us | Directories | Site Map | Help | Privacy Policy | Search