Program: SMOOTH
Purpose: Smooth sets with a gaussian beam
File: smooth.shl
Author: M. Vogelaar
Category: MANIPULATION, HEADER, FITTING
Keywords:
INSET= Give input set, subsets:
Input set (and subsets). Maximum number of subsets is
2048.
BOX= Frame for input subsets. [entire subset]
OUTSET= Give output set (and subsets):
Output set and subset(s) for the result. The number of
output subsets is the same as the number of input sub-
sets.
** CUTOFF= Give cutoff ratio for gaussian [1/10000]
This is the ratio of the gaussian function values
at central point and a point x on the boundary.
AUTO= Automatic mode? [Y]
In automatic mode, beam parameters of an old beam are,
if possible, calculated from the header and new beam
parameters are asked. Parameters of a convolution func-
tion are calculated by the program, and are used as
initialization for the iteration towards the new beam.
In this mode you need the associated antenna pat-
tern (AP). In non-automatic mode the user can give the
convolution parameters directly.
** WRITECONV= Write convolution function to a set: Y/[N]
Write 2-d gauss data used in convolution to a
set (CONSET=) for further inspection f.i.
OUTCONSET= Output set & subsets for conv. fie.: [none]
Keyword is only asked if WRITECONV=Y
DECIM= Give decimation: [1,1]
There is an upper limit to the decimation, depending on
the size of your input set.
IN automatic MODE THE FOLLOWING KEYWORDS ARE ASKED:
APSET= Give set (, subset) of antenna pattern:
Input of the AP sub structure. Its dimension has
to be 2.
OUTAPSET= Output set (, subset) for AP: [none]
OLDBEAM= Beam sizes old maj, min axes (arcsec):
Size of major, minor axis (FWHM) of the original beam in
arcsec if nothing was found in header. If values were
found in the header of APSET=, these values are default
and the keyword is asked hidden.
OLDPOSANG= Position angle old beam (deg):
Position angle in degrees of major axis wrt. the north
in the direction of the east. If a value was
found in the header of APSET=, this value is default
and the keyword is asked hidden.
NEWBEAM= Beam sizes new maj, min axes (arcsec):
Wanted size of major, minor axis of smoothed new beam in
arcsec. For one dimensional smoothing, give one of the
axes the same value as the original axis and give the
new position angle the same value as the old one.
NEWPOSANG= Give position angle new beam (deg):
Position angle in degrees of major axis of smoothed
beam wrt. the north.
** FITBOX= Minimum size of convolved part of AP used in [11,11]
a least squares fit. The sizes have to be odd and smal-
ler than 127. The default values are the same as in
the program ANTPAT.
** CLIP= Use data in fit with values above a user given [none]
clip level.
** TOLERANCE= Give tolerance in least squares fit: [0.01]
Fitting of the new beam stops when
successive iterations fail to produce a decrement in
reduced chi-squared less than TOLERANCE. If its value
is less than the minimum tolerance possible, it will be
set to this value. This means that maximum accuracy can
be obtained by setting TOLERANCE=0.0.
** EPSILON= Give accuracy in fitted beam (%): [1]
Stop iteration if calculated new beam sizes
and wanted beam sizes don't differ more than epsilon
(percentage!).
** PRESMOOTH= Only presmoothing? [N]
(i.e. determine convolution parameters and scale factor
only)
** SCALE= Scaling factor output subsets. [Calculated]
The scaling factor used will be stored in the descriptor
item SCALEFAC in the output subset(s).
IN non-automatic MODE THE FOLLOWING KEYWORDS ARE ASKED:
OLDBEAM= Beam sizes old maj, min axes (arcsec): [Header values]
or:
Beam sizes old maj, min axes (arcsec): [grid spacings]
Size of major, minor axis (FWHM) of the
original beam in arcsec. The default depends on the
availability of header items BMMAJ en BMMIN in the
header of INSET=
OLDPOSANG= Position angle old beam (deg): [0]
Position angle in degrees of major axis wrt. the north
in the direction of the east.
NEWBEAM= Beam sizes new maj, min axes (arcsec):
Wanted size of major, minor axis of smoothed new beam in
arcsec. For one dimensional smoothing, give one of the
axes the same value as the original axis and give the
new position angle the same value as the old one.
NEWPOSANG= Give position angle new beam (deg): [old PA]
Position angle in degrees of major axis of smoothed
beam wrt. the north.
** CONBEAM= Give maj. & min. axis of con. [Calculated]
beam (arcsec):
Size of major and minor axis in arcsec of the gaussian
convolution function.
** CONPOSANG= Give P.A. (deg) major axis (N->E): [Calculated]
Position angle of major axis wrt North in the
direction of East
SCALE= Give scale factor for output: [Calculated]
Scaling factor output subsets.
Description: SMOOTH Convolves maps to larger beam sizes using a
Gaussian convolution function. This function is cal-
culated by giving the current and the new (wanted) beam
sizes in R.A. and Dec. in arcseconds and the current and
the new position angle of the beam. The position angle
is given in degrees and is measured with respect to the
north in the direction of the east. If this information
is not available, the convolution parameters can be
given by the user. The convolution function is normal-
ized to unity. Note that the definition of Tb (bright-
ness temperature) is not preserved, e.g. a point source
at a certain point of X mJy does not contain the value
X at that point after smoothing. To maintain the same
definition in old and new (smoothed) subsets the latter
can be scaled using the keyword SCALE= The appropriate
scale factors may be determined empirically by using
SMOOTH on an antenna pattern (AP) first, and determining
the factor needed to scale the central value back to
unity.
To facilitate this procedure, SMOOTH can be used in an
automatic mode. Since the original beam usually is not
gaussian, the assumption of its being so leads to a new
beam somewhat different from the one specified. In the
automatic mode first only the appropriate AP is given,
and the wanted new beam. SMOOTH then performs several
iterations, during each one of which the AP is smoothed,
whereby the beam size of the resulting AP converges to
the user given wanted value. Once the convergence has
proceeded far enough the currently valid smoothing para-
meters are preserved, and the appropriate scaling is
determined. With the keywords FITBOX= and CLIP= the user
can modify the default box used in the fit.
Hereafter the program proceeds with smoothing the set,
and if selected, the AP itself. Output for the AP is
specified with the keyword OUTAPSET=
In automatic mode SMOOTH updates the new set header with
the destination of the AP associated with the output.
If output for a smoothed AP is selected, the name of the
input AP will be written in its header.
In non-automatic mode the AP information is removed.
Whenever the smoothing routine encounters a blank
value within the smoothing beam, it sets the smoothed
pixel value to blank. This results in a growth of blanks
in your subset. To avoid this problem, make sure the
subsets don't contain any blanks.
In non-automatic mode, the parameters of the convolution
function can be a direct input also. This is done by
specifying the (hidden) keywords CONBEAM= and CONPOSANG=.
Use dummy values for the other keywords (OLDBEAM=,
NEWBEAM=) that are prompted.
The default value for SCALE= is obtained by convolving
the calculated convolution function with a 2-d gaussian
with maximum amplitude equal to 1 and with parameters
given in OLDBEAM= and OLDPOSANG= The result is a gaussian
of which the central value is not longer equal to zero.
The scale factor is the number that is needed to scale the
central value back to 1.
Notes: There is a limit using large beams. If you want to
smooth with a large beam, it is best to smooth to an
intermediate sized beam first. If you set the output
mode to TEST, you get the presmooth iteration results
in your log-file.
Updates: May 10, 1990: VOG, Document created
Jun 27, 1991: VOG, Presmooth iteration rewritten
Aug 26, 1992: VOG, All rotation related routines
have angle offset wrt pos. X-axis
Dec 5, 1996: VOG, Changed defaults for OLDBEAM= in
non automatic mode
Aug 5, 2008: JPT, Removed redundant write statement