Fits beam features in a two-dimensional NDF
You may apply various constraints. These are either fixed, or relative. Fixed values include the FWHM, background level, or the shape exponent that defaults to 2 thus fits a normal distribution. Relative constraints define the properties of secondary beam features with respect to the primary (first given) feature, and can specify amplitude ratios, and beam separations in Cartesian or polar co-ordinates.
Four methods are available for obtaining the initial positions, selected using Parameter MODE:
from the parameter system (see Parameters POS, POS2–POS5);
using a graphics cursor to indicate the feature in a previously displayed data array (see Parameter DEVICE);
from a specified positions list (see Parameter INCAT); or
from a simple text file containing a list of co-ordinates (see Parameter COIN).
In the first two modes the application loops, asking for new feature co-ordinates until it is told to quit or encounters an error or the maximum number of features is reached. The last is five, unless Parameters POS2—POS5 define the location of the secondary beams and then only the primary beam’s position is demanded.
BEAMFIT both reports and stores in parameters its results. These are fit coefficients and their errors, the offsets and position angles of the secondary beam features with respect to the primary beam, and the offset of the primary beam from a reference position. Also a listing of the fit results may be written to a log file geared more towards human readers, including details of the input parameters (see Parameter LOGFILE).
[!]
"File"
and "Catalogue"
modes, where the number comes from the number
of beam positions read from the files; and for "Interface" mode when the beam positions
POS, POS2, etc. are supplied in full on the command line without BEAMS. In all modes
there is a maximum of five positions, which for "File"
or "Catalogue"
modes will be
the first five. [1]
TRUE
only circular beams will
be fit. [FALSE]
"File"
. Each line should contain the formatted axis values for a single
position, in the current Frame of the NDF. Axis values can be separated by spaces, tabs or
commas. The file may contain comment lines with the first character #
or !
. TRUE
, a detailed description of the co-ordinate Frame in which the
beam positions will be reported is displayed before the positions themselves. [
current
value]
"Cursor"
. [
Current graphics device]
[!]
[!]
[!]
TRUE
then the model fit will use the
full-width half-maximum values for the beams supplied through Parameter FWHM. FALSE
demands that the FWHM values are free parameters of the fit. [FALSE]
TRUE
, the supplied position of each beam is used and the centre co-ordinates of the
beam features are not fit. FALSE
causes the initial estimate of the location of each beam to
come from the source selected by Parameter MODE, and all these locations are part of the
fitting process (however note the exception when FIXSEP=TRUE
. It is advisable not to use
this option in the inaccurate "Cursor"
mode. [FALSE]
TRUE
, the separations of secondary beams from the primary beam are fixed, and this takes
precedence over Parameter FIXPOS. If FALSE
, the beam separations are free to be fitted
(although it is actually the centres being fit). It is advisable not to use this option in the
inaccurate "Cursor"
mode. [FALSE]
TRUE
.
A number of options are available.
A single value gives the same circular FWHM for all beams.
When Parameter CIRCULAR is TRUE
, supply a list of values one for each of the number of beams.
These should be supplied in the same order as the corresponding beam positions.
A pair of values sets the major- and minor-axis values for all beams, provided Parameter CIRCULAR
is FALSE
.
Major- and minor-axis pairs, whose order should match that of the corresponding beams. Again
CIRCULAR should be FALSE
.
Multiple values are separated by commas. An error is issued should none of these options be offered.
If the current co-ordinate Frame of the NDF is a SKY Frame (e.g. right ascension and declination), then
the value should be supplied as an increment of celestial latitude (e.g. declination). Thus, "5.7"
means
5.7 arcseconds, "20:0"
would mean 20 arcminutes, and "1:0:0"
would mean 1 degree. If the current
co-ordinate Frame is not a SKY Frame, then the widths should be specified as an increment along Axis
1 of the current co-ordinate Frame. Thus, if the Current Frame is PIXEL, the value should be given
simply as a number of pixels.
Null requests that BEAMFIT itself estimates the initial FWHM values. [!]
TRUE
, the shape exponent is fixed to be 2; in other words the beams are modelled as
two-dimensional normal distributions. If FALSE
, the shape exponent is a free parameter in
each fit. [TRUE]
"Catalogue"
.
[!]
"Cursor"
. It indicates which positions are to be marked on the
screen using the marker type given by Parameter MARKER. It can take any of the following
values.
"Initial"
— The position of the cursor when the mouse button is pressed is marked.
"Fit"
— The corresponding fit position is marked.
"Ellipse"
— As "Fit" but it also plots an ellipse at the HWHM radii and orientation.
"None"
— No positions are marked.
[
current value]
TRUE
. It specifies the type of marker with which each cursor position should be marked, and
should be given as an integer PGPLOT marker type. For instance, 0
gives a box, 1
gives a dot, 2
gives
a cross, 3
gives an asterisk, 7
gives a triangle. The value must be larger than or equal to
−31.
[
current value]
"Interface"
— positions are obtained usingparameters POS, POS2–POS5.
"Cursor"
— positions are obtained using the graphics cursor of the device specified by Parameter
DEVICE.
"Catalogue"
— positions are obtained from a positions list using Parameter INCAT.
"File"
— positions are obtained from a text file using Parameter COIN. [
current value]
[]
A comma-separated list of strings should be given in which each string is either
an attribute setting, or the name of a text file preceded by an up-arrow character
"
.
Such text files should contain further comma-separated lists which will be read and interpreted in the
same manner. Attribute settings are applied in the order in which they occur within the list, with later
settings overriding any earlier settings given for the same attribute.
"
Each individual attribute setting should be of the form:
<name>=<value>
where <name>
is the name of a plotting attribute, and
<value>
is the value to assign to the attribute. Default values will be used for any unspecified attributes. All
attributes will be defaulted if a null value (!
)—the initial default—is supplied. To apply changes of
style to only the current invocation, begin these attributes with a plus sign. A mixture of persistent
and temporary style changes is achieved by listing all the persistent attributes followed by a plus sign
then the list of temporary attributes.
See Section E for a description of the available attributes. Any unrecognised attributes are
ignored (no error is reported). [
current value]
TRUE
, the
co-ordinates supplied through POS2–POS5 are interpreted in polar co-ordinates (offset, position
angle) about the primary beam. The radial co-ordinate is a distance measured in units of the
latitude axis if the current WCS Frame is a SKY DOMAIN or the first axis for other Frames.
For a SKY current WCS Frame, position angle follows the standard convention of North
through East. For other Frames the angle is measured from the second axis anticlockwise,
e.g. for a PIXEL Frame it would be from y through negative x, not the standard x through
y.
If FALSE
, the co-ordinates are the regular axis co-ordinates in the current Frame.
POLAR is only accessed when there is more than one beam to fit. [TRUE]
"Interface"
POS specifies the co-ordinates of the primary beam position. This is
either merely an initial guess for the fit, or if Parameter FIXPOS is TRUE
, it defines a fixed location. It
is specified in the current co-ordinate Frame of the NDF (supplying a colon ":"
will display details
of the current co-ordinate Frame). A position should be supplied as a list of formatted
WCS axis values separated by spaces or commas, and should lie within the bounds of the
NDF.
If the initial co-ordinates are supplied on the command line without BEAMS the number of contiguous POS, POS2,…parameters specifies the number of beams to be fit. If the initial co-ordinates are supplied on the command line without BEAMS specified only one beam will be fit.
"Interface"
these parameters specify the co-ordinates of the
secondary beam positions. These should lie within the bounds of the NDF. For each parameter the
supplied location may be merely an initial guess for the fit, or if Parameter FIXPOS is TRUE
, it defines a
fixed location, unless Parameter FIXSEP is TRUE
, whereupon it defines a fixed separation from the
primary beam.
For POLAR = FALSE
each distance should be given as a single literal string containing a space- or
comma-separated list of formatted axis values measured in the current co-ordinate Frame of the NDF.
The allowed formats depends on the class of the current Frame. Supplying a single colon ":"
will
display details of the current Frame, together with an indication of the format required for each axis
value, and a new parameter value is then obtained.
If Parameter POLAR is TRUE
, POS2–POS5 may be given as an offset followed by a position angle. See
Parameter POLAR for more details of the sense of the angle and the offset co-ordinates.
The parameter name increments by 1 for each subsequent beam feature. Thus POS2 applies to the first secondary beam (second position in all), POS3 is for the second secondary beam, and so on. As the total number of parameters required is one fewer than the value of Parameter BEAMS, POS2–POS5 are only accessed when BEAMS exceeds 1.
The co-ordinates are specified in the current WCS Frame of the NDF (supplying a colon ":"
will
display details of the current co-ordinate Frame). A position should be supplied either as a list of
formatted WCS axis values separated by spaces or commas. A null value (!
) requests that the centre of
the supplied map is deemed to be the reference position.
!
) value requests that no residual map be created. [!]
!
) is entered the NDF will not
contain a title. ["KAPPA - BEAMFIT"]
TRUE
, then any
VARIANCE component present within the input NDF will be used to weight the fit; the
weight used for each data value is the reciprocal of the variance. If set to FALSE
or there is no
VARIANCE present, all points will be given equal weight. [FALSE]
TRUE
. features.dat
in the current co-ordinate Frame. Only the first four positions will be used. The
last three positions are in polar co-ordinates with respect to the primary beam. A log of
selected input parameter values, and the fitted coefficients and errors is written to the text file
uranus.log
. uranus_beams.FIT
. The number of beam
features fit is the number of positions in the catalogue subject to a maximum of five. The
input file may, for instance, have been created using the application CURSOR. All positions are supplied and reported in the current co-ordinate Frame of the NDF. A description of
the co-ordinate Frame being used is given if Parameter DESCRIBE is set to a TRUE
value. Application
WCSFRAME can be used to change the current co-ordinate Frame of the NDF before running this
application if required.
The uncertainty in the positions are estimated iteratively using the curvature matrix derived from the Jacobian, itself determined by a forward-difference approximation.
The fit parameters are not displayed on the screen when the message filter environment variable
MSG_FILTER is set to QUIET
.
If the fitting fails there are specific error codes that can be tested and appropriate action taken in
scripts: PDA__FICMX
when it is impossible to derive fit errors, and KAP__LMFOJ
when the fitted
functions from the Levenberg-Marquardt minimisation are orthogonal to the Jacobian’s columns
(usually indicating that FITAREA is too small).
Processing of bad pixels and automatic quality masking are supported.
All non-complex numeric data types can be handled. Arithmetic is performed using double-precision floating point.