
      Installation Instructions for the Digiphotx Package
      ---------------------------------------------------------------

The IRAF external package, DIGIPHOTX (a new version of the DIGIPHOT package),
is being made available prior to its first official release in IRAF 2.10.3.
DIGIPHOTX contains: 1) a new version of the DAOPHOT package, DAOPHOTX, which
is the IRAF implementation of Peter Stetson's DAOPHOT II package, 2) a new
curve of growth analysis task in the PHOTCALX package, 3) several new tasks
in the PTOOLSX package, 4) minor enhancements and bug fixes to existing
tasks that have been discovered since the last exported version.

The installation instructions that follow describe how to retrieve the
DIGIPHOTX archive file, unpack the source files, build, and link the
package.

Some DIGIPHOTX tasks make use of the STSDAS TABLES package library routines.
In order to successfully link all the DIGIPHOTX executables, the STSDAS
TABLES package must be installed. A copy of the ST TABLES package
retrieval and installation instructions is included at the end of the file.

If you have any questions about or problems with the sofware, please contact
the author (602-325-9221) or davis@noao.edu

[1] The package is distributed as a compressed tar archive; IRAF is distributed
    with a tar reader.  The tar archive may be obtained by magnetic
    tape or anonymous ftp.  For magnetic tape go to step [2] and when
    reading the tar archive simply mount the tape and use the tape
    device name for the archive name in step [4].  To obtain the package
    via ftp (assuming a UNIX computer):

	% ftp 140.252.1.1
	login: anonymous
	password: [your last name]
	ftp> cd iraf.old
	ftp> get digiphotx.readme
	ftp> binary
	ftp> get digiphotx.tar.Z
	ftp> quit
	% uncompress digiphotx.tar

[2] Create a directory to contain the DIGIPHOTX external package files.  This
    directory should be outside the IRAF directory tree and must be owned
    by the IRAF account.  In the following examples, this root directory
    is named usr1:[digiphotx] (VMS) or  /local/digiphotx/ (UNIX).  Make the 
    appropriate file name substitutions for your site.

[3] Log in as IRAF and edit the extern.pkg file in the hlib directory to
    define the package to the CL.  From the IRAF account, outside the CL,
    you can move to this directory with the commands:

	$ set def irafhlib	# VMS example
	% cd $hlib		# UNIX example

    Define the environment variable digiphotx to be the pathname to the
    digiphotx root directory.  The '$' character must be escaped in the VMS
    pathname; UNIX pathnames must be terminated with a '/'.  Edit extern.pkg
    to include:

	reset digiphotx      = usr\$1:[digiphotx]   	# VMS example
	reset digiphotx      = /local/digiphotx/	# UNIX example

	task  digiphotx.pkg = digiphotx$digiphotx.cl

    Near the end of the hlib$extern.pkg file, update the definition of helpdb
    so it includes the digiphotx help database, copying the syntax already used
    in the string.  Add this line before the line containing a closing quote:
        
                ,digiphotx$lib/helpdb.mip\

    NOTE: In IRAF V2.8 the length of the helpdb string cannot exceede 160 
    characters.  A helpdb string longer than 160 characters will cause the
    CL startup process to fail.

