Sets values for an axis array component within an NDF data structure
If an AXIS structure does not exist, a new one whose centres are pixel co-ordinates is created before any modification.
"NDF"
. The supplied NDF must be one dimensional and must be aligned in
pixel co-ordinates with the NDF axis that is being modified. "Centre"
, "Data"
, "Error"
, "Width"
or "Variance"
. "Data"
and "Centre"
are synonyms and selects the axis centres. "Variance"
is the variance of the
axis centres, i.e. measures the uncertainty of the axis-centre values. "Error"
is the alternative to "Variance"
and causes the square of the supplied error
values to be stored. "Width"
selects the axis width array. ["Data"]
1
for a
one-dimensional NDF. DIM is not accessed when COMP="Centre"
and MODE="Delete"
.
The suggested default is the current value. []
Here are some examples. Suppose the axis centres are being changed,
then EXPRS="INDEX-0.5"
gives pixel co-ordinates, EXPRS="2.3
∗ INDEX
+
10"
would give a linear axis at offset 10 and an increment of 2.3 per pixel,
EXPRS="LOG(INDEX∗5.2)"
would give a
logarithmic axis, and EXPRS="CENTRE+10"
would add ten to all the array centres. If COMP="Width"
, EXPRS=0.96 would set all the widths to 0.96, and
EXPRS="SIND(INDEX-30)+2"
would assign the widths to two plus the sine of the pixel index with respect to index
30 measured in degrees.
EXPRS is only accessed when MODE="Expression"
.
"File"
. The suggested default is the current value. !
) terminates the loop
during multiple replacements. This parameter is only accessed when MODE="Edit"
. The
suggested default is the current value. !
) value is
supplied for LIKE. If the NDF being modified extends beyond the edges of the template
NDF, then the template axis arrays will be extrapolated to cover the entire NDF. This
is done using linear extrapolation through the last two extreme axis values. [!]
"Delete"
–- Deletes the array, unless COMP="Data"
or "Centre"
whereupon the whole axis
structure is deleted.
"Edit"
–- Allows the modification of individual elements within the array.
"Expression"
–- Allows a mathematical expression to define the array values. See
Parameter EXPRS.
"File"
–- The array values are read in from a free-format text file.
"Linear_WCS"
–- The axis centres are set to the least-squares linear fit to the values
of the selected axis in the current co-ordinate Frame of the NDF. This is useful
for exporting to packages with limited FITS WCS compatibility and when the
non-linearity is small. "Linear_WCS"
is only available when COMP="Data"
or
"Centre"
.
"NDF"
–- The axis centres are set to the corresponding Data values read from the NDF
specified by Parameter AXISNDF. This is only available when COMP="Data"
or
"Centre"
.
"Pixel"
–- The axis centres are set to pixel co-ordinates. This is only available when
COMP="Data"
or "Centre"
.
"WCS"
–- The axis centres are set to the values of the selected axis in the current
co-ordinate Frame of the NDF. This is only available when COMP="Data"
or "Centre"
.
"Bad"
instructs that the bad
value appropriate for the array data type be substituted. Placing NEWVAL on the
command line permits only one element to be replaced. If there are multiple
replacements, a null value (!
) terminates the loop. This parameter is only accessed
when MODE="Edit"
. "_REAL"
or "_DOUBLE"
. It is only accessed for
MODE="File"
, "Expression"
, or "Pixel"
. If a null (!
) value is supplied, the value
used is the current data type of the array component if it exists, otherwise
it is "_REAL"
. [!]
"25.3+0.2∗MOD(INDEX,8)"
,
in other words the noise has a constant term (25.3), and a cyclic ramp component of
frequency 8 pixels. An end-of-file error results when MODE="File"
and the file does not contain sufficient
values to assign to the whole array. In this case the axis array is unchanged. A
warning is given if there are more values in a file record than are needed to complete
the axis array.
An invalid expression when MODE="Expression"
results in an error and the axis array is
unchanged.
The chapter entitled “The Axis Coordinate System” SUN/33 describes the NDF axis co-ordinates system and is recommended reading especially if you are using axis widths.
There is no check, apart from constraints on Parameter NEWVAL, that the variance is not negative and the widths are positive.
# Axis Centres along second dimension
-3.4 -0.81
.1 3.3 4.52 5.6 9 10.5 12. 15.3 18.1 20.2
23 25.3 ! a comment
26.8,27.5 29. 30.76 32.1 32.4567
35.2 37.
<EOF>