ccdsmooth in=image out=image [parameter=value]
Spatial smoothing in X-Y can also be done by creating an image of a beam, which is then convolved with the input image. For example, non-circular beams with a non-zero positon angle (in FITS: BPA) will need to create a beam file using ccdgen(1NEMO) .
For more artistic versions of a smoothing operation, such as added noise and diffraction spikes for bright stars, see ccddiffract(1NEMO) .
To decimate a smoothed cube, ccdslice(1NEMO) can be used to decimate the resulting cube. See EXAMPLES below.
ccdgen "" - noise 0,1 size=1000,1000 seed=123 | ccdsmooth - - 2.0 | ccdstat - | grep dispersion Mean and dispersion : -0.000116 0.334048with the following table showing the resulting RMS for a few values of the B/P ratio
B/P RMS --- ----- 0.0 1.000 1.0 0.796 2.0 0.334 3.0 0.223 4.0 0.168 5.0 0.1367 6.0 0.1160 7.0 0.1012 8.0 0.0917caveat/TBD: this does not follow the expected (?) 1/sqrt(1.1309)/(B/P)
sigma_smooth = -0.133 + 1.52 / beam
Here is an example of creating a beam
image, with 5 x 2.5 beam, and a position angle of 30 degrees, by creating
a disk at pa=-30 and inclination the cos(bmin/bmaj):
ccdgen beam1 gauss 1,5 size=33,33 pa=-30 inc="acosd(0.5)"
When a cube is smoothed, it make sense to decimate the resulting cube.
See ccdslice(1NEMO)
for a method how to decimate. Here is an example of
smoothing a cube with a boxcar of 6 channels, and decimating the cube by
6:
fitsccd cube.fits - | ccdsmooth - - dir=z smooth=1/6::6 | ccdslice - cube6s.ccd zrange=-6
With 68881 on SUN 3/50 (~16Mhz) and 200*200 map - old program (pre-V2.1) Nbeam=17 54s Nbeam=33 98s Nbeam=47 140s HanningThe following are the weights needed in smooth= for subsequent hanning smoothings: 1: 0.25,0.5,0.25 2: 0.0625,0.25,0.375,0.25,0.0625 3: 0.015625,0.09375,0.234375,0.3125,0.234375,0.09375,0.015625 4: 0.00390625,0.03125,0.109375,0.21875,0.273438,0.21875,0.109375,0.03125,0.00390625and these results in a reduction of the RMS by 0.61, 0.52, 0.47 and 0.44 resp. Note this is not the official Hanning definition (0.5-0.5 cos(2.pi.N/(M-1))).
1: 0.25,0.5,0.25 2: 0.08333333,0.25,0.33333333,0.25,0.08333333 3: 0.03661165,0.125,0.21338835,0.25,0.21338835,0.125,0.03661165, 4: 0.0190983,0.0690983,0.1309017,0.1809017,0.2,0.1809017,0.1309017,0.0690983,0.0190983 5: 0.01116455,0.04166667,0.08333333,0.125,0.15550212,0.16666667,0.15550212,0.125,0.08333333,0.04166667,0.01116455which reduce the RMS by 0.61, 0.49, 0.43, 0.38 and 0.34 resp.
export DEBUG=-1 slist=$(nemoinp 0.01,0.25:5:0.25) for s in $slist; do echo -n "$s " ccdgen "" - noise 0,1 size=256,256 | ccdsmooth - - $s | ccdstat - | grep ^Mean | awk ’{print $6}’ ccdgen "" - noise 0,1 size=256,256 | ccdsmooth - - $s | ccdstat - | txtpar - p0=Mean,1,6 done
Teuben
src/image/trans ccdsmooth.c
29-jun-87 V1.0: Created as module from CCD program PJT 30-Jun-87 V1.1: improved ’struct’ filestructure PJT 9-jul-87 V1.2: keyword ’dir’ and keyword order changed PJT 1-jun-88 V2.0: new filestruct, although code is same PJT 5-feb-89 V2.2: general 3D smoothing PJT 11-sep-91 some additional comments PJT 12-mar-98 V3.1: added cut=, fixed fwhm=0.0 PJT 23-jun-21 add EXAMPLE with smoothing noise PJT 31-may-22 documented missing parameters PJT 20-sep-23 V4.0 add beam= PJT