Chris Beaumont's IDL Library

Download source code

single page | use frames     summary     class     fields     routine details     file attributes



image processing

smoothmap, val, err, x, y, map, errmap, ctmap, head [, cdelt=cdelt] [, fwhm=fwhm] [, out=out] [, clip=clip] [, galactic=galactic] [, iterate=iterate] [, verbose=verbose] [, cartesian=cartesian]

This procuedure creates a smoothed map of some quantity sampled, with uncertainty, at irregualr points across the sky. It uses a gaussian smoothing filter to average nearby data points and improve noise statistics. The algorithm is taken from Lombardi and Alves 2001. This implementation was written to generate Av maps from the output of the NICER algorithm (also described in Lombardi and Alves 2001, and implemented in the procedure

For pathological cases (sampled points straddle the poles or l=360 deg line), the map dimensions will be calculated incorrectly.


val in required

The sampled values to smooth over

err in required

The uncertainties on the sampled errors (sqrt(variance))

x in required

The x position of the sampled values (treated as a spherical coordinate in DEGREES)

y in required

The y position of the sampled values (treated as a spherical coordiante in DEGREES) ;

map required

A variable to hold the smoothed map

errmap required

A variable to hold the error (sqrt(variance)) on the smoothed map

ctmap required

A variable to hold the map giving the number of sources which went into the calculation of each pixel

head required

A variable to hold the header of the map (A string array)


cdelt in optional

A scalar defining the pixel size of the map in DEGREES. If not defined, cdelt will be set to fwhm / 2.

fwhm in optional

The FWHM of the smoothing kernel, in DEGREES. If not supplied, the fwhm will be set so that, on average, a 1 fwhm diameter circle surrounds 50 datapoints.

out in optional

Write a FITS file of the results. The output files will be named out_map.fits, out_err.fits, and out_ct.fits.

clip in optional

If set, the procedure will iterate and reject outlier data points.

galactic in optional

If set, the coordinates are assumed to be in galactic coordinates. This does not affect the map calculation, but does impact the header file. If not set, the FK5 system is assumed.

iterate in optional

Used internally for the sigma clipping process. Do not set this manually.

verbose in optional

If set, information about the procedure is printed to the terminal.

cartesian in optional

If set, the input and output are in a cartesian (non-spherical) coordinate system

Author information


November 2008: Written by Chris Beaumont based on code by Jon Swift. Written to independently reproduce and speed up that code. December 1 2008: Fixed several bugs in error calculation. cnb. December 4 2008: Fixed things so NANs in the input val variable are ignored. cnb. April 15 2009: Added CARTESIAN keyword March 2010: Deprecated and replaced by skymap_smooth. cnb.

File attributes

Modifcation date: Mon Mar 29 17:02:05 2010
Lines: 326