[4] Log into the CL from the IRAF account and unpack the archive file.  Change
    directories to the DIGIPHOTX root directory created above and use 'rtar':

	cl> cd digiphotx
	cl> softools
	cl> rtar -xrf <archive>  where <archive> is the host name of the
				 archive file or the IRAF tape
				 device for tape distributions.

   On VMS systems, an error message will appear ("Copy 'bin.generic' to
   './bin fails") which can be ignored.  Also on VMS systems, the four
   bin.'mach' directories created by rtar under [newimred.bin] can be
   deleted.  UNIX sites should leave the symbolic link 'bin' in the DIGIPHOTX
   root directory pointing to 'bin.generic' but can delete any of the 
   bin.`mach' directories that won't be used.  The archive file can be
   deleted once the package has been successfully installed.

[5] When the archive has been unpacked, build the DIGIPHOTX package executable.  
    The compilation and linking of the DIGIPHOTX package is done using the 
    following command:

	cl> mkpkg -p digiphotx update >& digiphotx.spool &

    NOTE: On systems that concurrently support different architectures
    (e.g., Suns, Convex), you must configure the system for the desired
    architecture before issuing the above command.  SUN/IRAF sites must
    execute a pair of 'mkpkg' commands for each supported architecture type.
    The Unix environment variable IRAFARCH must be set as well before
    compiling.  For example:

	# Assuming IRAFARCH is set to ffpa
	cl> mkpkg -p digiphotx ffpa
	cl> mkpkg -p digiphotx update >& digiphotx.ffpa &
	cl> mkpkg -p digiphotx f68881
	# Now reset IRAFARCH to f68881 before continuing
	cl> mkpkg -p digiphotx update >& digiphotx.f68881 &

    The spool file(s) should be reviewed upon completion to make sure there
    were no errors.  


         Installation Instructions for the TABLES Package

		Version 1.3.2 - July 1994

This is the distribution of the TABLES external package that
contains tasks that utilize the STSDAS table format.  These 
instructions describe how to obtain and install the
TABLES layered (external) package to IRAF. Documentation on layered 
software is found in the Site Manager's Guide that accompanied your 
IRAF distribution.  

[1] The package is distributed as a tar archive; IRAF is distributed
    with a tar reader.  The tar archive may be obtained by magnetic
    tape or anonymous ftp.  For magnetic tape go to step [2] and when
    reading the tar archive simply mount the tape and use the tape
    device name for the archive name in step [4].  To obtain the package
    via ftp (assuming a UNIX computer):

	% ftp 130.167.1.2
	login: anonymous
	password: [your email address]
	ftp> cd software/tables
	ftp> get README
	ftp> binary
	ftp> get tables132.tar.Z
	ftp> quit
	% uncompress tables132.tar.Z

    If you are on a VMS machine, or some other machine that does not have
    the UNIX compress utility, get the uncompressed form of the tar file,
    tables132.tar:

 
        % ftp 130.167.1.2
        login: anonymous
        password: [your email address]
        ftp> cd software/tables
        ftp> get README
        ftp> binary
        ftp> get tables132.tar
        ftp> quit

	A PostScript version of installation instructions for the
	Tables package may be found in the directory /software/
	/tables/doc.

[2] Create a directory to contain the TABLES external package files.  This
    directory should be outside the IRAF directory tree and must be owned
    by the IRAF account.  In the following examples, this root directory
    is named usr1:[tables] (VMS) or  /local/tables/ (UNIX).  Make
    the appropriate file name substitutions for your site.

[3] Log in as IRAF and edit the extern.pkg file in the hlib directory to
    define the package to the CL.  From the IRAF account, outside the CL,
    you can move to this directory with the commands:

	$ set def irafhlib	# VMS example
	% cd $hlib		# UNIX example

    Define the environment variable tables to be the pathname to the tables
    root directory.  The '$' character must be escaped in the VMS pathname;
    UNIX pathnames must be terminated with a '/'.  Edit extern.pkg to include:

	reset tables     = usr\$1:[tables]   	# VMS example
	reset tables     = /local/tables/		# UNIX example

	task  $tables.pkg = tables$tables.cl

    Near the end of the hlib$extern.pkg file, update the definition of helpdb
    so it includes the tables help database, copying the syntax already used
    in the string.  Add this line before the line containing a closing quote:
        
                ,tables$lib/helpdb.mip\


[4] Log into the CL from the IRAF account and unpack the archive file.  Change
    directories to the TABLES root directory created above and use 'rtar':

	cl> cd tables
	cl> softools
	cl> rtar -xrf <archive>  where <archive> is the host name of the
				 archive file or the IRAF tape
				 device for tape distributions.

   On VMS systems, an error message will appear ("Copy 'bin.generic' to
   './bin fails") which can be ignored.  Also on VMS systems, the four
   bin.'mach' directories created by rtar under [tables.bin] can be
   deleted.  UNIX sites should leave the symbolic link 'bin' in the TABLES
   root directory pointing to 'bin.generic' but can delete any of the 
   bin.`mach' directories that won't be used.  The archive file can be
   deleted once the package has been successfully installed.

[5] When the archive has been unpacked, build the TABLES package
    executable.  The compilation and linking of the TABLES package is
    done using the following command:

	cl> mkpkg -p tables update >& tables.spool &

    NOTE: On systems that concurrently support different architectures
    (e.g., Suns, Convex), you must configure the system for the desired
    architecture before issuing the above command.  SUN/IRAF sites must
    execute a pair of 'mkpkg' commands for each supported architecture type.
    The Unix environment variable IRAFARCH must be set as well before
    compiling.  For example:

	# Assuming IRAFARCH is set to ffpa
	cl> mkpkg -p tables ffpa
	cl> mkpkg -p tables update >& tables.ffpa &
	cl> mkpkg -p tables f68881
	# Now reset IRAFARCH to f68881 before continuing
	cl> mkpkg -p tables update >& tables.f68881 &

    The spool file(s) should be reviewed upon completion to make sure there
    were no errors.  

    Also NOTE: On certain UNIX machines (in particular SGI machines) some users
    have had problems using the rtar command to read our source tar.  For this
    problem, use the UNIX system command tar to read the tar files.  Also, even
    using the UNIX tar, the links in tables$lib are not read correctly, and the
    easiest thing to do is delete these links.

    More explicit instructions on installation of TABLES may be found in the
    directory /software/tables/doc/install_guide.ps.  If you are not able to
    print the file, please contact STSDAS Hotseat at hotseat@stsci.edu by email
    or (410) 516-5100 by phone.


		     Release Information

==============================================================================
IRAF 2.10.4 generated:  May 29, 1995 

==============================================================================
Archive:  July 3, 1995 

    Fixed a bug which was causing seepsf to fail for purely analytic
    images.

==============================================================================
Archive:  July 18, 1995 

    Fixed an out-of-bounds array problem that was causing the seepsf task
    to die with an FPE error on Dec Alpha OSF/1 systems, and could produce
    bad values for pixels more that psfrad pixels from the center of the
    psf model for other systems.

==============================================================================
Archive:  Aug 25, 1995 

    Fixed a bug in the psf task 'd' keystroke command procedure that was
    causing a segvio on Solaris but not SunOS systems. This bug could 
    cause trouble in the task on any system depending on the sequence of
    commands executed by the user.

==============================================================================
IRAF 2.10.4.1 patch 1 generated:  August 30, 1995 

==============================================================================
Archive: September 21, 1995

    Modifed the way the magnitude of the psf is set. If matchbyid is
    yes (the default) the magnitude of the first psf star in the psf
    star list if any will be used; other wise the magnitude of the first
    psf star in the input photometry file will be used as before. This
    should help minimize photometric drift problems derived from repeated
    iterations.


==============================================================================
Archive: September 22, 1995

    Added a note about the above change to the psf task help page.


==============================================================================
Archive: October 5, 1995

    Modified the centering algorithm code to recognize 3 separate
    thresholding cases: 1) cthreshold = 0.0 invokes the default thresholding
    technique for each algorithm, 2) cthreshold = +val sets the threshold to
    some value above (below) the local data minimum (maximum), 3)
    cthreshold=INDEF or undefined turns off all thresholding. This change
    does not change the default behavior of the code for cthreshold=0.0.

    Changed the definition of local data minimum from the minimum pixel
    in the centering box to the minimum median value for each row in the
    centering box. This gives a value much closer to the background values
    and protects against very low valued pixels in the centering box defining
    the thresholding level.


