This section brings together a number of the individual ingredients seen earlier into lengthier scripts. So far there is only one.
The following script fits a surface to the background in a series of NDFs. First two bright galaxies are to be excluded from the fitting process by being masked using an ARD region (see SUN/95, “Doing it the ARD way”). It is known that the brighter galaxy is the brightest object in the field and the relative displacement of the two galaxies is constant.
centre
. Since
there are two values, centre
is an array. The value of the first element $centre[1]
is the
co-ordinate from stats, and
the second $centre[2]
is the
co-ordinate. These values are placed in an ARD expression and output to $file".ard"
. calc applies the
offset between the galaxies. The second ARD expression is appended to the same text file. ardmask
then masks the galaxies, surfit performs the background fit, and subtracts it from the original NDF.
The intermediate files are removed. The exit command meaning exit the script is implied at the end of
the file, so it can usually be omitted. You might want to call it to leave the script, when some error is
encountered.
If you want to make the shape and orientation arguments of the script, see the example of UNIX-style options in Section 14.