GNU Astronomy Utilities

8.2.2 Invoking MakeNoise

MakeNoise will add noise to an existing image. The executable name is astmknoise with the following general template

$ astmknoise [OPTION ...] InputImage.fits

One line examples:

## Add noise with a standard deviation of 100 to image.
## (this is independent of the pixel value: not Poission noise)
$ astmknoise --sigma=100 image.fits

## Add noise to the input image assuming a per-pixel background
## magnitude (with zero point magnitude of 0) and an
## instrumental noise of 20.
$ astmknoise --background=-10 -z0 --instrumental=20 mockimage.fits

If actual processing is to be done, the input image is a mandatory argument. The full list of options common to all the programs in Gnuastro can be seen in Common options. The type (see Numeric data types) of the output can be specified with the --type option, see Input/Output options. The header of the output FITS file keeps all the parameters that were influential in making it. This is done for future reproducibility.

-b FLT

The background value (per pixel) that will be added to each pixel value (internally) to simulate Poisson noise, see Photon counting noise. By default the units of this value are assumed to be in magnitudes, hence a --zeropoint is also necessary. If the background is in units of counts, you need add --bgisbrightness, see Brightness, Flux, Magnitude and Surface brightness.

Internally, the value given to this option will be converted to counts (\(b\), when --bgnotmag is called, the value will be used directly). Assuming the pixel value is \(p\), the random value for that pixel will be taken from a Gaussian distribution with mean of \(p+b\) and standard deviation of \(\sqrt{p+b}\). With this option, the noise will therefore be dependent on the pixel values: according to the Poission noise model, as the pixel value becomes larger, its noise will also become larger. This is thus a realistic way to model noise, see Photon counting noise.


The value given to --background should not be interpreted as a magnitude, but the raw pixel units (usually counts).

-z FLT

The zero point magnitude used to convert the value of --background (in units of magnitude) to flux, see Brightness, Flux, Magnitude and Surface brightness.

-i FLT

The instrumental noise which is in units of flux, see Instrumental noise.

-s FLT

The total noise sigma in the same units as the pixel values. With this option, the --background, --zeropoint and --instrumental will be ignored. With this option, the noise will be independent of the pixel values (which is not realistic, see Photon counting noise). Hence it is only useful if you are working on low surface brightness regions where the change in pixel value (and thus real noise) is insignificant.

Generally, usage of this option is discouraged unless you understand the risks of not simulating real noise. This is because with this option, you will not get Poisson noise (the common noise model for astronomical imaging), where the noise varies based on pixel value. Use --background for adding Poission noise.


Use the GSL_RNG_SEED environment variable for the seed used in the random number generator, see Generating random numbers. With this option, the output image noise is always going to be identical (or reproducible).


Save the output in the double precision floating point format that was used internally. This option will be most useful if the input images were of integer types.