==============================================================================
Archive: October 7, 1995

    Modified the obsfile task and as a result the mk(n)obsfile script tasks
    as well to accept long (> 161 characters) lines in the input photometry
    files. The change avoids problems with the ttools task tdump used to
    extract the fields of interest: image name, x, y, magnitude, magnitude
    and error, exposure time, airmass, filter, and time of observation from
    ST tables and which due to the internal formatting can exceed the default
    size of an iraf image line.

    Added some missing commas to the column template string sent to the pdump
    task when the input photometry files are ST tables, a bug which resulted in
    the first 1-9 apertures not being written to the output file, and either
    a fit did not converge message in non-interactive mode or a floating
    divide by zero error message in interactive mode.


==============================================================================

Archive: January 5, 1996

    Added a singular matrix check to the nstar task to avoid rare floating
    operand errors. Objects producing the singular matrix errors are rejected
    one by one and remaining stars in the group are refit. If refitting the
    sky value is causing the problem then the entire group is rejected.

    Fixed a bug in the code that allocated space for the error code array,
    to avoid possible memory corruption errors.  If the size of the group 
    was greater than maxgroup then, the error code values could run off
    the end of the array causing problems.

==============================================================================

Archive: January 30, 1996

    Modified the mkapfile/apfile tasks to avoid going into an infinite
    loop while fitting the seeing radius parameter RO for an image. The
    infinite loop situation can arise if there is bad data in the input
    file, where bad data in this sense means one or more curves of growth
    for objects which are not stars, e.g. cosmic rays or galaxies. The
    code was modified so that if RO cannot be fit after a reasonable
    number of attempts, RO is set to INDEF, and a  fit cannot converge
    message is issued to the user. The plotting and output routines
    were modified in order to deal with indefinite values of RO.

