Section 13: APPLICATIONS

What is the meaning of the coefficients returned with the CURFIT task?

 These coefficients are described in the design document for the curfit math
package, which is called by the curfit task.  The document can be printed with
the following command:
     cl> help math$curfit/doc/curfit.spc fi+ | lprint
Sections 3.2 (algorithms) and 6 (references) are most useful.  Note that curfit
evaluates the spline explicitly, NOT with look-up tables; the algorithms
section is out of date and the comments about look-up tables should be
ignored.  The references used when writing the cubic spline code are:
    (1) Carl de Boor, "A Practical Guide to Splines", 1978,  Springer-Verlag
        New York Inc.
    (2) P.M.  Prenter,  "Splines  and Variational Methods", 1975, John Wiley
        and Sons Inc.
     The curfit package uses the least squares cubic spline described
in detail in Chapter 14 of reference (1). The actual spline functions
are the cardinal-B splines appropriate for fitting data with uniformly
spaced knots. The cubic splines can be represented in terms of derivatives
as you mentioned or as polynomial coefficients. The IRAF curfit package uses
the latter representation.  The transformation from one to the other is
described in the above references.
     Finally you might find it useful to look at a couple of the
routines in the curfit package itself. The following will give you the
clearest idea of how the the spline function is evaluated once the
coefficients are fit.
               math$curfit/cvevalr.x
               math$curfit/cv_b1evalr.x
Given the fit the first routine evaluates the fitted spline at an arbitrary
value of x by calling the second routine which does the actual mathematics.
The second routine first normalizes the data, then figures out which
spline piece it belongs to, then computes the non-zero spline functions which
will be multiplied by the appropriate coefficients.
     If the purpose of your query is to figure out how to take the
coefficients and use them in your program as opposed to a simple
how does it work question, you will have to understand how the
normalization is done and the routine to look at is the following
               math$curfit/cvinitr.x

What does "ERROR: MWCS: dimension mismatch (mw_translate)" mean?

      This message means there is some error in the image header dealing
with the description of the world coordinate system (WCS).  In particular
the WCSDIM keyword is incorrect.  The value of this keyword should
either match the dimensionality of the image if there is no WAXMAP01
keyword or half of the number of elements in that keyword if
present (that is if there are 6 numbers then WCSDIM should be 3).
How does this happen?  The most common way is that
the images produced by the APEXTRACT package when the "extras" parameter
is set, which produces 3D images, has a bug that sets WCSDIM=2.  This
can be easily fixed by:
        cl> hedit <images> wcsdim 3
        cl> hedit <images> cd3_3 1. add+
        cl> hedit <images> ltm3_3 1. add+
The last two additions are to avoid a "matrix inversion error" because
if the WCS dimensionality is 3 then there must be nonzero elements
for the step per pixel.  The NPROTO.LINPOL task also has a similar
error which may be fixed similarly.  Other possibilities are improper
editing of the image header by a user.

My pixel files were moved to another disk and now the i_pixfile pathname in the image headers is wrong. How can IRAF find the pixels?

 The pixels of an IRAF image are stored separately from the image header.
The pathname to the pixel file is contained in a header parameter referenced as
"pixfile" by the HSELECT and HEDIT tasks.  Users occasionally need to
modify this pixel pathname, most commonly when the disk containing the pixels
has been renamed or if the pixel files have been moved en masse for system
administration reasons to a new location.  The following method enables you to
modify a large number of image headers to contain new pixel pathnames.  The
technique is to first create a temporary file of image names and their current
pixel pathnames using the task HSELECT.  You globally edit this temporary file
to contain the new pixel pathnames and then use the modified file as input to
the HEDIT task.
       cl> hselect *.imh $I,pixfile yes > filin
       .... [do a global edit to filin and edit in the new pixel pathname]
       cl> list="filin"
       cl> {
           while(fscan(list,s1,s2) != EOF)
           hedit(s1,"pixfile",s2,verify-)
           }

How do I turn off the system id banner in output hardcopy plots?

 In any task that uses the GTOOLS interface (like SPLOT but not IMPLOT),