==============================================================================

Archive: February 12, 1996

    Modified the apphot tasks so that the interactive m keystroke command
    works as advertised instead of performing the function of the n
    keystroke command.

==============================================================================

Archive: February 20, 1996

    Added a new parameter mergerad to the daopars parameter set. Mergerad
    permits the user to control the merging process. If mergerad is 0
    object merging is turned off altogether. If mergerad is INDEF to default
    mergeing radius is used. Otherwise the user can set the merging radius
    to a specific value.

    Changed the name of the critoverlap parameter to critsnratio to avoid
    user confusion over the meaning to the parameter.

    Fixed a bug in the code which parses the input photometry or group files.
    If the numerical field to be extracted (e.g. ID) is adjacent to another
    numerical field and there is no intervening white space, then the 
    extracted number may be incorrect. This situtation is most likely to occur
    when the photometry files are the output of the phot task, the number
    of measured objects is large > 9999, and the input image and / or coordinate
    file names begin with a number, e.g. 8649.imh and / or 8649.coo.1.


==============================================================================

Archive: March 7, 1996

    Fixed a uninitialized memory bug in the allstar task which could cause
    floating point errors if the user set the readout noise to zero. This
    error should up in the daophot test script daotest on the Dec Alpha
    machines but could occur on any host machine.

==============================================================================

Archive: March 18, 1996

    Fixed a serious bug in the daofind centering code which resulted
    in incorrect fractional pixel corrections being computed and added to
    the initial integer centers. This error can most easily be detected by
    plotting the histogram of the fractional pixel corrections for an image
    with a large number of detected objects.  The histogram will be modulated
    with "peaks" around the .33 and .66 fractional pixel values.

    This bug is also present in the standalone version of daophot ii. Users
    should obtain a new version of daophot ii from Peter Stetson.

    Added a new roundness statistic to daofind. This statistic compares a
    measurement of the bilateral symmetry of an object to its four-fold
    symmetry and is sensitive to objects which are elongated in directions
    other than x and y.

=============================================================================

Archive: March 20, 1996

    Fixed a bug in the psf task auto fitting code. If the moffat25 or moffat15
    functions were chosen as the best fitting analytic function, psf was
    not restoring the fitted parameters correctly, resulting in an incorrect
    look-up table being computed. This problem was ocurring because the
    constant valued beta parameter was not being saved and restored during
    the fitting process. 

    Made some minor modifications to the auto psf fitting code so that
    each function always starts from the same initial state as it would if
    it were fit as an individual function.

=============================================================================

Archive: May 2, 1996

    Fixed a floating point precision problem in the invertfit task fitting
    code that was causing the task to occasionally go into an infinite loop
    on the Linux system.

=============================================================================

Archive: May 7, 1996

    Completed fixing the previous problem, which was not completely
    solved by the previous "fix".

=============================================================================

Archive: June 25, 1996

    Added support for the UKIRT faint JHK standards list to the photcal
    package. The new catalog can be accessed using the name "ukirt".

=============================================================================

Archive: July 18, 1996

    Modified the aperture sum and area computations in the qphot, phot, wphot
    radprof, and polyphot tasks to work in double precision instead of real
    precision.

    Modified the code which to output negative as well as positive flux
    values instead of setting the flux to 0.0. The magnitudes for negative
    flux objects are still set to INDEF.

    Fixed a divide by zero error in the daofind code which computes the
    new roundness statistic. This bug is rare but can occur if most of
    the pixels around an object are below datamin.

=============================================================================

Archive: February 21, 1997

    The pstselect and psf star tasks were not always reinitializing the psf
    star list correctly in the case that more than one image was being
    analyzed in a single run. In the case of the pstselect task, psf stars
    whose ids were identical to the ids of psf stars in previous images were
    being arbitrarily rejected from the psf star list. In the case of the psf
    task, psf stars from a previous psf star list might be included in the 
    psf star list.

=============================================================================

Archive:  March 14, 1998

    Upgraded the archive version of digiphotx to:

    1) fix some minor bugs including, 1) a rare floating divide by zero
    condition that can occur in the daofind task, and 2) some fits kernel
    related problems in the psf task. 

    2) include support for dir$default style names in the daophot package
    tasks addstar, allstar, group, nstar, peak, psf, pstselect, and substar.
    These have always been supported in the apphot package and in the
    daophot package tasks daofind and phot.

    3) modify the old default apphot package zero point of 26.0 to 25.0
    to bring it into agreement with the daophot package and the iraf
    2.11 versions of apphot, daophot, and the imexamine task.

=============================================================================

Archive: April 1, 1998

    Upgraded the archive version of digiphotx to:

    Fix a bug in the psf task psf image list reading code that could
    produce incorrect PSFIMAGE values in the headers of the output
    *.psg.* and *.pst.* files if the input psf image list was an
    @file list. The task functioned correctly but tasks which tried
    to read the *.psg.* or *.pst.* file would quit with an error.
    The workaround was to manually edit the PSFIMAGE keyword value to
    remove the control character, usually ^P.

=============================================================================

Archive:  September 11, 1998

    Upgraded the archive version of digiphotx to:

    Modify the allstar task to ensure that all the output and scratch
    images and scratch space are 2D even if the input image is greater than
    2D. Higher dimensioned input images could cause a non-obvious memory
    error if cache=yes. 

=============================================================================

Archive:  April 19, 1999

    Upgraded the archive version of digiphotx to:

    1. Make all the default apphot and daophot input and output file naming
    routines handle input images with kernel sections and cluster indices
    more gracefully.

    2. Added checks to the daophot peak, nstar, and allstar tasks to ensure
    that the predicted errors can never b <= 0.0. This was happening if the
    model fit was exactly 0, the rdnoise was set to 0.0, and proferr was
    set to 0.0.

    3. Added a check to the psf task to avoid a floating point error in the
    radial weighting function that could occur if a point contributing to 
    the analytic fit was very close to fitrad pixels from the center of
    the function. The error was a floating overflow and so far has only
    been see on Linux systems.
    
=============================================================================

Archive:  May 4, 1999

    Upgraded the archive version of digiphotx to:

    1. Fix a bug in the ptools package loading script that was causing it
    to load tables but not the ptools package. This bug does not affect
    the distributed version of ptools, only the digiphotx version.

    2. Added a missing imtclose call to the pstselect task.

=============================================================================

Archive:  May 10, 1999

    Upgraded the archive version of digiphotx to:

    1. Automatically increase the daophot input photometry file buffer size to
    accomodate the entire input star list where appropriate. This affects the
    tasks pstselect, psf, group, allstar, and substar and means that the
    maxnstar parameter is now an initial rather than maximum buffer size.
    This change also fixes the segmentation violation that could occur in
    these tasks if the buffer overflowed.

    2. Modified the psf task psf star group file writing code to initialize
    the table row numbers correctly in the case that daophot.text=no.
    The code was working correctly on Sun systems but failed under Linux.

=============================================================================