you can turn off the sysid banner with a cursor command.  In interactive cursor
mode, try the command :/help for a full help page.  You'll see:
        :/sysid [yes|no]        Include the standard IRAF user/date banner?
        :/title string          Title
The sysid banner includes information from the CL variable "version":
        cl> show version
        NOAO/IRAF V2.10DEVELOP
So you can modify the sysid banner by resetting "version" to be the null
string or anything you want:
        cl> reset version = ""
You can also reset the CL variable "userid" to personalize the banner.  This
will affect IMPLOT as well as SPLOT plot banners.

How can I find out what tasks are in IRAF?

 	The simplest way to "browse" the system for a task that does something
in particular is to use the REFERENCES task with a keyword.  For example,
        cl> refer photometry
will return a list of all tasks with the keyword 'photometry' in the descript-
ion.  To actually get a list of *every* task in the system you could use
the command "help [a-z]*.", the resulting output will have the description
of each task in every package.

Is the surface photometry package available yet?

	The surface photometry package for IRAF is not yet complete, in fact
work on it has not been started.  In the meantime we are suggesting that sites
look at the ISOPHOTE package in STSDAS.  STSDAS is available via anonymous ftp
to stsci.edu in the software/stsdas directory (note that you will also need
the TABLES package to build this), users can contact the STSDAS support people
directly by writing help@stsci.edu.

I have a spectrum in a one dimensional image for which I had no trouble running IDENTIFY, REIDENTIFY, and REFSPECTRA but when I run DISPCOR I get the error "ERROR: MWCS: attribute not found (spec1)"

    DISPCOR currently only works on pure one dimensional or multispec
images.  In some cases what appears to be a one dimensional image
is not.  The two cases are when an image is really 2D but with an
axis length of 1 for the second axis and when a 1D section of a
2D image has been extracted.  In the first case the image header
will show a size of [###,1] where the first number is the length
and the second number is 1.  In this case apply imcopy or imslice
        cl> imcopy <image>[*,1] <newimage>
and then do the steps for the second case.  In the case of a 1D section
of a 2D image you will find the keywords WCSDIM=2 and WAXMAP01 = '1 0 0 0'.
To turn such an image into a pure 1D spectrum simply delete these
keywords:
        cl> hedit <images> wcsdim,waxmap01 del+ update+
At this point DISPCOR should work.  This situtation applies to V2.10.
In V2.11 DISPCOR has been enhance to work on such data.  In particular,
1D image sections of 2D images and 2D images with spectra along the
lines provided there are 10 or fewer lines (with 1 line being common).

Is there an ASTROMETRY package I can use?

 The ASTROMETRY package is under development now and parts of it are
available in the new IMMATCH package under IMAGES (which was restructured
for V2.11).  While this is not the final form of the ASTROMETRY package,
the new tasks can do a lot of the necessary steps.  In addition, there may
be several alternatives you can use:  The GASP package in STSDAS (available
by anonftp to stsci.edu in the software/stsdas dir) has several tasks:
       eqxy - Get (x,y) from a table of (ra,dec) given the pltsol coeff.
    makewcs - Write the WCS on the image header based on the plate sol.
     pltsol - Calculate plate solution from table of positions.
       xyeq - Get (ra,dec) from a table of (x,y) given the pltsol coeff.
STSDAS is a large external package so I'd see if it's available there
somewhere before installing it, if you have problems or questions you can
contact their support people by writing help@stsci.edu.
	We also use a non-iraf task locally called ASTRO that does plate
solutions, but I think GASP is a better package.  If you're interested in
ASTRO contact Dave Bell (dbell@noao.edu) for more information.

Whom should I contact if I have problems with the xray package?

 Please send email to rsdc@cfa.harvard.edu.
It will help us if you include copies of both banners - that which appears
when you enter IRAF (showing the version number) and that which appears
when you invoke the xray package.  Also useful (depending on your problem)
are your platform and operating system, a copy of the parameter file for the
task that is giving you problems, and a copy of the error message.