
DESIGN_SDSS3TEST: New proc to design test plates for SDSS-3.
DESIGN_PLATE: Modified to not use most of the dumb TCL scripts in the
        "plate" product.
EXTRACT_ROW: Catch divide by 0 in reduced chi^2.
LINEBACKFIT: Fix crash condition for when no BACKGROUND vectors are set.
READ1SPEC: Remove this deprecated routine.
SIMPLE_PLATE: This is essentially a re-write of DESIGN_PLATE that
        still calls all the dumb TCL scripts in the "plate" product.
ZCOMPUTE: Add FIXED_TEMPLATE as optional input, and ZANS_FIXED output.
ZFIND: Add optional ZANS_FIXED return keyword from ZCOMPUTE.

doc/www/spectro_home.html: Update for DR5.
etc/spChunkList.par: Add chunks 148-157, 153A.
examples/opECalib-50000.par,opECalib-51430.par,opECalib-51577.par:
	Raise the full well limit to 65535 from 35000, as the detectors
        are not showing signs of saturation.
	Make the (unused) linearity adjustements 1.0, just for clarity.
        PR #6592 discusses these issues in detail.
lib/Makefile: Correctly copy built libraries for platforms other than Linux.

----------------------------------------------------------------
v5_1_4 (May 31, 2006) idlspec2d running on IDL 5.4 - 6.2
Built against specflat v1_6, elodie v1_0, idlutils v5_1_4

EXTRACT_OBJECT: Print a WARNING statement if either RA or DEC are
        missing from the header, since that will result in an invalid
        AIRMASS calculation (see PR #6953).  Also, report AIRMASS=0
        in the header if RA, DEC or TAI are zero.
FITARCIMAGE: Detector wavelength limits were not being accounted for
 	when checking for big wavelength gaps (Loomis).
LRGMODEL_SPECTRA: New routine, split out of LRGMODEL_PHOTOZ and/or LRGSIM,
        for generating the LRG model spectra.
PLATELIST: Fix the bit of code that finds all input plate files to be
        more robust to large number of plates, since a dumb use of
        the FINDFILE() function will overflow.  Instead, first get the
        list of all directories, and then search within each of those.
PLOTSPECQA: Wrapper to PLOTSPEC to select only standard stars or skies.
SDSSPROC: In response to PR #6893 against Son-of-Spectro, don't print
        any error messages if the spawn of 'speclog_version' fails.
        That bash script only exists in the speclog product, which is
        not required for Son-of-Spectro.
SKYSPEC_PARANAL: New function to return the sky spectrum at Paranal.
SKYSUBTRACT: The rescaling of the errors with RELCHI2FIT seems to fail
        in the case where all sky fibers but 4 have been rejected.
        This happened on plate 2333/53679 exposure b1-00034582,
        which is a bright SEGUE plate with all sorts of S/N problems.
SPFRAME_READ: Add option to read superflat vectors from spFrame files.
SPFLUX_V5: We were writing calibration vectors in HDU #0 of the spFluxcalib
        files that were double-precision.  Recast those to single precision.
SPFLUXCORR_V5: Allow a range of 0.1-10 for the flux correction vectors,
        which had been 0.2-5.  There were perverse cases (like for plate 321,
        c.f. PR #6774) where these large flux correction vectors were
        necessary, although the correct solution in that case was to
        reject three bad exposures.  Also, print a Warning message if the
        flux-correction vector is out-of-bounds and then ignored.
SPTEMPLATE_REBIN: New function to read and optionally rebin spectral
        templates.  This is for use for Monte Carlo simulations of
        a spectroscopic survey at different resolutions.
SPTHROUGHPUT: New function to return the throughput and efficiency for
        a given plate+camera+exposure

bin/sprobot_start,sprobot_stop,sprobot.sh: Remove these scripts that
        loaded the Spectro cron robot, which have now been split off
        into the rsync and reduce cron jobs started with spsynrobot_start
        and spredrobot_start.
bin/spsyncrobot_start,spsyncrobot_stop,spsyncrobot.sh,
        spredrobot_start,spredrobot_stop,spredrobot.sh:
        Split sprobot.sh script into an rsync task that will
        be run as a cron job by the "dssdata" user, and a processing task
        that will be run as a cron job by "dssrun" user. The intent is to
        match the photoop userid logic, where data is copied as one
	user and reduced as another. 
doc/www/idlspec2d_install.html,spectro_inspect.html: The CVS repository
        has been changed from spectro.princeton.edu to
        sdsscvs.astro.princeton.edu .
etc/spChunkList.par: Add chunks 139-142, 143-144, 145-147.
examples/opECalib-blank.par: Files with gain, bias, linearity, set to 1,0,1
        to make it a bit easier to investigate raw frames with the standard
        tools (Loomis).
examples/opHdrFix.par: Reject some exposures on plate 321 (M67) where the
        telescope was clearly not guiding.  This addresses PR #6957.
templates/bc03_padova1994_chab_z*_ssp.fit.gz: These are 4 FITS files with
        the full BC03 SP unnormalized grids (ages in years, wavelengths
        in Angstroms, and fluxes).  These files came from Christy Tremonti
        on 14 Feb 2006 with the following notes:  "The ages are kind of
        oddly spaced -- I'm not really sure why, that's just how they come.
        Note that the wavelengths are not uniformly spaced outside of the
        optical and extend to from 90 A - 1600000 A. (If you quickly plot
        wave vs flux, you won't see anything b/c the optical is compressed
        at the left edge of the plot!)  I created these FITS files using
        a handy IDL BC03 reader "im__read_bc03.pro".  It was written by
        John Moustakas."
templates/fluxed_sky_*.fits: These files contain fluxed sky spectra
        from Paranal, all in units of 1e-16 erg/sec/cm^2/A/arcsec^2.
        From http://www.eso.info/observing/dfo/quality/UVES/pipeline/sky_spectrum.html

-------------------------------------------------------------------------------
v5_1_3 (Feb 14, 2006 idlspec2d running on IDL 5.4 - 6.2
Built against specflat v1_6, elodie v1_0, idlutils v5_1_3
for bug fix in fluxing.

FLUX_DISTORTION: Add MAXDPERSTEP keyword with a default value of 0.03,
        which is the maximum peak deviation in flux distortion image
        allowed per iteration from a change in any one parameter.
        This prevents the fit from jumping to crazy solutions with
        high order quadratic terms (PR #6774).  Note that an update
        to the MPFIT code was also necessary for the correct behaviour
        of the MPMAXSTEP parameter.
PLATEMERGE: Add EXCEPT_TAGS keyword, and default to excluding tags
        with the name '*COVAR', since those are typically large
        covariance matrices that I've added recently to the ZANS structure.
QUICKEXTRACT: Bug fix in print statement "Whopping fiber #..."

etc/spChunkList.par: Add chunks 135-137.

-------------------------------------------------------------------------------
v5_1_2 (Feb 2, 2006 idlspec2d running on IDL 5.4 - 6.2
Built against specflat v1_6, elodie v1_0, idlutils v5_1_2
improving robustness of B-spline routines.

APOFLUXCALIB: Generalize this routine to work from any plates, and fix
        to work with the Spectro v5 outputs.
APOPLOT: Break the flux-calibration code out into the FCALIB_DEFAULT function.
CALCSCATIMAGE,COMBINE1FIBER,FIBERFLAT,MYFLUXCALIB,SKYSUBTRACT,
        SMOOTH_SUPERFLAT,SPFLATTEN2,SPFLUX_V5,SUPERFLAT,TELLURIC_CORR:
        Include specification of REQUIREN in call to the B-spline
        fitting code (BSPLINE_ITERFIT) for robustness, often just
        setting this to 1 or 2.
FCALIB_DEFAULT: Function for default flux-calibration vectors, where this
        code is based upon what was internal to APOPLOT.
FIND_NMINIMA: Recast some arguments as double-precision.
GET_TAI: Fix a WARNING message that was always spuriously triggered.
LINEBACKFIT: Fix crash condition when not specifing the background terms.
        Add options ZLIMITS and SIGLIMITS.
PLATEMERGE: Bug fix whereby the SPECPRIMARY flag was not being set properly
        for any object observed multiple times, as pointed out by Hennawi
        in PR #6841.
READONESPEC: Add the CAMERAS option for specifying only blue or red CCDs.
        Set default return values to zero.  Make robust to missing Spectro-1D
        reductions, and just return vectors zeros for SYNFLUX in those cases.
        Propogate the /SILENT flag everywhere.
        Add option to read LINEFLUX, resampled to the output wavelengths.
READPLUGMAP: Make robust to "reddeningMed" in the plug-map file header
        being either missing or not having 5 elements, as happened with
        the Orion plate 1245 on MJD 53742.
SPCOADD_V5: Print the dynamic range off the flux distortion image, and
        print a warning and disable the correction in the dynamic range
        exceeds 100.
SPCOMBINE_V5: Change some print statements (use PRELOG in SPLOG command).
SPFLUX_V5: Print statements.
SPFLUXCORR_V5: If flux-calibration failed (for ex, if no standard stars),
        then issue a warning message and then use FCALIB_DEFAULT() to
        apply a default flux-calibration vector.
SPREDUCE: If plug-map file not found, then print an ABORT message and return.

etc/spChunkList.par: Add chunks 133-134.
examples/spFluxcalib-b1.fits,spFluxcalib-b2.fits,
        spFluxcalib-r1.fits,spFluxcalib-r2.fits: Update thse default flux-
        calibration vectors with the v5 reductions of plate 406/51817
        generated by APOFLUXCALIB.
lib/.cvsignore: Add appropriate files to ignore by "cvs update".

-------------------------------------------------------------------------------
v5_1_0 (Dec 19, 2005 idlspec2d running on IDL 5.4 - 6.2
Built against specflat v1_6, elodie v1_0, idlutils v5_1_0 for upgrading SOS;
fix double-precision on OSX and Linux64.

ARCFIT_GUESS: Change the FIX() functions to LONG(), though I don't believe
        this was causing any trouble.
APO_LOG2HTML,APOREDUCE,BATCH1D,BATCH2D,CATPLOT,SDSSPROC,
APO_PLOTSN,PLOTSN: There was a problem long ago whereby the fiber magnitudes
        from photo changed, and we decided to change the magnitude at which
        Son-of-Spectro computes the S/N for each exposure.  This was fixed
        in Oct 2003 as documented in PR #5642 and sdss-obs/4029.  However,
        the S/N plots from SOS still use the old magnitudes.  I've changed
        those g,r magnitude limits from 20.20,19.90 -> 20.33,20.06 to be
        consistent with the SOS tables.  Note that the old limits will still
        be used by the full Spectro-2D reductions (since those are now tied
        to PSF magnitudes in newly-generated calibObj files).
ATVRAWSPEC: Plot a red column over every bad column, not just a box around
        each bad region.  For ex, the 4 bad columns (1112-1115) on r1 will
        not appear with a 4 red lines.
BATCH2D: Allow PLATENUMS to be integer-valued, in which case they are
        recaste as zero-padded strings that are 4 characters long
        (such that they match the directory names).
CHECKSN,MAKE2DMERGE,SPALLCOMBINE,SPALLREDUCE,SPMULTI,SPPLANCOMB,SPPLAN:
        These are all deprecated Fermi-only routines that would no
        longer work with the v5 versions of this code, so remove them.
COMBINE1FIBER: Make robust to the B-spline code failing (and return zeros).
        Fix a rare crash condition that happened on plate 321: It is
        possible for NUMINSIDE to be zero (on the inner loop), if the
        input data points span an extremely small wavelength range,
        within which there are no output wavelengths.
COMPUTECHI2: Add optional outputs COVAR,VAR.
        Explicitly do all arithmetic in double-precision, due to the change
        in behaviour of IDL on the Mac and 64-bit Linux where matrix multiplies
        have less precision (as described in PR #6754).  If the change is
        only made here, then there is alot of recasting of arrays that
        will slow the code.  Therefore, in practice we'll want to recast
        these arrays in the calling routines (like in ZCOMPUTE).
        Fix the computation of VAR and COVAR in the case of one template
        vector in AMATRIX.
ELODIE_BEST: Trim to stars not labelled as binary or triple stars, according
        to the Q_VR keyword in the Elodie FITS headers.  Rockosi brought
        this to my attention on Sep 20, 2004.
ELODIE_BEST,FITREDSHIFT,FITMEANX,FITWITHMX,MYFLUXCALIB,SDSSPROC,TRACE_FIT:
        Add /double keyword to STDDEV() call, such the behaviour will be
        the same on 32-bit or 64-bit machines.
EXTRACT_BOXCAR,EXTRACT_PROFILE,EXTRACT_ROW,SSHIFTVEC:
        Call IDLUTILS_SO_EXT() to get the suffix for dynamically
        loaded libraries (rather than assuming ".so").
EXTRACT_OBJECT: Write as HDU #8 an image of the relative chi^2, or an
        image of all 1's if no such structure was ever made in the SKYSUBTRACT
        code.  Note that these values are not truncated to be >=1, as they
        are when we re-scale the sky errors.
        If there is a telluric image (which we've deprecated for the v5 code),
        then it is now in HDU #9.
FIBERFLAT: Replace the /EACHGROUP keyword in BSPLINE_ITERFIT with appropriate
        GROUPSIZE keywords.  The former was a holdover from the days
        of the Fortran Slatec code.
FIND_NMINIMA: Catch the status from calling MPFITPEAK, and deal with it
        appropriately if the fit failed.
FINDSPEC: Complete re-write to match against long lists of objects quickly,
        rather than the slow loop over one object at a time.  Also, address
        PR #6583 to deal with the crazy possibility of the same object (with
        the same RA+DEC) appearing on the same plate.
FITARCIMAGE: Print the wavelengths of any rejected arc lines.
FITREDSHIFT,QAPLOT_FCALIBVEC,SOLVEFILTER,SPREDUCE1D,VELDISP,
        FLUX_DISTORTION,SDSSPROC: Change calls from the deprecated STDEV()
        to STDDEV().
FITSN: If fewer than 20 good points within the default fitting mag range,
        then redefine that fitting range to be [0,+1] mag from the median
        of good magnitudes.  This makes the plots look better from Spectro-2D
        and from SOS.  It should also help address PR #6325, by choosing
        more reasonable fit ranges for SEGUE plates with bright stars.
FLUX_DISTORTION: There was a bug in the way objects were being rejected
        in the main iteration loop.  Basically, objects were being rejected,
        but then had chi=0 in the next iteration, and then were put back
        in the fits.  I now have a /nomask option in flux_distort_fn()
        that allows me to compute chi even for rejected points.
        Also, always start the fitting routine with tiny values for
        the coefficients.  This is to prevent us from "walking away" from
        the correction solution in the case where some initially bad points
        effect the fit.
        Add two more terms, which are quadratics in the wavelength parameter
        (one for each spectrograph).  This takes out curvature in the spectra
        which I otherwise couldn't fit out -- though if the AB zeropoints are
        not correct, then these terms enforce consistency but are not correct.
        Add the functionality to have multiple offset pointings on the same
        plate, which is true for SEGUE plates 2247 and 2255 (the latter was
        already observed).  Do the standard flux-distortion corrections from
        the first offset (where OFFSETID=1).  If there are repeated objects
        between that offset and others (as determined by matching RA,Dec),
        then solve for the mean flux-correction vector between those offsets.
        Otherwise, scale the fluxes according to SCI_EXPTIME in the plugmap.
        When fitting for the ratio vectors, use THISIVAR internally instead
        of OBJIVAR (the former masks out bad sky-subtraction regions).
LINEBACKFIT: The calculation of LINEEW_ERR was incorrect, as noted in PR #6235.
LRGMODEL_PHOTOZ: Optionally compute and return FITFLUX.
PCA_CVSTAR,PCA_GAL,PCA_QSO: Insist that all requested spectra exist.
PCA_GAL: Make plots.
PCA_SOLVE: Make loop variables long ints.
        Make the internal arrays double-precision instead of floats
        before calling COMPUTECHI2 due to round-off errors on some
        platforms (PR #6754).
PLATELIST: Use FINDFILE() function to see if files exist before calling
        MRDFITS(); this should be a slight speed-improvement.
        Since the v5 version of this code will combine data with as few as
        1 exposure in a given camera, set the plate quality to 'bad' if there
        is only 1 exposure, or 'mariginal' if only 2 exposures in any given CCD.
        Allow INFILE to be an array.
PLATEMERGE: Add the fields CALIBFLUX,CALIBFLUX_IVAR which are explicitly
        copied over from the plug-map structures.
          Get rid of the ZFILE option in place of the PLATE,MJD options.
          Make robust to the spZLine structures being different for
        different plates, for ex. if different code versions were used.
          Re-write the bit of code that matches objects.  This was necessary
        to address PR #6583, since there are now some bizarre, special
        plates where the same object appears twice.  Note that this also
        fixes the bug whereby some objects are not matched if the plate list
        has incorrect central RA,DEC positions (such as plate 1274 on MJD 52995
        where those values are NaNs).  The new implementation uses SPHEREGROUP.
        Also, the logic for setting SPECPRIMARY was slightly changed.
PLOTSN: Choose which objects are "good" on a filter-by-filter basis,
        to avoid stars with crazy magnitudes (like 0 or -9999) from
        throwing the plots (for example, on SEGUE plate 2255).
        Trivial bug fixes to prevent crashes when making plots with
        a single point.
PLOTSPEC: Add capability to plot reconstructed frames (added by Blanton).
        Fix units on Y axis to /cm^2 instead of /cm (was fixed in v4_9_13
        when plotting to files, but not when to the terminal).
        Break out call to displaying photo images with a call to
        the new routine PLOTSPEC_IMAGE.
PLOTSPEC_IMAGE: New routine called by PLOTSPEC for displaying images
        with calls to the photoop product.
PLUGMAP_TYCHO: New proc for plotting bright Tycho stars on a plate.
QAPLOT_FCALIBVEC: Put plots for each spectrograph on its own page, and
        put offsets between the plots for all objects, F stars, and QSOs
        so that we can see the plots more easily.  Also, smooth the plots
        a little bit after the median-filtering.
QUICKEXTRACT: Remove the end of the warning message for "Whopping fiber"
        which used to say "(may have adverse afffect on S/N)".  This was
        being interpreted as chaning the S/N on the whole plate, when in
        fact it usually just affects a few fibers.
        For the warning message "Large flexure...", append the shift
        number to the message (in response to PR #6239).
        Only print the fiber numbers for the first 5 whopping fibers.
        Change cod to be consistent with SKYSUBTRACT, which now returns
        RELCHI2SET rather than RELCHI2STRUCT.
READPLUGMAP: Fix bug when replacing unknown fluxes in the calibObj
          structure with old values in the plug-map file.
        Add OFFSETID and SCI_EXPTIME to the output structures, which
          are obtained from an optional PLUGMAPTARG structure in the
          plPlugMapM file.  The plate where I've added that is SEGUE plate 2255,
          which has multiple offsets in the same exposure.
        Do not use magnitudes in the input file not in the range [0,50],
          in order to avoid overflows when magnitudes are set to crazy
          values like -999.
        Add missing iobj, so that the call from QUICKTRACE with the /DEREDDEN
          option works.
        Add HDR return keyword, which is used by SPREDUCE routine.
READONESPEC: Return all headers in FRAMEHDR.
READSPEC: Change how the internal procedure READSPEC1 works, such that
        arrays of zeros are returned if data is missing.  This allows us
        to return a good one-to-one list of objects from an input list
        of plate,mjd,fiberid.  However, I'm not positive that this is always
        the desired behaviour.  For ex, requesting a non-existent plate
        will now return 640-element arrays of zeros.
        Make this routine robust to missing data when reading in structures,
        such as plugmap, zline, tsobj.
REDMONSTER: Make robust to the perverse case of the number of (good) pixels
        in the spectrum being less than the median filter size of 25 pixels.
        This happened for saturated data on plate 2333, but does not happen
        on any other plates.
REDUCE_PLATE: Removed (old code).
SDSSPROC: Re-enable the call to 'speclog_version'.
        Add call to FITS_PURGE_NANS in order to address PR #6032, 6084,
        whereby the DA has written invalid FITS header keywords.
        Use the measured read noise (rather than the value in the op file)
        for constructing the inverse variance image.
        Add three more possible warning messages from testing the statistics
        of the bias region:
          "expected read noise = ..., measured = ... DN",
        and
          "bias region difference at xxx-th-percentile =... DN",
        and
          "Amp #... way too many pixels (xxx%) below bias-5*sigma=... DN."
        This replaces the warning message:
          "Std. dev. in bias region for amp#... is ... DN (5-sig clip)".
        These tests should be more robustly sensitive to PR #2335
        (when r2 was randomly flipping bits on 22/23 Aug 2000), and
        the more recent PR #6143 (r2 electronics problems in Aug 2004).
SKYSUBTRACT: Return the trace-set RELCHI2SET instead of RELCHI2STRUCT,
          for use by the EXTRACT_OBJECT code.
        Fix a bug, where the "airmass_correction" term was not squared
          when applied to the sky variance (on line 285).
        Apply a ratio of "number of sky pixels in a breakpoint bin" to the 
          number of degrees of freedom in the fit to the correction to 
          local chi^2.
        Recast "fullfit" to floating-point to avoid returning a double-
          precision sky array.  This was happening due to same changes to
          the B-spline code to support double-precision.
        Replace the /EACHGROUP keyword in BSPLINE_ITERFIT with appropriate
          GROUPSIZE keywords.  The former was a holdover from the days
          of the Fortran Slatec code.
SLITHISTORY: Do not plot missing measurements (zeros).
SMOOTH_SUPERFLAT: Bug fix, whereby we could trigger a warning message when
        the ends of the wavelength range did not have any good data points.
        In such a case, the fits are meaningless, and any value could result.
        This was triggering false warning messages on plate 1053/52468 in r2,
        plate 1051/52468 on r2, etc.  This should now be fixed by setting
        the internal variable RATIO=1 for bad points.
SPBIASAVE,SPFLATAVE: Fix bug where filename matching is off-by-1.
SPBIASGEN: Trivial bug fix to mask bad pixels.
SPCALIB: Change call from SMOOTH_HALO() to SMOOTH_HALO2D() for fitting
        the scattered light background.  This should do a more proper treatment
        of the scattering, but in practice does not seem to make much
        difference.
SPCOADD_V5: Apply the flux-distortion image to the sky vectors, as well
        as to OBJFLUX,OBJIVAR.
        Match objects between exposures by XFOCAL,YFOCAL in the plugmap
        rather than using RA,DEC.  This is because there are the bizarre
        plates like SEGUE plate 2255 that has the same object several times.
        Add keywords NEXP_B1,NEXP_B2,NEXP_R1,NEXP_R2 to output header.
SPCOMBINE_V5: Make the (dangerous!) change of setting the minimum score
        for an exposure to a S/N value of >0 rather than >1.  This is
        necessary for some SEGUE plates, but is dangerous for main survey
        plates if some data is not marked bad.  Hopefully, we'll track
        all those bad data down with PR #6722.
SPFLATGEN: Discard exposures where the quality keyword is set to 'bad'.
SPFLATTEN2: Recast an internal variable to float to prevent double-precision
        output files.
SPFLUX_READ_KURUCZ: This function was pulled out of SPFLUX_V5.
SPFLUX_V5: Pull out the SPFLUX_READ_KURUCZ() code as a separate function.
        Comment-out the median/mean rescaling factor in SPFLUX_MRATIO_FLATTEN(),
        since I think that could potentially be mis-matched between the blue
        and red sides.  For rejecting the F stars, start by rejecting any
        stars with more than 20% bad points in any image.  (This fixes a
        problem with plate 662/52147 where a bad star throws the fits.)
        Rescale the per-fiber plots of the spectro-photo vectors using
        the FLATARR such that they should all lie on top of one another.
        The "Flux-calib" plot for spectro-2 incorrectly listed fiber numbers
        between 1 and 320 instead of 321 and 640 -- fixed.
        Only select spectro-photo stars from OFFSETID=1, which will deal
        with multiple-offset plates like SEGUE plate 2255.
SPFLUXCORR_V5: Return chi instead of sqrt(chi2) from the function FCORR_CHI_FN.
        Add INPARAMS option to SPFLUXCORR_SOLVE2() function.
        In the final loop, first do a fit using the SPFLUXCORR_SOLVE() code
        that does not rescale the errors, then use those fits as the starting
        point when calling SPFLUXCORR_SOLVE2().
        Test all solutions up to MAXPOLY terms, not necessarily stopping
        when there is no improvement to chi^2.  This is because one could
        imaging that going from 1->2 terms is very little improvment, but
        then 2->3 is substantial improvment.
        Generalize the internal routines SPFLUXCORR_SOLVE,SPFLUXCORR_SOLVE2
        and rename it to SOLVE_POLY_RATIO in the idlutils product.
SPGAIN: Revamp this code, trying to measure the gain from a set of flats
        taken on MJD 53114 for this purpose.
SPPLAN1D,SPPLAN_FINDRAWDATA:
        Replace calls to the obsolete function RSTRPOS()
        with STRPOS(/REVERSE_SEARCH).
SPREDUCE: Pass exposure time to READPLUGMAP, which now uses that for
        multiple-offset plates (like SEGUE plate 2255).
        Return plugmap-header from call to READPLUGMAP(), since it is
        used to get the CARTID for the output files.
SPREDUCE1D: (Use the B-spline spectra for QSO-fitting).
        When computing FRACNSIGMA,FRACNSIGHI,FRACNSIGLO, ignore points
        blueward of rest-frame 1216 Ang, since these numbers would then
        be dominated by LyA absorption in QSOs.  (This is PR #2703.)
        Add call to STAR_DVELOCITY, but only for stars, even though in
        principle it should work for any objects.
SSHIFT,SSHIFT2D: Remove these routines that are in the idlutils product.
STAR_DVELOCITY: New proc to solve for velocity shifts between multiple
        exposures.
SYNTHSPEC,ZFIND: If the eigenspectrum file does not contain in image in HDU #0,
        then look for a B-spline in HDU #1 and assume that it describes
        a B-spline.  (This is what we're trying to use for QSOs now.)
TRACE320CRUDE: This routine was not actually setting the default value
        of RADIUS, but was getting it from an internal call to TRACE_CRUDE.
        This has been fixed (necessarily, after a similar fix to TRACE_CRUDE).
ZTWEAK_STAR: Add optional keywords.
ZCOMPUTE_QSO: A version of ZCOMPUTE that is basically the same code, but
        using a B-spline composite spectrum that must be evaluated at each
        redshift.  Because there are multiplicative polynomials rather than
        additive polynomial terms, this may fail to find weak em-line QSOs.
ZCOMPUTE,ZCOMPUTE_CHI2: Recast the fluxes and models in double-precision
        before calling COMPUTECHI2 due to round-off errors on some
        platforms (PR #6754).
ZCOMPUTE: Add THETA_COVAR to the output structure.  Instead of storing all
        of the coefficients for the fits at all lags, add a final call
        to COMPUTECHI2 at the end to compute THETA and THETA_COVAR.
        These changes relate to PR #6757.
ZFIND: Mask any pixels on the templates where the first template contains zeros.
        This is useful, in particular, where the stellar templates have zeros
        at the beginning or end of the spectral range due lack of wavelength
        coverage.  This is done by setting the STARMASK parameter that is
        passed to ZCOMPUTE.  This should fix PR #5903.
        Return THETA_COVAR as computed by ZCOMPUTE (see PR #6757).
bin/aporsync_alllog.sh, aporsync_blue.sh, aporsync_logs.sh, aporsync_red.sh,
        killdata.sh, sos_start: Pull the data (sdR files and log files)
        from the machine specified by the environment variable
        $RAWDATA_HOST rather than from the hardwired sdsshost.apo.nmsu.edu.
        Set the default value to sdssfiles1.apo.nmsu.edu in the sos_start
        script.
bin/aporsync_alllog.sh, aporsync_blue.sh, aporsync_logs.sh, aporsync_red.sh:
        Remove the "--rsync-path" option to these scripts, which was used
        to point to the only working version of rsync on sdsshost.apo.
        Now that the IRIX machine sdsshost.apo has been replaced with
        a Linux machine, that is no longer necessary.
bin/spreduce_batch: Script to batch a single Spectro-2D or Spectro-1D job.
bin/sprobotlist.sh: Only run the PLATEMERGE command for all data, but
        not all the subsets such as DR1, etc.  No need to recreate those
        every day!
doc/www/idlspec2d_reduce.html,spectro_home.html: The machine alias name
        sdssdata.princeton.edu should really be sdssdata.astro.princeton.edu
doc/www/spectro_home.html: Add info for downloading DR4.
etc/lamplist.dat: Remove this file, since we use "lamphgcdne.dat" instead.
etc/spChunkList.par: Add chunks 91 through 107, 99A, 100A, 108, 109,
        110, 111, 112, 113, 114, 115-118, 119, 120, 121, 122, 123, 124, 125,
        126, 127, 128, 129, 123A, 131.
etc/spPlateList.par: Add 436 new plates, through MJD 53360 (Dec 21, 2004).
        Add the DR4 public plates, consistent with sdss-archive/2374.
        (I posted some inconsistencies about these plate lists to
        sdss-archive/2376.)  Note that I have all the same plates being
        marked as public, except there are four plates from the EDR
        the FNAL has dropped from their lists: 314/51641, 357/51813, 
        362/51999, 412/51871.
        The following plates are public, but bad:
          504       52316 DR2 bad Bad spectrograph collimation
          704       52205 DR4 bad Bad spectrograph collimation
          721       52228 DR2 bad Bad spectrograph collimation
          761       52266 DR2 bad Bad spectrograph collimation
          769       52282 DR2 bad Bad spectrograph collimation
          770       52282 DR2 bad Bad spectrograph collimation
          775       52295 DR2 bad Bad spectrograph collimation
          778       52337 DR2 bad Bad spectrograph collimation
        List each plate in one and only one data release (the first time
        it is released).
        The most recent list from Fermi (from March 15, 2005;
        pointed to in sdss-archive/2439) misses the following plates
        that I have in my list from earlier e-mails.  All of these are
        repeats of other observations of the same plates:
          293 51689  EDR
          352 51694  EDR
          360 51780  DR1
          412 51931  EDR
          476 52027  DR4
          496 51973  DR4
          525 52029  DR4
          574 52347  DR4
          574 52366  DR4
          581 52353  DR4
          641 52176  DR4
          722 52206  DR4
          903 52385  DR4
          1296 52738  DR4
        Add another 233 plates through MJD 53566 (July 14, 2005).
        Marked plates for DR5, according to sdss-archive/2661 (226 plates) and
        sdss-archive/2684 (89 plates).  Note that I already had the following
        two plates in DR4: 712/52179 and 1664/52965, and will keep them there.
        I've also added 1138/53228 and 1144/53238 to DR5, since the Spectro v5
        reductions turn these plates into 'marginal' rather than 'bad.
        Note that the following 18 'good' or 'marginal' plates could be
        included (c.f. sdss-archive/26744):
          230       52251  special
          231       52221  special
         1244       52674  special
         1247       52677  special
         1250       52930  special
         1251       52964  special
         1252       52970  special
         1253       52974  special
         1254       52972  special
         1256       52902  special
         1257       52944  special
         1259       52931  special
         1637       52992  special
         1638       52999  special
         1641       53032  special
         1907       53265  special
         1913       53295  special
         1917       53295  special
        Remove the plates 521/52325 and 574/52337, which were only
        partial reductions that should not be in this list.
examples/opBC-50000.par,opBC-51809.par,opBC-51813.par: Added a partial
        bad column on the b2 CCD that is responsible for some of the absorption
        glitches seen in fibers 343+344 (c.f. PR #3681).
examples/opECalib-51577.par: Update the gains based upon work by Eric Switzer
        and a more careful look at a recent set of identical flats taken
        on the night MJD 53114.  I've updated the numbers as follows for
        the two gain and two read noise values per CCD:
           b1:  1.13 1.13  3.9 3.3  -> 1.10 1.05  3.86 3.24
           b2:  1.32 1.32  3.7 3.26 -> 1.23 1.26  3.88 3.38
           r1:  1.15 1.00  3.7 3.7  -> 1.09 1.00  4.08 4.04
           r2:  1.00 1.05  3.7 3.7  -> 1.05 1.05  4.32 4.12
        Note that this is the opECalib file used for the vast majority of data.
include/export.h: New export.h file in the IDL 6.2 beta distribution.
lib/Makefile: For "make clean", also remove ".a" and ".dylib" files.
pro/Makefile: Remove reference to pro/fplan directory, since all those
        deprecated routines have been removed.
pro/photoz/Makefile: Add this Makefile.
templates/eigeninput_star.par:
        Shift all of the normal stellar templates (O through M) to
        agree with the Elodie redshifts in the v5_0_0 reductions.
        Shift the CarbonWD and Carbon star templates by +65 km/sec.
        No change to the WD or WDmagnetic velocities (out of ignorance).
templates/spBsplineQSO-53115.fits: Fist attempt at a B-spline composite
        for QSO spectra as a fn. of redshift (made by Burles).
templates/spEigenCVstar-53724.fits,spEigenGal-53724.fits,spEigenQSO-53724.fits,
        spEigenStar-53724.fits: Rebuilt these templates using an untagged
        version of the reductions essentially equivalent to v5_1_0, such
        that the spectrophotometry will be improved.  Note that we still
        mean to improve these templates at some later date by improving
        the lists of input objects, especially for stars.
templates/wfEigen*.fits: Add WFCCD templates from Prochaska

-------------------------------------------------------------------------------
v5_0_0 (Feb 19, 2004 idlspec2d running on IDL 5.4 - 6.0
Built against specflat v1_5, elodie v1_0, idlutils v5_0_0.
The speclog product was also tagged at v1_3, valid through MJD=53054 (today).

Next major release of Spectro-2D, with the "Version 5" data model.
Only minimal changes to P-1D, but search galaxy redshifts to z=1.

APO_PLOTSN,QUICKTRACE: Need the /APOTAGS in the call to READPLUGMAP(),
        which has been re-written to be used by the full 2D reductions too.
BADFMAGS: Find bad F star photometry that might get used by Spectro-2D.
BADFSTARS: Find bad F stars used for spectro-photometry in the Spectro-2D.
BATCH2D: Call SPCOMBINE_V5 instead of SPCOMBINE.
        Update the list of output files to correspond to the new v5 outputs.
COMBINE1FIBER: Add the skies by inputting SKYFLUX and outputting NEWSKY.
        The skies are combined in the same simplistic manner as the
        dispersion pixel map.
        Make loop variables type long.
        In this case of no good points, set the NODATA bit everywhere.
        Also, if NOPLUG is set in the first input bit-mask, assume it
        should be set everywhere in the output bit masks.  No other mask bits
        are set in this case of no data.  This should address PR #3690.
DJS_FLUXCORR,FLUXCORR: Remove these deprecated routines, which are now
        replaced with FLUXCORR_NEW (if using SPCOMBINE) or SPFLUXCORR_V5
        (if using SPCOMBINE_V5).
EXTRACT_OBJECT: Turn off telluric-corrections by default, which must now
        be enabled with the /DO_TELLURIC keyword.  Also, delete some old code.
        Compress (with gzip) the output file.
FIBER_ROLLCALL: This code has been broken out of PLATESN.
FILTER_THRU: SDSS filter curves are now in the idlutils products under
        the subdirectory data/filters.
FIND_NMINIMA: Fix bug when plotting.
FLUX_DISTORTION: New function for computing the overall flux-distortion
        on an entire plate using the spectrophotometry compared to the
        fluxes in the plug-map structure.
FSTARS_PLOT: New code to make color-color plots of spectro-photometric stars
        as compared to the stellar locus and BD+17.  This code actually dates
        back to Sep 2002, but was never checked in.
GET_TAI: Report warning about exposures less than 2 minutes only
        for science or smear exposures.
JEG_SPHOTO_COEF: Christy's spectrophotometry code using Jim Gunn's functional
        form to correct using the PHOTO magnitudes.
KURUCZ_FITSFILE: New proc for generating a single FITS file from a list
        of ASCII-formatted Kurucz models.
LINEBACKFIT: Consolodate some of the print statements from MPFIT onto 1 line.
LRGMODEL_TRAIN: Calling script for training the Bruzual-Charlot models
        for photo-z's.
PCA_GAL: Set the starting wavelength to 1850 Ang so that we can go to z=1.0;
        it was 2300 Ang, which only let us fit out to z=0.6.
PCA_STAR: Interpolate over bad pixels in the middle of any spectra,
        but still set any bad end pixels to zero (as before), which should
        make those pixels be ignored in the redshift-fitting code.
PLATELIST: Get rid of the SMEARUSE entry, since it is now deprecated.
        Include any public plates in the default output file; this is
        because there are some DR1,DR2 plates that are called 'bad', but
        we probably still want them in the full merge files.
        Read the spectro-photometry keywords [GRI]OFFSTD,[GRI]OFFRMS, etc.
PLATESN: Remove the code that adds the spectro-photometry keywords to
        the output headers, since P-1D does this more carefully.
        Split out the fiber "roll call" code into FIBER_ROLLCALL.
        Add a bunch of spectro-photometry keywords to the FITS header,
        such as GOFFSTD,GRMSSTD,... -- These will be read by PLATELIST.
PLOTSIGNAL: New routine for making diagnostic plots of the signal seen
        by the spectrographs, unlike most of our routines that show S/N.
PLOTSN: Re-write of the code that makes all the plots beyond the first
        page of S/N plots.  Compare the spectro-photometry to the CALIBFLUX
        entries in the plug-map structure if they exist.
PLOTSPEC: Add the /SKY option for over-plotting the sky.
        Add the /ALLEXP option for plotting the fluxes from all exposures,
        rather than the co-added spectrum.
PLUG2TSOBJ: Add /SILENT option.
PLUGFILE_RELABEL: Relabel the OBJTYPE's for specified objects in all
        plPlugMapM files.
READONESPEC: New proc for reading single exposure spectra (from spCFrame files).
READPLUGMAP: Many changes to this code, which is now used by both SOS
        and by Spectro-2D.  Options /APOTAGS,/DEREDDEN are for the SOS code.
        Option /CALIBOBJ is for the Spectro-2D reductions, and re-calibrates
        the photometry to the Princeton calibObj files.
        Also read SFD_EBV (reddening values) with the /CALIBOBJ option.
READSPEC: Add support for reading the sky (SKY=) from HDU #6 of the spPlate
        files.
        No longer name the returned plug-map structure, since we may be
        adding tags to this structure, and I believe structures no longer
        need to be named in order to concatenate them in IDL.
SKYSUBTRACT: Fix possible crash condition, whereby the re-fit to the
        supersky is not done if the first fit failed and FULLBKPT does
        not exist (line 243).
SPBIASGEN,SPFLATTEN2: In the output headers, start numbering the EXPID
        keywords at EXPID01 instead of 00.  Also, drop MJD from that string.
        This makes it consistent with the keywords in the spPlate files, for ex.
SPCALIB: Change the way we spawn the gzip command.
SPCOADD_FLUXED_FRAMES: Christy's code that now de-reddens the spectra;
        definitely do not use!
SPCOADD_FRAMES: Get rid of some unused lines of code.
        Get rid of returned synthetic mags + S/N values from PLATESN,
        since I've excised that code, and don't write the undocumented
        last two HDUs to the spPlate files.
SPCOADD_FRAMES,SPCOADD_V5: For the EXPIDxx keywords in the output spPlate file,
        start the numbering with EXPID01 (instead of 00) because that's more
        like the FITS standard, and SXPAR('EXPID*') can then be used.
        Also, drop the MJD from this identifying string, so that the first
        11 characters can be used to directly determine the names of the
        individual spFrame or spCFrame files.
        Call FIBER_ROLLCALL from this routine, rather than doing it in PLATESN.
SPCOADD_V5: New code to replace SPCOADD_FRAMES for version 5 outputs.
        The sky vectors are now combined in some semi-rational way,
        and output as HDU #6.
SPCOMBINE: Pass all arguments if this proc is called recursively.
SPCOMBINE_V5: New code to replace SPCOMBINE for version 5 outputs.
        Add call to FLUX_DISTORTION to compute the 2-D spectro-photometric
        corrections.  This modifies the fluxes both in the spCFrame and
        the spPlate files.  This is a fairly major change, in that the
        spectro-phometry is now explicitly tied to the plugmap-structure
        magnitudes and colors (at least in the mean).
        We currently hard-wire the rejection of all smears, all exposures
        with any CCDs with (S/N)^2 < 1, and any with (S/N)^2 less than 20% of
        the best exposure.
SPFLUX_V5: New code to replace SPFLUX for version 5 outputs.  This computes
        the spectro-photometry vectors on an exposure-by-exposure basis
        (though doing the fit on all exposures at once).  The low-order
        per-object flux-correction vectors that used to be handled
        (through a call to FLUCORR_NEW) must now be handled separately,
        and *after* the call to this routine.
SPFLUXCORR_V5: New code to replace FLUXCORR_NEW.  This will be called
        by SPCOMBINE_V5.
SPFRAME_READ: Routine for reading specified HDUs and fibers from either spFrame
        or spCFrame files.
SPREDUCE: Abort and return from this procedure if no good flats exist.
        Call READPLUGMAP() to read the plug-map file, and get the photometric
        calibrations from the calibObj files.
SPREDUCE1D: Dispose of COUNTS_SPECTRO,COUNTS_SYNTH in favour of the fields
        SPECTROFLUX,SPECTROSYNFLUX which are in nano-maggies (1e9 larger).
        Also compute SPECTROSKYFLUX,SPECTROFLUX_IVAR,SPECTROSYNFLUX_IVAR
        from the sky vectors, which are now in the new spPlate files.
        Log peak memory usage.
        Fit galaxy redshifts out to z=1.0 (instead of 0.6).
        Add the /verbose option to the zfind() function for the main loop
        finding galaxy redshifts and QSO redshifts, since those are the two
        loops where this code spends most of its time.
SPREDUCE2D: Report peak memory usage.
SPREDUCE,SPREDUCE2D: Pass the optional /DO_TELLURIC along to EXTRACT_IMAGE.
UPDATE_PLATE_RELEASE: Code to mark the DR2 plates (for example) from
        the "etc/dr2spectro.par" file into "etc/spPlateList.par".
VDISPFIT: Change the SPLOG of "Using previously cached..." to a simple
        print statement so it doesn't go in the log files so many times.
ZCOMPUTE: Do not be so verbose (printing a line to the log for every fit)
        unless a /verbose keyword is set.  This is because the log files
        were being dominated by this one line!

etc/dr2spectro.par: List of DR2 plates from the web site
        "http://www.sdss.org/dr2/coverage/dr2spectro.par".
etc/spChunkList.par: Add chunks 87-89.
etc/spPlateList.par: Add list of DR2 plates.
etc/sdss_*.dat: Remove these SDSS filter curves, which are now in the
        idlutils products under the subdirectory data/filters.
etc/skylines.par: Updates many of the sky lines to agree with the NIST 2.0
        database at "http://physics.nist.gov/cgi-bin/AtData/main_asd".
        The changes are very minor.  This does not update any of the OH lines.
        Change the HgI 5460.74 wavelength to 5460.94 Ang; this is completely
        ad hoc, simply because it *looks* like the line always ends up there
        (c.f. PR #3259).  This may be the actual centroid of the line since
        it is pressure-broadened in a funny way, but this should definitely
        be checked (the PR will not be closed).
include/export.h: Change to be consistent with the file by the same name
        in the idlutils product.  This has two minor changes for SGI 64-bit.
templates/eigeninput_star.par: Remove the 3 objects labelled Carbon_DQred,
        since those were actually BAL quasars (c.f. PR #3953).
        Also, rename the "Carbon_DQ" objects as "CarbonWD".
templates/kurucz_stds_raw_v5.fits: FITS file with Kurucz templates
        generated by KURUCZ_FITSFILE.  This is simply the set of Kurucz
        ASCII files collapsed into a single FITS file, which is then
        used by SPFLUX_V5.
templates/spEigenCVstar-53054.fits, spEigenGal-53054.fits,
        spEigenQSO-53054.fits, spEigenStar-53054.fits:
        These are a new set of templates built from almost exactly the
        same list of objects as before, but using preliminary v5 reductions.
        Also, some mis-classified stars removed from the star list.

-------------------------------------------------------------------------------
v4_11 branch + v4_11_0 (Feb 6, 2004)

This branch was created by Lupton for FNAL operations.
The branch point was v4_10_7 == v4_11_0, with the following changes:

Four files copied from the mainline as they were on this date
which was a tag on the mainline called RHL-create-v4_11):
  pro/fluxfix/jeg_sphoto_coef.pro : New routine
  pro/fluxfix/spcoadd_fluxed_frames.pro : Only changed by Tremonti
  pro/spec2d/platesn.pro : Only changed by Tremonti
  pro/spec2d/plotsn.pro : Bug fixes by DJS and later changes by Tremonti.

-------------------------------------------------------------------------------
v4_10_7 (Dec 11, 2003 idlspec2d running on IDL 5.3 - 5.6
Built against specflat v1_5, elodie v1_0, idlutils v4_10_7.
Tagged for fixing SOS PR #5735.

COLLIMATE: Since the DJS_SVDFIT() function was removed in v4_10_1,
        explicitly compute the chi^2 minimum with a matrix inversion.
FIND_NMINIMA: If the fit value of YPEAK is less than zero, then change
        it to zero.  This code is always used for chi^2 minimization,
        and a negative value for the chi^2 would not make sense.
LRG_PHOTOZ: New simple photo-z finder for LRGs using a single template.
LRG_PHOTOZ_TEMPLATE: Code to tweak the photo-z template used by LRG_PHOTOZ().
LRG_PHOTOZ_TEST: Code to test the photo-z's.
LRGMODEL_PHOTOZ: Photo-z finder using Bruzual-Charlot elliptical galaxy models.
LRGMODEL_TWEAK_TEMPLATE: Code to tweak the Bruzual-Charlot model parameters
        used for the templates in LRGMODEL_PHOTOZ().
NEWSPCOMBINE: Christy's code: changed so that if one frame does not make
        the S/N cut then all 4 frames of that exposure are rejected.
PLATELINKS: Call SPAWN with the /noshell option to greatly increase
        the speed of this procedure.
PLATEMERGE: Major re-write to use less memory.  All of the ZANS structures
        are read into memory at once, but not all of the TSOBJ structures.
        The output file are written one plate at a time, with the TSOBJ
        structure for that plate read only when it is needed.
        Functionally, the outputs are exactly identical.
PLOTSN: Christy's last page of plots calls GAUSSFIT(), which can crash
        with too few points.  This happened on the special plate 1180
        on MJD 52974.  I've changed this to using DJS_ITERSTAT.
QUICKEXTRACT: The logic to trim away extra sky fibers when there are
        more than 20 appeared to be incorrect, and could trim away most
        or all sky fibers.  I fixed this, and also now choose 40 skies
        in the case of many skies.
SDSSPROC: Don't print bias noise level if /silent is set.
SPREDUCE2D: Print the version of "speclog".

bin/sprobot_start: Insist that the cvs version of speclog be set up
        for running this robot.
doc/www/idlspec2d_install.html: Change instructions to installing with EvilUPS.
doc/www/spectro_home.html: Include instructions to download EDR and DR1
        using wget.
etc/spChunkList.par: Add chunks 80-84, 85-86.
pro/Makefile: Add photoz directory
templates/spLRG-52928.fits: LRG templates for LRG_PHOTOZ function.

-------------------------------------------------------------------------------
v4_10_6 (Oct 15, 2003 idlspec2d running on IDL 5.3 - 5.6
Built against specflat v1_5, elodie v1_0, idlutils v4_10_6.

ATMDISP_COR
DJS_SFIT_ITER
DR1_SPPLATE_COR (removed)
FLUXCALIB_RESID (removed)
FLUX_STANDARD (removed)
FRAME_FLUX_CALIB
FRAME_FLUX_TWEAK
KURUCZ_RESTORE
NEWSPCOMBINE,
PCA_FLUX_STANDARD
PLATE_FLUX_RECAL (removed)
RECTIFY
SMEAR_COMPARE
SPCOADD_FLUXED_FRAMES
SPDATA2MODEL_RATIO
SPHOTO_CALIB
SPMEDIAN_REBIN
SPPLATE_CORRECT (removed)
SPREAD_FRAMES
STYPE_STANDARD: More development by Christy.
UNDO_SMEAR (removed)
ZEROPT_COR (removed)

APOPLOTGEOM: This is a plotting routine to visualize the geometry of the
        arc lines on the CCD from the Son-of-Spectro outputs.  It was
        written in Nov 2002, but never checked in.
COMPUTECHI2: Do the chi^2 computation in double-precision.
DAYTIME_TEST: Proc to look for spectro exposures taken during the day
        and not marked as test.
DR1LIST_BEST: Proc to determine which plates *should* have been in DR1
        that match the tiles of those actually chosen.
FILTER_THRU: Make silent in call to xy2traceset.
FIND_UNPLUGGED: Proc to find all unplugged fibers that still seemed
        to get a spectrum in the reduced data.
FITSN: Changed call to the obsolete function POLYFITW, to the newer
        but worse POLY_FIT.
        Apply a work-around to the apparent change in PHOTO fiber-mags,
        as discussed in sdss-obs/4029 and PR #5642.  Shift the blue
        and red fit magnitudes from:
          [18.20,19.70] -> [18.33,19.83] in blue
          [17.90,19.40] -> [18.06,19.56] in red
LISTEXPTIME: New simple proc for listing all exposure times.
PCA_SOLVE: Added /quiet keyword.
PHOTO_LOADER: New proc to write PHOTO outputs from SDSS_READOBJ() to an
        ASCII stream for direct input into Postgres; written by Hogg
        and Schlegel.
PLATECEN_TEST: Proc to check the consistency of the RA,DEC positions in
        the output spPlate file headers.
PLATESN: New header keywords ROFFSET & RSIGMA store the offset and standard
        deviation of the r-band difference in the spectro and photo mags.  
        GIOFF and GISIGMA store the offset and scatter in the (g-i) color.
        Changed (g-i) to (g-r).
PLOTSN: Fixed histogram scales, changed colors for histograms.
        Changed (g-i) to (g-r).
        Tremonti has added return values for ROFFSET,RSIGMA,GROFFSET,GRSIGMA,
        but these are not documented.  Also, ignore objects with PLUG.MAG[2]
        <= 0 (but what would those be?).  Plotting ranges changed.
        A 3rd set of plots for histograms.
        (Revert this code back to v4_10_1 if need be.)
PLUGFILE_UNMAPPED: Proc to list which fibers in a plPlugMapM file are unmapped,
        and the info that might help decide where those fibers should be.
QUICKEXTRACT: Apply a work-around to the apparent change in PHOTO fiber-mags,
        as discussed in sdss-obs/4029 and PR #5642.  Shift the mags at
        which to evaluate the S/N from:
          mag=20.20 -> 20.33 in blue
          mag=19.90 -> 20.06 in red
SDSSPROC: Compute the standard deviation in the bias region again,
        but using a weaker 5-sigma clipping.  This is done solely
        for the purpose of identifying any electronics problems,
        such as that on the left half of r2 on MJD 51779.
        Trigger a warning message if above 10 ADU.
        This addresses PR #3700.
SMEARTIMES: Proc to list the TAI timestamps of 'smear' exposures in a log file.
        The purpose of this is to get an exact list of times and determine
        from the TPM logs whether the telescope moved in the way that it
        was supposed to during these 'smear' exposures.
SPREDUCE1D: Add the "UNPLUGGED" value to the ZWARNING flag.
        Add the fields SPECTROFLUX,SPECTROSYNTHFLUX,SPECTROSKYFLUX
        which are the same as the COUNTS* fields but in nanomaggies
        instead of maggies, which are the same units as our imaging outputs.
UPDATE_PLATELIST: Proc for easily updating the spPlateList.par file.

doc/spectroSOS.html: Add the warning message about "Std. dev. in bias region".
etc/atmdisp_vec_am1.1.see2.0.fit - Tremonti's atmos. dispersion corrrection?
etc/atmdisp_vec_am1.2.see2.0.fit - Tremonti's atmos. dispersion corrrection?
etc/atmdisp_vec_am1.3.see2.0.fit - Tremonti's atmos. dispersion corrrection?
etc/atmdisp_vec_am1.4.see2.0.fit - Tremonti's atmos. dispersion corrrection?
etc/atmdisp_vec_am1.5.see2.0.fit - Tremonti's atmos. dispersion corrrection?
etc/emlines.par: The [O_II] lines were updated from Peter van Hoof's web
           site at: http://www.pa.uky.edu/~peter/atomic/
etc/kurucz_stds_v5.fit: Made with new SPECTRUM code.  Use white dwarf
           correction to colors.
etc/kurucz_model_fix.fit (removed)
etc/kurucz_stds_interp.fit (removed)
etc/spChunkList.par: Add chunks 28A, 71, 68A.  Chunk 62 should be "special",
           not "main".  Add chunks 77,78,79.
etc/spPlateList.par: Update from 20 Nov 2002 to 11 Sep 2003.
pro/Makefile: Add the plan subdirectory.
ups/idlspec2d.table: Get rid of all the $UPS_PROD_FLAVOR references for 
           dependent products.

-------------------------------------------------------------------------------
v4_10_2-2003/8/13
This is an untested version of the code with the files in some
state between v4_10_1 and v4_10_6.  It was created retro-actively
by RHL on 18 March 2004 to tag the code as is stood on 13 Aug 2003.

-------------------------------------------------------------------------------
v4_10_1 (Jun 18, 2003 idlspec2d running on IDL 5.3 - 5.5
Built against specflat v1_5, elodie v1_0, idlutils v4_10_1.

Builds spAll summary files using Princeton calibObj files.

DJS_SVDFIT: This proc removed, since it was a temporary fix to
           be called for solving a singular matrix from FIND_NMINIMA.
FIND_NMINIMA: Remove use of DJS_SVDFIT (which didn't work on the Mac
           anyway).  Re-write the fitting to exactly three points
           with an explicit solution of the quadratic equation.
           Add another error code (-7L) for the case where all of the Y
           values are identical, in which case the fit is impossible.
FINDSPEC: Rationalize the calling sequence to be more consistent
           with SDSS_FINDIMAGE.  Get rid of /DUPLICATE keyword, and
           add /BEST keyword.  Allow matching multiple objects per plate
           if the search radius is large.
FITMEANX: Add MINSDEV and INMASK optional keywords.  Both these are
           used by LOCATESKYLINES to prevent the S/N of some lines getting
           infinitely large.  This happened for the r1+r2 exposures on
           plate 336/51999, where the first sky line was off the edge
           of the plate for most of the lines.
GET_TAI: Add /SILENT option.
LOCATESKYLINES: Change MAXSHIFT from 2.0 pixels to 3.5 pixels.  The worst-
           case real arc->science flexure that we've seen is 3.2 pix
           for the r2 camera on plate 192 MJD 51461.
           Use the INMASK keyword in the call of FITMEANX().
PLATELIST: Use PLUG_RA,PLUG_DEC to match duplicate observations of
           individual objects, rather than RA,DEC (which can be zeros
           if there was no match to the photometry).
PLATEMERGE: Small changes to allow using the (new) calibObj files
           instead of the (old) tsObj files.
           For the ASCII output, write MODELFLUX instead of COUNTS_MODEL.
           In call to PLUG2TSOBJ, pass PLUGMAP so that warnings of unmatched
           sky fibers are not printed.
           Add SPECOBJ_ID and NSPECOBS to the output structure.
PLUG2TSOBJ: Small changes to allow reading of the (new) calibObj files.
           For now, assume these files are in $SPECTRO_DATA/calibobj.
           Print a warning message for non-matched objects only if they
           are not skies.
READSPEC: Add internal function RSPEC_ZLINE_APPEND() for appending two
           zline structures, even if they are different structures or
           have different number of lines measured.
SDSSPROC: Call the new proc WARN_DAYTIME.
SPCALIB: The correct TSET structure was not always being written
           to the spFlat files (though those files aren't actually
           used for anything), nor the FIBERMASK array.
           Write those files directly from the FLATSTRUCT,ARCSTRUCT
           structures instead.  Also, gzip those two output files.
SPPLAN2D: Exclude files where the plate number does not match that
           in the map name.  This happens, for ex, for exp #14970 on
           MJD 52405, which has the MAPNAME for plate 802 but a PLATEID
           of 9999.
SPREDUCE: Major change to how the flat+arc calibrations are chosen.
           Now choose the flat that is good and nearest in time to
           the midpoint of all the science exposures.  Select the arc
           that was used for that flat (regardless of whether it was
           the best arc).  Previouly, we chose the flat that was nearest
           in time to each exposure, and we chose the best arc regardless
           of the time it was taken.  This had the potential to choose
           an arc taken during the afternoon (as happened for plate 820
           on MJD 52405, c.f., PR #3966) if it is not explicitly marked
           as a test exposure.
WARN_DAYTIME: New proc to print a warning if an excellent-quality exposure
           taken with the Sun up.  For example, this is how the bad arc
           exposure got in to ruin plate 820/52405 (PR #3966).

bin/speclog_update: New bash script to update the "speclog" product for one
           or more MJDs from the astrolog directory.
bin/sprobot_start: Put the environment variable $CVS_RSH into the cron file,
           for use by the "speclog_update" script.
           No longer set $SPECLOG_DIR=$ASTROLOG_DIR, since now they
           really are different.
bin/sprobot.sh: After copying the astrolog files, call the "speclog_update"
           script to make a CVS-versioned copy from $ASTROLOG_DIR->$SPECLOG_DIR.
doc/www/spectroSOS.html: Add warning message for "Sun above horizon."
examples/opHdrFix.par: Go through all the headers looking for flat, arc,
           or science exposures taken while the sun was up.  Discard them
           in this file, which takes care of all corrections through
           MJD 52426 (1-Jun-03), after which the sdHdrFix-$MJD.par files
           are used.
ups/idlspec2d.table: Add dependency on "speclog" product.
ups/Makefile - Get rid of the confusing dependency on 
               $(SDSSTOOLS_DIR)/bin/install_ups_table.

-------------------------------------------------------------------------------
v4_10_0 (Apr 8, 2003 idlspec2d running on IDL 5.3 - 5.5
Built against specflat v1_5, elodie v1_0, idlutils v4_10_0.

Test against new idlutils.

APOHEADER: Allow an optional keyword MJD (to speed things up).
CREATE_LINESTRUCT,LINEBACKFIT,SPREDUCE1D: Replace LINENPIX with the number
           of pixels to the left and right of the line center, LINENPIXLEFT
           and LINENPIXRIGHT.  Use both of those to trigger the warning
           NEGATIVE_EMISSION from quasars, which was triggered sometimes
           when there were only pixels to one side of the line center
           (PR #3797).
FLUX_STANDARD: Added empirical correction to SPECTRUM-Kurucz models.
           Then got rid of them!
GET_TAI: Trigger a Warning if (TAI-END) - (TAI-BEG) < EXPTIME + 20 sec.
PLATECOMPARE: Also plot any objects that have ZWARNING set to zero
           in one observation and non-zero in another.
PLATELINKS: New proc for generating symbolic links to either all of the
           interesting files in the $SPECTRO_DATA tree, or one of the
           public subsets (e.g., "EDR" or "DR1").
PLATEMERGE: Create spAllLine files.  Allow PUBLIC to be a keyword specifying
           any of the public subsets (e.g., "EDR" or "DR1").
PLOTSPEC: Fix trivial bug (had "EXTRA" instead of "_EXTRA") in passing
           additional plotting keywords to plots.  Also, pass those
           keywords along to the XYOUTS commands.
PLOTSN: The last plot was accidentally showing i-band residuals instead
           of r-band.
SPHDRFIX: Test if the opHdrFix file (or the directory!) even exist at all.
           Otherwise, if the directory does not exist, we'll get stuck in
           an infinite loop.
READSPEC: Fix minor bug that would truncate the wavelength mapping
           when spectra are read from multiple plates and /ALIGN not used.
SPPLATE_CORRECT: Fixed small bug so that it works with the smear left in.
SPREDUCE1D: In setting the NEGATIVE_EMISSION flag for QSOs, demand that
           the line be negative by at least 3-sigma.
STYPE_STANDARD: Fixed error in smoothing box size.
ZEROPT_COR: Added range checks to get rid of seg faults.

bin/sprobot.sh: Instead of looking for "/data/spectro/$MJD" to get
           an MJD list, look for "/data/spectro/astrolog/$MJD".
           This will get the log files for MJDs where there are no
           spectroscopic data.
bin/sprobotlist.sh: Add calls to PLATEMERGE for the EDR and DR1 subsets.
etc/kurucz_model_fix.fit - New file for empirical corrections to
           SPECTRUM-Kurucz models, used by FLUX_STANDARD.
examples/opHdrFix.par: More updates, in an attempt to identify
           all exposures with wrong exposure times in their headers
           due to various SOP and DA bugs.
           Flag a bunch of old data as bad, where I've specifically searched
           for short science exposures.
           Change all FLAVOR='unknown' entries to QUALITY='bad'.
pro/fluxfix/Makefile - Forget to add this Makefile, which is needed
           to prevent the "make install" from crashing on an IRIX platform.
ups/idlspec2d.table: Change flavor to "ANY".

In idlutils:

DUST_SDSSFILTER: New proc to integrate the extinction curve over
           a selection of representative source function and the SDSS filters.
DUST_INTFILTER: New proc to integrate the extinction curve over a
           given source function + filter curve.
GSC_READ_TABLE: New proc to read one table from the Guide Star Catalog.
HOGG_SCATTERPLOT: New proc to plot greyscale scatterplot with contours.
MWRFITS_CHUNKS - Do not always create a new file (unless /CREATE is set).
NONNEG_MULT_UPDATE,NONNEG_MULT_UPDATE_SOLVE: New code from M. Blanton
           for non-negative least-squares solving.  This is a special
           case of box constraints in quadratic programming, as suggested
           by Sha, Saul, & Lee (2002), "Multiplicative updates for
           nonnegative quadratic programming in support vector machines"
           (UPenn Tech Report MS-CIS-02-19)
STRUCT_PRINT: If /NO_HEAD is set, do not increase the width of a column
           to occomodate the column name.  New FORMATCODES option.
STRUCT_TRIMTAGS: Would not have worked if only the very 1st tag were selected.
YANNY_WRITE: New options /ALIGN and FORMATCODES, even though these options
           make it possible to write invalid Yanny files.

Various astrometric routines have been moved from the hoggpt product
into pro/astrom.  The USNO routines have been modified for reading
the USNO-B1.0 catalog (as well as USNO-A1,USNO-A2).
LL2UV
USNO_CONE
USNO_READ
USNO_READZONE
USNOB10_EXTRACT
UV2LL

Various "mangle" utilities added by M. Blanton in pro/mangle.

evilinstall: Moved to the photoop product.
evilmake: Turn on optimization for all platforms except IRIX.
           Previously, we tried to set -O3 on IRIX, which crashes
           builds on the machine sdsshost.apo.
src/spheregroup/chunks.c - Minor bug fixed.
ups/idlutils.table: Change flavor to "ANY".

-------------------------------------------------------------------------------
v4_9_13 (Nov 24, 2002 idlspec2d+idlutils) running on IDL 5.3 - 5.5
Built against specflat v1_4.

Support for Mac OS X platform.  New features + minor fixes for SOS.
First check-in of Tremonti's flux-calibration code, though not integrated.
Check-in of dust map code.  Re-write of YANNY_READ.

APO_LOG2HTML: Default link to GIF plot, with another link to PostScript.
APOPLOTARC: New proc for plotting arc spectra from the Son-of-Spectro outputs.
APOPLOTSKY: New proc for plotting sky spectra from the Son-of-Spectro outputs.
APOREDUCE: Convert the PostScript plot to GIF format using "pstogif",
           which is in idlutils.
EXTRACT_ROW: Be sure to pass "whoppingct" as type LONG to the C code.
           If not, then it fails on the Mac OS X platform.
FIND_NMINIMA: Fix tiny bug for optional plots.
FINDSPEC: Add the optional keyword SEARCHRAD.
GUIDERMOVIE: The format for the date in the header of the guider images
           has changed.  This code should now comptabably read the old
           or new date format.
HELIOCENTRIC: Moved to idlutils product.
LINEBACKFIT: Change how the error on equiv. width (LINEEW_ERR) is computed.
           I believe it was incorrect before, and should simply be
           computed from LINEAREA_ERR,LINECONTLEVEL_ERR.
PLATELIST: Replace the plate center RA,DEC with that of the object
           closest to the center for those cases in which the spPlate
           headers got the wrong coordinates (see PR #2419).  When
           these are replaced, print a WARNING statement.
           Be more silent when calling MRDFITS(),HEADFITS().
PLATEMERGE: Search for overlaps in plates with a somewhat larger radius,
           just to be somewhat immune to errors in listed plate centers
           (for ex, see PR #2419).  Also, print some more informational
           messages.
PLOTSPEC: Bug fix to allow one to specify the output file name with PSFILE=.
           Fix units on Y axis to /cm^2 instead of /cm.
QUICKEXTRACT: Change print statement for whopping fibers to one per line.
           Write SSET,RELCHI2STRUCT to the output "sci-" file.
READ_ELODIE: Use INTERPOL() instead of POPULATE_IMAGE for interpolating
           the high-resolution Elodie spectra onto the log-wavelength binning.
           I'm still uncertain as to the absolute units of the spectra.
READSPEC: Add PATH option, which can override TOPDIR.
           Determine the MJD dynamically if set equal to 0.
SDSSPROC: Fix silly bug trying to set QUALITY='excellent' when undefined.
SLITHISTORY: New proc to plot history of spectro slit-head positions
           based upon the (new) plSlitps files from the mapper.
SOLVEFILTER: New proc to determine the 2.5-m filters from the spectra.
SKYSUBTRACT: Optionally return SSET, which is the B-spline structure
           for the supersky.  This will be used by APOPLOTSKY.
SPCOADD_FRAMES: Change BUNIT header keywords in output files to have
           the comment '1E-17 erg/cm^2/s/Ang' instead of the incorrect
           comment '10E-17 erg/cm/s/Ang'.
WRITE_UROS: Add Flatvec,Rnois to output files.

New procs from Tremonti in pro/fluxfix:

DR1_SPPLATE_COR: Modify a list of spPlate files for improved spectrophotometry.
FLUX_STANDARD: Solve the flux-calib vectors for a single camera+spectrograph.
PLATE_FLUX_RECAL: Called by SPPLATE_CORRECT.
SPPLATE_CORRECT: Correct the flux calibration of the spPlate files for DR1.
STYPE_STANDARD: Spectral type the standard stars and save the result as
           a FITS file. (This should probably be changed to return the result).
UNDO_SMEAR: Create correction vectors for 1 plate which can be used to
           remove the the effects of "smear" from the spectra.
ZEROPT_COR: Compute a zeropoint correction to the flux calibration.

aporsync_alllog.sh: New shell script for copying all of the log files
           from sdsshost.apo:/astrolog/$MJD to the sos.apo machine.
           This will be done once per day at 7:45.  This rsync must
           follow symbolic links on sdsshost.apo, since it now looks
           like quite a few of the files there are now symbolic links.
           (That's crazy, but what's a guy to do?)  Copy the last 7 nights
           of logs, whether or not there was spectroscopy.
aporsync_logs.sh: The last line of the first rsync command was accidentally
           dropped in this last version - fix.  Also, only copy sdHdrFix file
           if it exists.  This addresses PR #3968.
           Also copy plSlitpos*.par,plPlugMap*.log files.
export.h: Update this file to agree with the IDL 5.5beta for Mac OS X.
Makefile: Support for new "fluxfix" subdirectory.
opHdrFix.par: Fix the RA,DEC positions in the raw file headers to fix
           some remaining problems for PR #3009.  Specifically, the following
           plates were getting the wrong RA,DEC in the platelist files:
           351/51780, 355/51788, 356/51779, 360/51780, 385/51783, 391/51782,
           395/51783.
           Discard exposures 14967-8 for plate 820/52404.
sos_start,sprobot_start: If the environment variable PATH has more than 1020
           characters than abort.  This is because the PATH appears to be
           truncated beyond that point on certain Linux systems.
           Run the mail program at 8:10 in the morning, rather than 7:20.
           This addresses PR #4194.
spEigenElodie.fits: Recreate with fixed READ_ELODIE().  New first eigenspectrum
           now looks like a normal stellar spectrum.
sprobot_start: Fix tiny typo (extra quotation on line 141).
           Start the main job at 10:30am instead of 10:00am.
sprobot.sh: Change the name of the astrolog directory on sos.apo.nmsu.edu
           from /astrolog -> /data/spectro/astrolog (they changed it!)
sprobot.sh,sprobot1d.sh,sprobot2d.sh,sprobotlist.sh:
           Output the environment variables $IDLSPEC2D_DIR,$IDLUTILS_DIR.
spChunkList.par: Added chunks 48-55.
spPlateList.par: Change yet again to agree with the latest posting from JEG
           of 291 plates.  About a dozen have changed since the Annis list
           dated 13 Oct 02.

In idlutils:

BSPLINE_BKPTS: Integer roll-over bug fixed by DPF for more than 2^30
           data points (doesn't matter for SDSS pipelines, but it
           does for DEIMOS).
DFPSPLOT: Added optional XSIZE keyword.
DJS_BATCH: Add optional keyword SELECTHOST.  This will be used
           for the HoggPT processing of 2.5-m data.
           The inputs LOCALFILE,OUTFILE are now optional.
DJS_LOCKFILE: Add /append option.
DJS_LOCKFILE,DJS_UNLOCKFILE: These routines had a small chance that
           more than one process could lock a file at once.  This
           small chance is now eliminated on Unix platforms running
           IDL 5.4 or later by building a symbolic link as the lock file.
DJS_SFIT: New proc for surface fitting to tabulated data with errors.
EXT_CCM,EXT_ODONNELL: Move these old dust-related routines here since
           they are general-purpose.  They were not previously in any
           repository.
FITS_WAIT: Allow DELTAT,TMAX to be zero.
HELIOCENTRIC: Moved from idlspec2d product, since this is of general use.
HOGG_ITERLINFIT: General-purpose sigma-clipping linear fitting routine
           copied over from the hoggpt product.
HOGG_STRSPLIT: New support proc for YANNY_READ.
LOOKFORGZIP: Also look for ".Z" file if others not found.
POLY_ITER: Change "LT" logic to "LE" to handle case where residual
           is 0 (e.g., a perfect fit)
POPULATE_IMAGE: Fix possible crash condition under Mac OS X when IMAGE
           is 1-dimensional (and NY was not type LONG in the call to C-code).
RADEC_GREATCIRLCE: New proc to solve for the great circle for a set
           of RA,DEC positions at a set of times.
SPLOT: Bug fix in the autoscale code (splot_autoscale_x) that crashed
           on Mac OS X.
YANNY_READ: Make use of Hogg's procedure HOGG_STRSPLIT, which should be more
           robust for parsing strings and speed things up.  Not yet thoroughly
           tested.
           Pre-allocate a large array of length MAXLEN for each structure.
           This should save a huge amount of time when reading large files,
           since we used to concatenate structures with a=[a,b] every time
           a new line was read.
           Add support for compressed files, with file names ending with
           either '.gz' or '.Z'.  This is somewhat complicated by the fact
           that we need to start by getting the number of lines in the file.
           Return an errcode of 0 in the case of no file, which conforms
           to the behaviour of previous versions of this code.
YANNY_READONE: New proc; wrapper for YANNY_READ.
YANNY_WRITE: Default to having the variable names in the typedef's in
           lower-case (not that it matters).

The pro/djsphot directory has been moved from the hoggpt product.
This includes:

DJS_NEFF
DJS_PHOT
DJS_PHOTCEN
DJS_PHOTFRAC
DJS_PHOTSKY
FIND_SIMPLE
QUICK_PHOTFRAC
SQUAREPHOT

These SFD dust routines have been moved here:
BH_RDFORT
DJS_PLANCK
DUST_GETVAL - And modified to read I12, I25, I60 maps also.
FAC_TEMP2FLUX
FAC_FLUX2TEMP
PLANCKCORR
PREDICT_SYNC
PREDICT_THERMAL
SETLOG
WCS_COORD2PIX
WCS_GETVAL

Various astrometric routines have been moved from the hoggpt product
into pro/astrom:
ANGLE_FROM_PAIRS
ASTROM_ENGINE
ASTROM_TWEAK
OFFSET_FROM_PAIRS

evilmake: Add "Darwin" (Mac OS X) as a possible platform.
           Export F77=g77 for the platform.
           This doesn't work yet for Blanton's spheregroup code or Fortran.
export.h: Update this file to agree with the IDL 5.5beta for Mac OS X.
           (There are actually 5 copies of this file in this product!)
sprobot.sh: Comment-out the code that exits if there is no new data.
           This way, we still launch BATCH2D,BATCH1D even if no new data
           has been copied over from Apache Point.

-------------------------------------------------------------------------------
v4_9_12 (Jun 26, 2002 idlspec2d+idlutils) running on IDL 5.3 - 5.5
Built against specflat v1_4.

Minor enhancements for SOS.  For P-1D, now able to generate larger summary
files and improvements to the web site.

APO_LOG2HTML: Change link from SOS web pages to new location at
           "http://sdsshost.apo.nmsu.edu/idlspec2d/spectroSOS.html".
           For the total S/N^2 on a plate, only include exposures
           where quality='excellent', as per PR #3898.
CATPLOT: New proc. Modified version of SPLOT by Tremonti for inspecting spectra.
COLLIMATE: Clarify the output text to say "RMS across CCD", rather
           than implying this is a measurement error (with "+/-").
LINEBACKFIT: Fix typo for setting default value for SIGGUESS.
MAKE_SKYINVVAR: New proc. First attempt to reconstruct the sky background
           with a v4 spPlate file.
PLATEHIST: Select "good" plates based upon "platequality" field
           from PLATELIST.
PLATELIST: Use manually-assigned platequality from "spPlateList.par"
           file when it exists.
           Add fields N_TARGET_MAIN,N_TARGET_LRG,N_TARGET_QSO.
           Add fields SUCCESS_MAIN,SUCCESS_LRG,SUCCESS_QSO.
           Use STRUCT_PRINT to print all ASCII and HTML files.
           Use APO_CHECKLIMITS() to check limits of tabulated values
           and color-code them in the HTML files.
PLATEMERGE: Use MWRFITS_CHUNKS to allow us to write bigger files
           (approximately up to your memory size).
           Add PROGNAME,SPECPRIMARY to ASCII output.
           If SUBCLASS contains several words, then use a plus sign between
           the words in the ASCII file rather than a space (so that awk will
           work).
PLOTSPEC: Added option to use Blanton + Hogg's java viewer (Blanton).
PLUG2TSOBJ: Slight change to find Blanton's files which are now named 
           tsObjPlate-*.fits rather than tsObj-*.fit.
SDSSPROC: If MJD <= 51813, then set QUALITY=excellent unless this is
           over-written by SPHDRFIX.  This is because for the early data,
           this keyword was arbitrarily set to 'unknown', 'bad',
           'acceptable', or 'excellent'.  Note that because of this,
           early data will not have their plan files built properly for
           versions v4_9_10 or v4_9_11.
WRITE_UROS: New proc to generate ASCII files of individual exposures
           on spectra for Uros Seljak
ZPLOT: Change "brg" names to "lrg".

aporsync_logs.sh: Add an rsync command to copy the "sdHdrFix*.par" file
           from the sos.apo machine to sdsshost.apo.  Do *not* rsync
           this file from sdsshost.apo -> sos.apo.
mailhtml.sh: Make archival copies of the SOS log file (sos.log), naming
           them sos.log.1dayold, sos.log.2dayold, ....
make_room.sh: Simple script to remove old MJD data directories on sos.apo
           in order to bring free space to above 5%.  Not called by any
           other scripts -- could be dangerous!
opLimits.par: Use the SKYPERSEC limit for either science or smear exposures.
           Add limits for use by the PLATELIST procedure.
spPlateList.par: Update to data through MJD 52413 (19 May 2002).
           Add PLATEQUALITY,QUALCOMMENTS to Yanny structure.
           Remove the following (bad) plates from public data releases:
             266/51602 (Internal LEDs), 360/51780 (b1 CCD warmed up).
sprobotlist.sh: Call the IDL commands ZPLOT and PLATEHIST each night
           from the Spectro-Robot.
sprobot_start: Add a line to the cron job to run at 12:59 am that
           copies the sprobot.log file to sprobot.log.1dayold and
           sprobot.log.2dayold.

In idlutils:

FLOATCOMPRESS: Handle Infs and NaNs.
MWRFITS_CHUNKS: New proc to write a FITS binary table in chunks
           (used by PLATEMERGE).
REPSTR: Change loop indices to type long, which was necessary to the
           call from PLATEMERGE.  We should be sure that this gets
           into Landsman's code version.
STRUCT_PRINT: Add options TARRAY, /NO_HEAD, /HTML, FDIDIT, DDIGIT, ALIAS.
STRUCT_TRIMTAGS: New procedure.
SXASCII_READ: Fixes for sxascii_read, I think it might actually work?!
YANNY_READ: Hacked by Christy to fix the bug to allow semi-colons
           within quotes.  This adds the internal function YANNY_INQUOTES().
           I suspect there may be a better way to do this using REGEXP().
           If someone ever figures that out, the version before this was 1.31
           (which appeared in v4_9_10,v4_9_11).

evilinstall: One line change to do one more check for proper sdsstools.

-------------------------------------------------------------------------------
v4_9_11 (May 31, 2002 idlspec2d+idlutils) running on IDL 5.3 - 5.5
Built against specflat v1_4.

Fix "make install" bugs and crash condition for P-1D.

LINEBACKFIT: Fix crash condition just introduced (testing for return
           status from MPFITFUN).
LOGSHEET: Include UT time, NAME, CARTID, and QUALITY in outputs.

doc/Makefile: Remove invalid copy line.
etc/Makefile: Change copy of "*" to "*.*" so the "make install" does
           not crash on IRIX+6 platforms.
pro/Makefile: Remove invalid copy line.
pro/inspect/Makefile: Added this makefile.
pro/science/qso/Makefile: Fix Makefile.
templates/Makefile: Change copy of "*" to "*.*" so the "make install" does
           not crash on IRIX+6 platforms.
spectroSOS.html: More comments on the QUALITY keyword.

In idlutils:

MJD2DATELIST: Make MJEND optional, so that this can convert one date
           into a string.

evilinstall: Use "awk" instead of "head -1c" so that this script will
           run on an IRIX+6 platform.
bin/Makefile: For the "make install", explicitly copy file names
           rather than just "*".  Using the wildcard tries to copy
           the CVS directory on an IRIX+6 platform, which then
           crashes the install.
goddard/text/Makefile: We were missing this Makefile.
src/math/Makefile: Comment-out the build of the code that Hogg
           just added but doesn't build: idl_nnls,nnls,diff,g1,g2,h12.

-------------------------------------------------------------------------------
v4_9_10 (May 28, 2002 idlspec2d+idlutils) running on IDL 5.3 - 5.5
Built against specflat v1_4.

New version for Son-of-Spectro with more development work.

APO_CHECKLIMITS,opLimits.par: Allow text limits in the opLimits.par file,
           and allow the use of wildcards for flavor,field,camera.
APOFIX: Use QUALITY header keyword to declare exposures bad (as specified
           by PR #3687).  Enclose any string in single-quotes, so that
           the SPHDRFIX routine can desriminate between strings and numbers.
           Add lots of explicit checks for valid values for each keyword,
           and only allow the modification of a small list of keywords.
           Also add /test option.  If the QUALITY card is edited, then
           go through the logfile (logsheet-$MJD.fits) and explicitly
           change the QUALITY fields in those FITS tables (but don't
           regenerate the HTML table?).
APOHEADER: Use SDSSHEAD() instead of HEADFITS() to read the headers, such
           that this printout includes any observer edits to the headers.
           Also fix so that this proc works if both a ".fit" and ".fit.gz"
           file exist on disk.
           Also list the QUALITY keyword.
APOREDUCE: Add the following to the output structure: QUALITY,NAME,OBSCOMM
           RADEG,DECDEG,AIRMASS.
APOREDUCE,QUICKBIAS,QUICKEXTRACT,QUICKTRACE,QUICKWAVE,REMOVE2REDO: Make
           use of /do_lock keyword when calling SDSSHEAD() or SDSSPROC.
APO_LOG2HTML: Add QUALITY column to output table.
GET_MJD_DIR: Comment-out test that MJD directories contain files, since
           that's so bloody slow.
GUIDERMOVIE,GUIDERMPEG: New procs for looking at the spectroscopic guider
           images for a night.
INSPECFILES,INSPECTGEN: New routines for generating prototype files
           for manual inspection.
LOGSHEET: Do not include both uncompressed and compressed files in a listing.
           Remove the INDIR option, and add MJD and CAMERA keywords.
PLATEHIST: Use call to MJD2DATELIST.
PLATEMERGE: Include logic for setting the SPECPRIMARY field in the outputs.
           Speed this up by pre-generating the exact output structure,
           and use structure assignments rather than copy_struct_inx.
           Exclude some tags from the output structure, spec. ROSAT*,FIRST*.
PLOTSPEC: Some major re-organizing of the main routine to allow PLATE,MJD
           to be passed as vectors.  Add optional ZHDR return value.
           Add /RESTFRAME option.
QUICKEXTRACT: Add warning messages for "Median sky-residual chi2"
           and "Max sky-residual chi2".
QUICKTRACE,QUICKWAVE: Do not write the tsetfile or wsetfile if the
           quality of the exposure in not 'excellent' (and remove any
           such file for that exposure if it already exists).
READSPEC: Fix the re-sorting of the ZLINE output structure, which is
           complicated by being a multi-dimensional structure.
REMOVE2REDO: Only allow this proc to run on a machine named "sos",
           unless /not_sos is set.  This is the same logic used by APOFIX.
SDSSPROC: If the OBSCOMM keyword contains the words "dithered" or "focus",
           then assume this is test data (set QUALITY='test').
SDSSHEAD,SDSSPROC,SPHDRFIX: Add /do_lock option to lock the sdHdrFix files when
           running Son-of-Spectro, which can dynamically alter those files.
SPPLAN2D: Exclude all files where the QUALITY header keyword is not 'excellent'
           (as per change requested by PR 3687).
SPREDUCE1D: The output FRACNSIGLO was being computed completely wrong -- Fixed.
ZFIND: Bug fix for when NPOLY=0.

aporsync_logs.sh: Include the "sdHdrFix*.par" files as the first ones
           to copy over from sdsshost.apo -> sos.apo.
data_rsync.sh,killdata.sh: Two minor fixes: (1) gives proper syntax to
           remove files in spectrolog directories, and (2) excludes
           uncompressed guider files from being rsync-ed to rawcopy.
idlspec2d.table: Add optional dependency on "spinspect" product.
pullspectra: New bash script for pulling SDSS spectra from Princeton
           to other institutions.
opHdrFix.par: Update through MJD 52413 (May 2002 dark run).
opLimits.par: Change exposure time limits to [599,1804] sec, in response
           to PR #3653.
spectro_apodisplay.html: Include more links to spectro.princeton web site.
spectro_inspect.html: New file for instructions on manual inspection of spectra.
spectroSOS.html: Include more links to spectro.princeton web site.
           Update to include comments regarding freeing up disk space (PR 3675).
           Update to include changes to declaring exposures bad (PR 3687).

In idlutils:

BSPLINE_ITERFIT: Added /double to computation of INVVAR (line 107).
DJS_BATCH: Fix invalid return codes in a sub-proc.
NNLS: New non-negative least-squares fitting code from Hogg.
POPULATE_IMAGE: Do not recast if image already float (speeds up 4x)

diff.f,g1.f,g2.f,h12.f,idl_nnls.c,nnls.f: C+Fortran code for NNLS proc.

-------------------------------------------------------------------------------
v4_9_9 (Apr 26, 2002 idlspec2d+idlutils) running on IDL 5.3 - 5.5
Built against specflat v1_4.

New version for Son-of-Spectro with added functionality.

APO_LOG2HTML: Add columns for EXPTIME and AIRTEMP to web page tables.
           Comment-out lines that set FONT SIZE="+4", since that shows up
           as huge on the mozilla web browser.
APOALL,APOREDUCE: Add the /no_diskcheck option.
APOHEADER: New proc for the observers' to print the subset of interesting
           header keywords from the raw sdR files.
APOFIX: New proc for declaring exposures bad, or fixing other header files,
           by using sdHdrFix-$MJD.par files (a new file type).
APOPLOT: Bug fix to prevent crash when specifying EXPNUM.
APOREDUCE: Add CARTID,AIRTEMP,CCDTEMP to all output structures.
BATCH1D: Add spZline file to list of output files.
EXTRACT_OBJECT: Mitigate possible crash condition if relchi2struct not set.
LINEBACKFIT: Fix crash condition if there is at least 1 data point, but
           too few points to fit.  When this happens, MPFITFUN() returns
           with STATUS=0 and does not set PERROR, etc.  This crashed
           plate 230/52251.
PLATELIST: Add NGUIDE,FBADPIX,FBADPIX1,FBADPIX2 to structure.
           No longer compute airmass from TAI, since TAI is now an average
           time and may even correspond to the middle of the day if a plate
           is observed over two nights.  Trust the average airmass in the
           spPlate header.  Add PLATESN2,PLATEQUALITY fields.
PLATEMERGE: Limit output file to only 'good' or 'marginal' plates.
           Get rid of /QSURVEY option.  Add the following columns to
           the output FITS file: progname, chunkname, platequality,
           platesn2, specprimary (not using that last field yet).
QAPLOT_SKYSUB: Don't crash even in the case of a single sky fiber
           (as for plate 218/51461).
QUICKEXTRACT: Return the relchi2struct from SKYSUBTRACT, and put SKYCHI2
           in the output structure.
           For the warning message "Whopping", report the fiber numbers
           as 1 to 640, rather than the 0-indexed fibers on each spectrograph.
SKYSUBTRACT: Merely clean out some commented-out code and update internal
           comments.  Avoid a possible crash condition in the case of
           all (or most?) bad sky fibers.  Version v4_9_8 would still crash
           on the bad data for plate 296/51578 on exposure b2-00002076.
           Insist that if we use "everyn" keyword for b-spline fits,
           that it's >=1.
SPHEADERFIX: Use the new file "sdHdrFix-$MJD.par" that can be written
           by the observers' at APO using APOFIX, rather than using the
           same mechanism through the sdReport file (which was never used).

opHdrFix.par: Declare exposures #14537,14571,14638,14653 bad, which were
           previously declared bad in the sdReport files.  But we're no
           longer using the sdReport files for reductions.
opLimits.par: Impose limits on EXPTIME for bias,arc,flat,smear.
           Impose limits on (S/N)^2 for smear exposures.
spChunkList.par: Add chunks 40-42.
spPlateList.par: Update to include list of DR1 plates.
spectroSOS.html: Document the new procs APOHEADER,APOFIX.
sprobotlist.sh: Get rid of "platemerge, /qsurvey" since that option
           no longer exists.

In idlutils:

BSPLINE_FIT: The YFIT vector was not always being computed, depending upon
           how this routine completed.  Also, some Schlegelization of the code.
DJS_BATCH: Quit if REMOTEHOST is not set, or if any entries are null strings.
           This allows us to disable the Spectro robots by commenting out
           all lines in the batch2d.par,batch1d.par files.
DJS_MEDIAN: Allow ARRAY to be a vector, and pass DIMENSION=1; this is the
           degenerate case where a scalar is returned.
FITSDIR,MRDFITS,MWRFITS,READFITS,SXADDPAR: Fink merged the latest bug fixes
           from Goddard.
FITS_READ: This Goddard routine seems to have had a bug introduced,
           whereby MESSAGE is not always set when reading a partially-written
           FITS file.  I *think* this is fixed, but should see what Landsman
           says about this change.
FITS_WAIT: Add _EXTRA keyword for passing options to FITS_READ, such
           as /HEADER_ONLY or EXTEN=.
HOGG_OPLOT_COVAR: New ellipse plotting routine.
YANNY_READ: No need to read the data in this file (only the header
           and structure definitions) if PDATA is not to be returned.
           Get the ABORT statement all on one line.
YANNY_WRITE: Put quotes around empty strings.  Otherwise, this is not
           a valid Yanny file.  Bug fix for when passing STNAMES.

build_links: Over-write existing links, since that's what I'm usually doing.
pstogif: Perl script for converting PostScript to GIF; copied from /usr/bin
           on sos.apo.
export.h: Put a copy of this file in src/slatec and src/trace, though
           perhaps we should really just have an /include subdirectory?

-------------------------------------------------------------------------------
v4_9_8 (Apr 12, 2002 idlspec2d only) running on IDL 5.3 - 5.5
Built against idlutils v4_9_7, specflat v1_4.

Finish development work for 2D and P-1D before big reprocessing.

EXTRACT_OBJECT: Clean up the calls to SKYSUBTRACT, and only modify
           the pixelmask in the final call to SKYSUBTRACT (when we
           do the 2-D sky-subtraction).
PLOTSPEC: Bug fix to label emission lines with /ZLINE.
REDMONSTER,SKYSUBTRACT: Change threshhold for flagging both the BADSKYCHI
           and REDMONSTER mask bits to a relative chi^2 of 4.0, which is
           what we have traditionally used (except in the last tagged version).
SKYSUBTRACT: Do not modify the input PIXELMASK, but make a copy NEWMASK
           which is modified and returned.  This allows several calls to
           SKYSUBTRACT from EXTRACT_OBJECT, where only the last call
           actually modifies this mask.
SPREDUCE1D: Identify subclasses for galaxies and quasars based upon
           emission lines.  Currently set the following possible subclasses:
           AGN, STARFORMING, STARBURST, BROADLINE.

sprobot_start: Fix trivial bug in setting DISPLAY environment variable.

-------------------------------------------------------------------------------
v4_9_7 (Apr 10, 2002 idlspec2d+idlutils) running on IDL 5.3 - 5.5
Built against specflat v1_4.

More development work for 2D and P-1D.
Traceset routines moved from idlspec2d -> idlutils product.

COMBINE1FIBER: Bug fix to get the NODATA bad pixel set in the ANDMASK
           where-ever it is set in the ORMASK.
ELODIE_BEST: Add FITINDX keyword. Expand default fitting range to +/-1000 km/s.
EXTRACT_OBJECT: Add "OPTCHI2" keyword to output header, recording the
           mean chi^2 of the optimal extraction.
           Add "SKYCHI2" keyword to output header, recording the mean chi^2
           of the sky-subtraction.
MYFLUXCALIB: Put the plate+MJD+camname in the plot titles.
PIXELMASK_BITS: Now simply call the new function SDSS_FLAGVAL().
PCA_SOLVE: Allow OBJLOGLAM to either be a vector or an array
           (now passing only a vector from PCA_STAR).
PCA_STAR: Now read the Yanny file "eigeninput_star.par", and use cz.
           Clean up the code, always using the same wavelength mapping
           for both input and output spectra -- this allows us to do
           away with the internal procedure SPAPPEND.
PLATELIST: Make consistent with changes to spChunklist.par.
           Add the elements: WSIG(MA,MIN,MAX), XSIG(MA,MIN,MAX),
           XCHI2(,MIN,MAX),SKYCHI2,SCHI2(MIN,MAX).
PLATESN: For the roll call, output both the number of bad fibers for
           fiber masks, and the fraction of bad pixels for pixel masks.
PLOTSPEC: Added /ORMASK, /ANDMASK keywords.  Plot text for the zwarning flags.
           Use /normal coordinates for plot labels, so they stay on
           the plot even when zoomming in and out.
QUICKEXTRACT: Do not issue warning message for spatial widths on smear exposures
           since S/N can be so low.  This addresses PR #3511.
READSPEC,SPEC_APPEND: Add the /ALIGN option for aligning all the spectra
           in wavelength.  Also, fix a bug whereby reading objects from
           multiple could get mis-aligned if the OBJHDR keyword was specified
           (this bug was just introduced in the last version).
REDMONSTER,SKYSUBTRACT: Lower threshhold for flagging both the BADSKYCHI
           and REDMONSTER mask bits from a relative chi^2 of 4.0 to 3.0.
SDSS_FLAGNAME: Re-write to include many more types of mask bits
           from the file "spMaskbits.par".
SDSS_FLAGVAL: New function, which is the inverse of SDSS_FLAGNAME().
SKYMASK: Remove the rejection of andmask/BRIGHTSKY, and add rejection for
           ormask/BADSKYCHI.  Now we reject based upon that and
           ormask/REDMONSTER.  For good plates, this will be rejecting fewer
           points.  For the recent horrible data (like plate 889/52346),
           many more points are rejected since the sky chi^2 are so horrible.
           This change will need some real testing.
SKYSUBTRACT: Fix stupid bug where sky-fits are rejected if the mean
           sky is negative, though that only happens rarely.  This did
           cause all the b1 exposures on plate 283/51584 to get rejected
           (one of at least several such examples).
           Fix another rare indexing bug triggered on plate 318/51580-r2,
           and clean up the code that re-selected the sky break points
           based upon the S/N as a function of wavelength.
           Do not set BADSKYCHI mask bit when NOSKY is already set.
           Raise the threshhold for setting the BRIGHTSKY mask bit from
           1.25 * (median sky) to 2.0.
SPCALIB: Save "medwidth" from call to FITDISPERSION in the arcstruct.
           Save "medwidth" from call to FITFLATWIDTH in the flatstruct.
SPCOADD_FRAMES: Average keywords XCHI2,SKYCHI2,XSIGMA,WSIGMA in output header.
           Add output keywords XCHI2MIN,XCHI2MAX,SCHI2MIN,SCHI2MAX,
           XSIGMIN,XSIGMAX,WSIGMIN,WSIGMAX.
           Compute the fraction of bad pixels in total, and on each
           spectrograph.  Bad pixels are any with SKYMASK(INVVAR)=0,
           excluding those where the NODATA bit is set in the pixel mask.
           Then set the header keywords FBADPIX,FBADPIX1,FBADPIX2.
SPREDUCE: Add XSIGMA,WSIGMA to output headers.
SPREDUCE1D: Use SDSS_FLAGVAL() to set the zwarning mask bits.
           Make consistent with changes to line names in "emlines.par" file
           when setting the NEGATIVE_EMISSION mask bit.
           Call ELODIE_BEST() for stars, and append to spZbest output structure.
TELLURIC_CORR: Center the plot title.
ZTWEAK_STAR: New proc for getting the zero-point of the stellar
           templates by matching to the Elodie spectra.

eigeninput_star.par: Version of "eigeninput_star.dat" as a Yanny file.
           Add more Carbon_DQ stars.  Use cz instead of z.
           For stellar types O through late K, change the classifications
           to agree with Elodie (hopefully the fit from 4100-6800 Ang
           is good enough for this), and tweak the redshifts of those
           stars also (using ZTWEAK_STAR).
emlines.par: Couple the N_II emission line ratios at 1:3.
           Append the wavelength to the LINENAME structure element for clarity
           in the output files.
spChunkList.par: Remove verstarg from structure, and add progname.
spEigenStar-52373.fits: New stellar eigentemplates based upon
           eigeninput_star.par.
spMaskbits.par: Heavily modified file to include many more types of mask bits.
sprobot_start: Set the environment variable "DISPLAY=" so that any
           IDL jobs launched from these scripts don't use any additional
           IDL licenses.

In idlutils:

EX_MAX_PLOT: Added panel features.
HOGG_USERSYM: New symbol-making routine.
SXCOMBINEPAR: Add optional _EXTRA keywords to pass to SXADDPAR.

goddard/Makefile: Remove tape_io from the subdir list, since this causes it to
            crash when building under IRIX+6.

The following IDL routines were moved from the "idlspec2d" product:
pro/trace/fchebyshev.pro
          fchebyshev_split.pro
          flegendre.pro
          fpoly.pro
          func_fit.pro
          trace_crude.pro
          trace_fweight.pro
          trace_gweight.pro
          traceset2pix.pro
          traceset2xy.pro
          xy2traceset.pro
The following C code was moved from the "idlspec2d" product:
src/trace/Makefile
          evilmath.c
          evilmath.h
          trace_crude.c
          trace_fweight.c
          trace_gweight.c

-------------------------------------------------------------------------------
v4_9_6 (Mar 29, 2002 idlspec2d+idlutils) running on IDL 5.3 - 5.5
Built against specflat v1_4.

Son-of-Spectro procs for spectrograph focus; changes in SOS data format.
More development work for 2D and P-1D.

APO_CHECKLIMITS: Default to returning the strings '','yellow',or 'red',
            and only turn into an HTML color if /HTML is set.
APO_LOG2HTML: Add FLAT/XSIGMA and ARC/DISPSIGMA to output tables.
            Remove the line of Java-script from the HTML file that
            does the auto-refresh (we'll only put that line in the
            file "logfile-current.html", as created by APOREDUCE).
APOALL: Major updating of this calling script to conform with current
            environment variables ASTROLOG_DIR,RAWDATA_DIR,SPECTROLOG_DIR.
            Also, reduce bias,dark,smear exposures.
APOREDUCE: No longer do the test in the beginning of this procedure that
            the FITS file should exist, since FITS_WAIT() will do that test
            and repeatably look for the file for several minutes.
            Log the versions of IDL,idlspec2d,idlutils into the log file.
            When copying the HTML file to "logfile-current.html", add
            the line of Java-script that does the auto-refresh.
BATCH1D,BATCH2D: Set the DISPLAY environment variable on remote machines
            to always be "", so that only one IDL license on each
            remote machine.  Also, pipe the commands through the bash shell
            on the remote machine, which means the UPS environment must
            be set up in the .bashrc file on the remote machine.
COLLIMATE: New proc for collimating the spectrographs.
CREATE_LINESTRUCT: Make the LINEWAVE element double-precision.
ELODIE_BEST: New function in development for finding best-fit Elodie spectrum.
EXTRACT_IMAGE: The values in XSKY are noisy measurements, so replace them with
            the predicted positions based upon the arc solution when making
            the call to SKYLINE_DISPERSION() -- otherwise, it can crash
            because the positions may not even be properly sorted!
EXTRACT_OBJECT: Remove call to QAPLOT_SKYDEV, since that QA plot contains
            no more information than QAPLOT_SKYSHIFT.
FINDOPFILE: Add /silent option.
FITARCIMAGE: List the (0-indexed) fiber numbers that in which
            any or all arc centroids are fixed.
FITDISPERSION: Re-organization of this code  Add support for SIGMA being
            a scalar, vector, or array.  Optional MEDWIDTH output.
            Output warning messages if out-of-focus.
FITFLATWIDTH: Re-organization of this code  Add support for SIGMA being
            a scalar, vector, or array.  Optional MEDWIDTH output.
            Output warning messages if out-of-focus.
FOCUSHISTORY: First stab at a proc for plotting the spectrograph focus
            as a function of time.  Simply use the wavelength dispersions
            from the arcs, which we have in the spPlate files.
LINEBACKFIT: Force the output sigmas to be non-negative (which also
            prevents a bug later in the code that assumes this is true
            when measuring the chi^2 of each line, as pointed out by
            John Moustakes).
            Remove any lines where LINENPIX=0 by setting its AREA,EW to zero
            and their errors to negative error codes, and remove from YFIT.
            Evaluate YFIT even at points not included in the fit (if INVVAR=0).
            Add SIGGUESS option, and allow SIGGUESS and ZGUESS to be either
            scalars or vectors (one per line fit).
PLATECOMPARE: Fix 1-character typo preventing selecting the MJD
            when using the TOPDIR keyword also.
            Pass TOPDIR to READSPEC rather than explicitly resetting
            the $SPECTRO_DATA environment variable.
PLOTSPEC: Add options /ZLINE, /NOSYN, /NOERR, TOPDIR.
QAPLOT_SKYLINE: Divide the skyline flux values by the airmass, since those
            lines basically scale with airmass.
QUICKEXTRACT: Make call to FITFLATWIDTH, and trigger warning messages if
            the spatial widths are too large, indicating that the spectrographs
            may be out-of-focus (see PR #3462).
            Add XSIGMA_QUADRANT,XSIGMA to output structure.
QUICKTRACE: Call the optimal-extraction code EXTRACT_IMAGE for the sole
            purpose of measuring the spatial profile widths, then use
            FITFLATWIDTH to trigger any warning messages if the spectrographs
            appear out of focus (PR #3462).
            Add XSIGMA_QUADRANT,XSIGMA to output structure.
QUICKWAVE: Call to FITDISPERSION to trigger warnings in the spectrographs
            look out-of-focus in the wavelength dimension.
            Add DISPSIGMA_QUADRANT,DISPSIGMA to output structure.
READ_ELODIE: Optionally return the Elodie header in HDR.
READSPEC: Add TOPDIR input keyword and ZLINE,LINEFLUX outputs.
            Use DIMS0 keyword in primary header of spZall,spZline files
            if it exists to determine the dimensions of [NPER,NOBJECT]
            multi-dimensional arrays.
            Option to return OBJHDR.
SDSSPROC: Add /silent option.
SKYSUBTRACT: Trigger a warning if the airmass exceeds 2.5 (note this proc
            is also called by SoS).
SPADD_GUIDERINFO: Fix crash condition when very little guiding info
            and indexing goes negative.  Add NGUIDE to header.
SPCOADD_FRAMES: Total the NGUIDE header keywords.
SPECLINEFIT: Major re-organization of this procedure, allowing one to either
            pass a plate file name, or all the input arrays (as is now done
            from SPREDUCE1D).  Now fit to emission lines for all object
            types, not just galaxies.
            Pass only those lines within the wavelength range of the spectrum
            (+/- 6000 km/sec) to the line-fitting engine.  This saves CPU
            time that would otherwise be spent determining that these lines
            cannot be fit.
SPPLAN2D,SPPLAN1D: Add more informational messages.
SPPLAN2D: If $SPECLOG_DIR is not set, then use $ASTROLOG_DIR.
SPREDUCE1D: Simply overwrite any existing spZ files, rather than
            using cpbackup to save old ones.
            Call SPECLINEFIT from the end of the code, since it now fits
            emission lines for all types of objects (not just galaxies).
            Add another ZWARNING flag for QSOs with negative emission lines.
SPREDUCE2D: Output the version of the specflat product at the start of the log.
SDSSPROC: Add "WARNING" to the warning messages about invalid or
            missing BC files.
SKYLINE_DISPERSION: Re-write to get the indexing correct.  The first version
            was not comparing the skyline widths to the correct arcline widths.
            The measurement should mean something now.
SKYSUBTRACT: Some cleaning up of the code and catch crash conditions
            for when all the sky fibers are bad (as happened for
            exposure #10965 of plate 644/52173).  For most cases,
            the code should be functionally equivalent.
TRACE320CRUDE: Fix a bug just introduced in v4_9_5 that would cause
            the code to crash if ystart at any trace falls off the
            left or right edge of the CCD.  This caused the
            plate 0179/51580 (and some others) to crash.
ZFIND: Make EIGENFILE an optional input, so that STARFLUX,STARLOGLAM0
            can be specified directly instead of passing a file name.

emlines.dat: Add Ly_alpha,N_V,C_IV,He_II,C_III] for QSOs.
            Let the widths for the Balmer series be independent from
            those of other emission lines, but still constrain the Balmer
            lines and other lines to have the same redshift.  One such
            example where the Balmer lines have a different (narrower!)
            width is 406/52238-362.
idlspec2d.table: Added optional dependence upon "elodie" product.
opBC-50000.par,opBC-51809.par,opBC-51813.par: Extended two bad columns
            in r1 to the top of the CCD (cols 1201+1586).
opHdrFix.par: Declare data bad on MJD 52336-52337 due to spectrograph
            mechanicals problems, and other problems from 52312-52337.
opLimits.par: Add error values for FLAT/XSIGMA and ARC/DISPSIGMA.
mailhtml.sh: Comment out the rm lines (as in 1.18) and leave to killdata.sh
spChunkList.par: Add chunks 36-39.
spectroSOS.html: New warning messages if the flats or science frames
            appear out-of-focus according to their spatial profile widths
            (will only appear in v4_9_6 and later).
            New warning messages if arcs appear out-of-focus according
            to their dispersion profiles.
            Add FLAT/XSIGMA and ARC/DISPSIGMA to output tables.
sprobot.sh: Add more time stamps to the robot log file.
            Change the ssh command that retrieves the MJD directory list
            from the remote machine -- it appears that something about the
            sed command no longer works the same.
sprobot_start: Comment-out "spamdup" job in the cron file, since we don't
            seem to need that hack any more to keep the NSF-automounts alive.
            Set $SPECLOG_DIR=$ASTROLOG_DIR for the purposes the the Spectro
            robot.

In idlutils:
ASINH2: Better asinh (from Blanton for PROFINTERP procedure).
BSPLINE_ITERFIT: Always reset OUTMASK so that the input value does not matter.
            Set YFIT to all zeros in the case that the fit fails.
EX_MAX_PLOT: Moved from /math to /plot.
FAST_FIT_SERSIC: New proc.
FIT_SERSIC,PROFINTERP,SERSIC: Bug fixes, and use ASINH2.
HOGG_INTERVAL: New proc.
MAGGIES2LUPS: New proc.
MJD2DATELIST: New proc to construct a list of MJDs and date strings
            spanning a range of MJDs (useful for plot limits).
PPMTOMPEG: New proc.  Wrapper for ppmtompeg, the open-source UNIX mpeg writer.
RADEC_TO_FIELDS: Configurable option allfieldfile.
SEEING_RADIAL: New proc.
SERSIC_PARAMS: New proc.
SPLOG: Add /NO_STDOUT keyword.
SXPAR: Landsman fixed to handle CRVALn of different type properly
YANNY_READ: If reading a Yanny file aborts, then log the file name,
            the line number of the failure, and the line itself.
            Small speed improvement made in internal proc YANNY_READSTRING.
src/spheregroup/chunks.c: Roundoff error problem fixed.
eviltarball: Comment out the reference to sdsscvs.
evilinstall: Use UPS_PROD_FLAVOR environment variable (not UPS_FLAVOR).

In specflat:

First set of global biases (pixbiasave-*.fits) from many nights of data.
Pixel flats now based on more nights of data.
specflat.table: Added "Flavor=Linux"

-------------------------------------------------------------------------------
v4_9_5 (Mar 1, 2002 idlspec2d+idlutils) running on IDL 5.3 - 5.5
Built against specflat v1_3.

Minor bug fixes for SOS.

APO_LOG2HTML: Generate the HTML file name even if the FITS file has a path
            in the name, as happens when being called from REMOVE2REDO.
BATCH2D: Include 'smear' exposures when generating list of output files.
            (Not doing this caused a crash for plates w/ only smears).
FLUXCORR_NEW: Provide a better test of valid smear correction, fixes PR #2478.
QUICKTRACE: Reverted to doing full trace for flats.  Time saving by only 
            tracing part of the flat image introduces a risk not worth the gain.
REMOVE2REDO: Fix possible crash condition, and change calling sequence to
            DJS_MODFITS in the case that an HDU should become empty.
            If files have been removed, then update the HTML file so that the
            files to be re-reduced are removed from the web page until then.
SPCOADD_FRAMES: set BADFLUXFACTOR only for extreme smear corrections=20x median 
TRACE320CRUDE:  Fix bug dependent on invvar being set.
            Small change to note number of goodrows in xmask, non-critical.

aporsync_logs.sh: Re-order the files copied so that we get the sdReport
            file first.
opLimits.par: Change the good limits for bias counts from [0,20] to [0,15].
sprobot_start: No longer reference $BATCH2DFILE,$BATCH1DFILE, which are
            no longer used.
sprobot_start,sprobot.sh: Added optional $SPROBOT_RSH environment variable
            for specifying the protocol for copying the raw data.
sprobotcopy.sh: Deleted.
sprobotlist.sh: Trimmed version of "sprobotcopy.sh", which only creates
            the plate list and summary files once per day.

In idlutils:
DJS_MODFITS: Added /DELETE_DATA keyword, which is functionality needed
            for sos_redo (the REMOVE2REDO procedure).
-------------------------------------------------------------------------------
v4_9_4 (Feb 28, 2002 idlspec2d+idlutils) running on IDL 5.3 - 5.5
Built against specflat v1_3.

More development of 2D.
Minor bug fixes for SOS.
Runnable version for P-1D.

APOREDUCE: Check how full the disks are for both the input files (sdR images),
            and the outputs.  Issue a warning message if either is >95% full.
ATVRAWSPEC: Display a 2D spectroscopic image with bad columns marked in red.
            This is useful to see that all bad columns have been masked,
            especially when looking at the 2D pixel flats.
BATCH1D,BATCH2D: Look for the parameter file batch1d.par,batch2d.par
            in the TOPDIR directory rather than reading environment
            variables $BATCH1DFILE,$BATCH2DFILE.
CREATE_LINESTRUCT(): Function broken out of LINEBACKFIT so that it
            can be called by SPECLINEFIT.
EXTRACT_OBJECT: Added call to skyline_dispersion (for increasing the
            instrumental response width to agree with the width of sky
            lines), but correction is not implemented because the measurement
            appears to be very noisy. Check invvar with whopping fibers.
FINDOPFILE: Find the op file corresponding to a specified MJD.
            This function is broken out of SDSSPROC so that it can
            be used by other procs (like ATVRAWSPEC).
FITDISPERSION: Mask regions not neighboring lines of interest.
            Simplifies extraction of line widths.
            Minor tweaks, npoly=10 no longer valid -> changed to npoly=5.
LINEBACKFIT: Fix possible crash condition when computing LINENPIX if
            the line width is unphysically narrow and no pixels fall
            within the region of an emission line.
MATCH_TRACE: Added keyword radius, and set default to 2 (rather than 3).
            This seems to fix PR #2626 (Large bad regions not large enough
            w/LOWFLAT) and PR #2063 (Extraction problem fibers 321-400 on
            Plate 401/51788), both of which were due to some traces being
            slightly off.
PLATECOMPARE: New TOPDIR optional keyword for comparing different
            reductions of the same data.
PLOTSPEC: Optional /ZWARNING flag.  Report error if FIBERID out of range.
PLUGHISTORY: Plot the history of unplugged fibers based upon plPlugMapM files.
QAPLOT_FCALIBVEC: Generate QA plot of apparent flux-calibration errors
            by comparing spectra to synthetic (e.g., best-fit) spectra.
            This proc is called at the end of SPREDUCE1D, and generates
            figures and warning messages if the min/max apparent fluxing
            errors are large (more than 10% anywhere).
QUICKEXTRACT: Call REJECT_SCIENCE() to decide if a science exposure is bad
            due to lamps being turned on, too many saturated pixels, etc.
            If number of sky fibers > 20, then select one good sky fiber
            from each of the 16 bundles.  Assumes 20 fibers per bundle.
            This addresses PR #3238.
            Fix bug whereby bad pixels can trigger whopping fibers.
            Bad pixels can trigger whopping fibers.
READSPEC: Don't fail when asking for SYNFLUX, but the spZ file doesn't exist.
            (This prevented PLOTSPEC from plotting anything in that case.)
REJECT_SCIENCE: Check in the header that all the flat-field screens are
            open and that all the FF,NE,HGCD lamps are turned off.
            With this check, exposure #11504 of plate 727/52207 would
            have been automatically rejected for having the FF lamps
            turned on (see PR #3169).
SDSS_FLAGNAME: Change some of the target names to agree with what's been
            changed in the target code in the past year or so.  Note that
            I had already updated the target names in spectro_home.html.
SDSSPROC:  Change to select which op file to use based upon the MJD in the
            file name rather than the MJD in the header of a Yanny param file.
            Make the MJD selection of the op files a bit more clear.
            Issue a warning message if there is no op file with an MJD
            equal to or less than the image's MJD.
            The function FINDOPFILE is broken out into its own file.
SKYLINE_DISPERSION: Function similar to fitdispersion which measures
            gaussian line widths of sky lines given arc line dispersion set
            as initial guess.  Indices of sky fibers can be specified to
            restrict width  measurements to these fibers only.
            The measured widths and corrections are logged to the log file
            with the following info:
              xpos = X position on CCD
              ngood = number of good measurements (<= number of sky fibers)
              flux = flux of this sky line
              arc = the dispersion width measured in the arc lines
              min, max, median = a sample of the distribution of widths (in
                                 pixels) for each skyline
              med_diff = the median quadrature difference: width^2 - arc^2
              stddev = the scatter in the quadrature difference for that line
SPBIASAVE: New proc to average together a set (or all!) 2D pixel biases.
            This proc is modelled on SPFLATAVE.
SPCOADD_FRAMES: Remove the following keywords from the spPlate file:
            PIXBIAS,FLATFILE,ARCFILE,OBJFILE.
            Issue a warning message if any object fibers have OBJTYPE=NA,
            which should be impossible, but the special plate 673 and
            possibly others had some such fibers.
            Add UNAME keyword which is the result of 'uname -n'.
SPECLINEFIT: Fixed dumb mistake on indexing that could crash.
            Always create an NLINE x NOBJ output structure, with blank
            entries where we do not measure lines (currently, only
            measuring for GALAXY objects).
SPFLATAVE: Add comments to output header to track which files were used;
            change default for input directory to current.
SPFLATTEN2: Undo the last change of using the opBC-empty.par file, since
            we do want to ignore bad columns when tracing fibers, etc.
SPREDUCE: No longer issue an abort message in this proc if the science
            exposure is declared bad, but issue those messages from within
            the REJECT_SCIENCE() function.
SPREDUCE1D: The warning message for S/N > 200 pixels has been fixed,
            and another warning added for any pixels w/ flux < -10 * noise
            (e.g., unphysically low values).
            Mask out points that are unphysically negative (10-sigma negatives),
            and mask the neighboring 2 pixels in each direction.
            Call new procedure QAPLOT_FCALIBVEC to measure flux-calib errors.
TRACE320CRUDE: Add replacement code section for traces with
            bad columns near starting position.

idlspec2d.table: Added "Flavor=Linux"
eigeninput_star.dat, spEigenStar-52333.fits: Update of stellar templates.
            Use many A stars, Carbon stars, Carbon_DQ stars, WD stars
            instead of just 1 for building eigentemplates.
            Many more K stars, with subtypes Kearly,Kmid,Klate.
            No changes to F stars yet (or even checks of their velocities).
mailhtml.sh: Grep for the "APO Spectro" from the HTML file to get the
            subject line for mail; I had changed this HTML title string,
            which then gave a missing subject line in the e-mail (PR #3200).
opBC-50000.par,opBC-51809.par,opBC-51813.par: Add a small trap on r2
            at 1168,1339; extend the b1 badcols 1762-1673 to the top of
            the CCD by 10 more rows; extend the r2 badcol 1585 to the top
            of the CCD by 908 more rows.  Re-order some of the entries
            for clarity.  Make opBC-51809 identical to the others except
            for the 4 additional entries on b1 and 1 additional on r1.
opConfig-50000.par,opECalib-50000.par: Renamed copies of opConfig.par
            and opECalib.par with an MJD in their names.
opHdrFix.par: Declare bad aborted smears for plate 601 and 803.
            Declare bad exposure on plate 866.
            Don't include test data from MJD 52318.
            Declare all r2 exposures on MJD 51779 bad due to electronics
              problems (PR #2335), only effecting plate 356.
            Remove bad data for plate 727 on MJD 52207.
            Remove bad data for plate 724 on MJD 52240.
            Remove bad smear for plate 860 on MJD 52319.
spectroSOS.html: Update to reflect new warning messages.
sprobot.sh: Bug fix where we were rsync-ing all of sos.apo:/data/spectro/$MJD
            on the line where we only wanted to get the guider directory!

In idlutils:
New procedures in pro/coord for various SDSS coordinate transformations.
Many of these were in the hoggpt product:
  ATBOUND
  ATBOUND2
  ETA_TO_STRIPE
  ETALAMBDA_TO_STRIPE
  ETALAMBDA_TO_MUNU
  MUNU_TO_RADEC
  RADEC_TO_FIELDS
  RADEC_TO_MUNU
  STRIPE_TO_ETA
  STRIPE_TO_INCL
ATV: Add "R" and "C" features for overplotting rows and columns.
COMDIS: Minor bug fix, making loop variable type long.
GAUSS_KERNEL: sigma should have been sigma^2 (This proc is used
            by SKYSUBTRACT,SMOOTH_HALO,RLINE_FINDEW in idlspec2d).
SPHEREMATCH,chunks.c: Bug fix for wrap.
YANNY_DIFF: New proc to compare two Yanny files, optionally copying values
            from one to another.
YANNY_READ: Read lines up to 2047 characters long (instead of 1023)
            without resorting to the /QUICK option.
YANNY_WRITE: Add STNAMES keyword if writing out Yanny files that were
            read with YANNY_READ(/ANONYMOUS).
evilinstall: Now with all the messy confusion at Fermi, it is no longer
            possible to auto-detect Linux flavors using the $SETUP_UPS
            environment.  It is best to first set an environment variable, ie.:
              UPS_FLAVOR=Linux+2
            to over-ride the auto-detected flavor on Linux boxes, which now
            always appears to come up as Linux+2.4, which no one actually uses.

idlutils.table: Added "Flavor=Linux"

-------------------------------------------------------------------------------
v4_9_3 (Feb 12, 2002 idlspec2d only) running on IDL 5.3 - 5.5
Built against idlutils v4_9_2, specflat v1_3.

Trivial fix to Makefiles for install.
Still a buggy version for P-1D.

-------------------------------------------------------------------------------
v4_9_2 (Feb 12, 2002 idlspec2d+idlutils) running on IDL 5.3 - 5.5
Built against specflat v1_3.

This tagged version is for running Spectro-2D.
It also addresses some rsync bugs for Son-of-Spectro.
Re-write of velocity dispersion + line-fitting for P-1D, but a buggy version.

APO_CHECKLIMITS: Wasn't matching on flavor.  Fixed.
APO_LOG2HTML: Mistakenly was listing times as hr:sec instead of hr:min!
            Remove the first word from each warning or abort message line
            (which is the name of the IDL proc that generated the message,
            and confuses the observers; we sill have the proc name in the
            original FITS file from which the HTML is generated).
APOPLOT,PLOTSPEC: Change the http address for Kent's image server to
            its new location at http://sdssmosaic.fnal.gov:8015/.
APOREDUCE: Added warning if disk space is nearly full where output
            directory resides (if 'df' command reports more than 95% full).
            (But not nessarily testing the directory where the raw FITS
            files are copied.)
DJS_SVDFIT: This is a modified version of SVDFIT from IDL 5.3, since the version
            in IDL 5.4.1 crashes when the matrix is singular!!
            Presently, this is called by FIND_NMINIMA().
FIND_NMINIMA: Add /DEBUG keyword; small changes to plotting.
            Call DJS_SVDFIT instead of the IDL library function SVDFIT(),
            since it looks like they broke the latter in IDL 5.4.1.
FINDCHI2MIN: Clean up this code some.
           This routine used to be used by VDISPFIT, but is no longer.
FLUXCORR_NEW:  Return all zeros in fluxcorr image if 
                  "WARNING: No spectrophoto with high S/N"
           No longer required checking of "Bad" values for medium S/N.
GET_TAI: A short proc to determine, beginning, mid-point, and ending
           timestamps for sdR exposures.  Uses TAI-BEG,TAI-END in header
           if they exist; otherwise compute from TAI and EXPTIME.
           This is now called from the following procs: EXTRACT_OBJECT,
           SDREPORTMAKE, SPADD_GUIDERINFO, SPBIASGEN, SPCALIB.
           Note that version v4_9_1 would not reduce the early data since
           we had changed to using TAI-BEG, which did not exist for the
           early data.
LINEBACKFIT: New generic proc for fitting emission lines + linear background
           terms.
PCA_ELODIE,READ_ELODIE(): New routines for reading the Elodie eschelle
           spectra and generating eigenvectors for velocity dispersion fits.
REMOVE2REDO: Never consider the compressed (sdR*.fit.gz) files for removal,
           since those are our archived copies of the raw data.  Only remove
           the *.fit files.  That way, if the data gets removed from
           sdsshost.apo and we run this proc, we don't delete all copies
           of the data on sos.apo!
SPADD_GUIDERINFO: New routine to compute seeing and average guider offsets
           from the guiderMon param file, and add those results to a FITS
           header.
SPBIASGEN,SPFLATTEN2: Use an empty bad column file (opBC-empty.par) when
           generating the 2D pixel flats and bias images.
SPCOADD_FRAMES: Combine a whole bunch of header cards from the individual
           input exposure for the output exposure.  Specifically, this was
           to address PR 2174 to average the weather data.  The cards effected:
           'AZ', 'ALT', 'TAI', 'WTIME', 'AIRTEMP', 'DEWPOINT',
           'DEWDEP', 'DUSTA', 'DUSTB', 'DUSTC', 'DUSTD', 'GUSTS', 'HUMIDITY',
           'HUMIDOUT', 'PRESSURE', 'WINDD', 'WINDS', 'TEMP01', 'TEMP02',
           'TEMP03', 'TEMP04', 'HELIO_RV', 'SEEING20', 'SEEING50', 'SEEING80',
           'RMSOFF20', 'RMSOFF50', 'RMSOFF80'
           We also take the min of all 'TAI-BEG' cards, and the max of
           all 'TAI-END' cards.
           Don't alter incoming file list, copy to internal variable list
           of filenames.
SPCOMBINE: Set default value of MINSN2 to 0.2 instead of 0.0.  This is a
           work-around for the moment to prevent one bad exposure (#6808)
           from corrupting the combine of plate 358/51818.
           Also, go back to not including the smear exposures in the combine,
           unless one explicitly sets the /SMEARINCLUDE keyword.
           Exclude fluxcorr images with entire image = 0 -- that's now a
           possible result from running FLUXCORR_NEW where the signal is
           so low that we can't compute the flux-correction vectors w.r.t.
           the smear exposure.
SPECLINEFIT: First calling script for line-fitting code, modelled after
           SPREDUCE1D.  This can be stand-alone, or called at the end
           of SPREDUCE1D.  For the time being, only do these fits for
           objects of type GALAXY.
SPREDUCE1D: Set the ZWARNING=8 flag (synthetic spectrum is negative) only
           for stars, not for QSO's any more since we use several eigen-
           components to fit QSO's now, nor for CV stars for the same reason.
           Use the file 'spEigenElodie.fits' for computing velocity dispersions.
           Write out the best-fit velocity-dispersion spectrum as HDU#3.
           Make consistent with changes to VDISPFIT.
           Add CHI68P to output structure, for the 68-th percentile value
           of abs(chi).
           Call SPECLINEFIT at the end of this proc.
TRACE320CRUDE: Threshold to set 'BADTRACE' is now 45% bad pixels, whereas
           it used to be 20%.
VDISPFIT: Option to return the best fit with YFIT keyword.
           Mask out +/- 6 pix from emission lines instead of only 4 pix.
           Option to pass EIGENFILE,EIGENDIR rather than use default file.
           Use FIND_NMINIMA instead of FINCHI2MIN to find the minimum,
           since the latter did a spline fit that could wiggle in
           unconstrained ways.
           In cases of bad fits, return error codes as negative VDISP_ERR.
           Return a code of -4L if there is no wavelength overlap.
           Insist that convolution kernel have odd number of elements, and
           convolve with /CENTER keyword.
           Only cache over-sampled templates if the template file name
           is unchanged between calls.
           Make this routine a function that returns a structure.
           Also return VDISPCHI2,VDISPNPIX,VDISPDOF in output structure.
ZFIND: Add fields to the output structure needed for velocity dispersions.

aporsync_logs.sh : 
           Changed the syntax to just copy these type of files in astrolog
           (which we *thought* we were doing, but wasn't quite working):
             Unplugged*.ps
             exposureLog*.par
             fiberScan*.par
             guiderMon*.par
             op*.par
             plPlugMap*.par
             sdReport*.par
sprobot.sh: Fix syntax bug when passing $upsversion to BATCH1D,BATCH2D.
killdata.sh,mailhtml.sh: Spectrolog cleanup is now done +25 MJDs afterwards,
           which will allow for sos_redo, apoplot and debugging to have
           a buffer.  Enable the call to data_rsync.sh again for copying
           the *.gz files locally from /data/spectro/$MJD to
           /data/spectro/rawcopy/$MJD.
sprobot.sh: Copy the guider image directory.  We mistakenly lost this copying
           when we went to explicitly copying only the sdR*.fit.gz files.
sos.sh,startapo.sh: Forget to switch to UT time in a couple of instances.
opBC-5000.par,opBC-51813.par: New bad column masks, somewhat circular dependence
           on pixflats.  Make opBC-50000.par identical to opBC-51813.par, so
           that the only different bad column masks are for the few nights from
           MJD=51809->51812 as stored in opBC-51809.par.
           For r2 (camcol=2), now mask all of columns 370-371 instead of parts.
           For r2 (camcol=2), add mask for column 1068.
           For r1 (camcol=4), mask only cols 1112-1115, not cols 1112-1117.
opBC-empty.par: New file with no bad columns for use when generating the
           2D pixel flats and bias images with SPFLATTEN2 and SPBIASGEN.
opLimits.par: Bug introduced when I reformatted the TOTAL/TOTALSN2 entries
           (done to address PR #2562 to differentiate between bias and
           dark current levels).  This fix closes PR #3185.
spEigenElodie.fits: First 70 eigen-components of the 700-ish Elodie spectra,
           generated at Sloan resolution using PCA_ELODIE.

In idlutils:
DJS_MEDIAN: Bug fix for crash condition when WIDTH is greater than
            the number of elements in the array.
DJS_REJECT  : Major bug in /groupbadpix option, should now work as intended
BSPLINE_ITERFIT: Fix major bug with /GROUPBADPIX option which is used
           by COMBINE1FIBER.
SPLOT: For gaussian line fitting, display the Area (not the peak height),
           and try fitting absorption lines as well as emission lines.
           Still not always a good fit, since I'm using the IDL build-in
           CURVEFIT() rather than MPFITFUN, which would be better.
SXCOMBINEPAR: New proc to combine values of specified header cards from
           many FITS headers.  (This option used by SPCOADD_FRAMES.)

-------------------------------------------------------------------------------
v4_9_1 (Jan 24, 2002 idlspec2d+idlutils) running on IDL 5.3 - 5.5
Built against specflat v1_3.

This tagged version is for running Son-of-Spectro; not viable for Spectro-2D.
Bug fixes to run on IDL 5.5.
Changes to how the SOS robot launches the rsync jobs and fix other SOS bugs.
Bias-subtraction now implemented (bias images in the "specflat" product).
New set of templates for P-1D; QSO's now use 4 eigentemplates.

APO_LOG2HTML,APOREDUCE: Switch from saving the Mountain standard time (MST)
           string to only storing TAI time, and computing UT on-the-fly.
APO_LOG2HTML: Compare the exposure "flavor" when looking at the operational
           limits (in the "opLimits.par" file).  This allows us to
           differentiate between bias and dark levels (PR #2562).
APO_CHECKLIMITS,APO_COLOR2HEX: These functions broken out of APO_LOG2HTML
           since they are now used by APO_PLOTSN too.
APO_PLOTBIAS: Remove ROOT_DIR keyword, but look at $RAWDATA_DIR environ
           variable instead.  Look for uncompressed or compressed raw files.
APO_PLOTSN,APO_LOG2HTML:  Only add (S/N)^2 that is not flagged as anything
           bad in the opLimits file (currently anything < 2.0 is bad).
           This should be true for both the HTML table and for the S/N plots.
APOFLUXCALIB: Procedure for generating a canonical set of flux-calibration
           vectors (including the superflat) for on-the-mountain plotting
           of spectra using APOPLOT.
APOALL,APOREDUCE: Allow setting MINEXP to 0 sec.  Change default of MINEXP
           to 0 sec, so that any exposure with non-negative exposure time
           is reduced by Son-of-Spectro.
APOPLOT: New proc for plotting spectra from the Son-of-Spectro outputs at APO.
APOPLOT,LOGSHEET,PLOTSPEC: Set the !QUIET option for procedures where it is
           annoying to see all the IDL messages.
BATCH1D,BATCH2D: Allow NICE to be set to zero.  Add UPSVERSION keyword to do
           a "setup idlspec2d $UPSVERSION" on the remote machine before
           executing the IDL job.  This allows you to batch jobs using a
           version other than that which is declared current under UPS.
BATCH2D: At the end of a batch job, spawn the following:
           spawn, 'rm -f spArc*.fits* spFlat*.fits* spSky*.fits*'
           in order to remove files that eat up too much disk space right now.
COMBINE1FIBER: Use the /GROUPBADPIX keyword for rejection in B-spline fits.
DANVB_CONVERT,DANVB_QSOLIST: Procs for generating a list of input
            QSO's from Dan van den Berk's EDR list "plateEDR.summ"
            for generating QSO eigenvectors.  The output file
            "eigeninput_qso.dat" is then used by PCA_QSO.
DIVIDEFLAT: Make INVVAR an optional keyword instead of an input for DIVIDEFLAT.
            Change the procedures that call this.
EXTRACT_OBJECT,SPBIASGEN,SPCALIB,SPREDUCE: For TAI time, use the midpoint
            of the observation as determined by TAI-BEG + 0.5 * EXPTIME
            from the header.
EXTRACT_OBJECT,SPREDUCE: No longer write the sky vectors to a different file,
            but write them to the spFrame files.  Also, always write the
            telluric-correction array, which will simply be an empty HDU
            for the blue CCDs.
FIND_NMINIMA: Retain each peak only if it is at least MINSEP from all
            previous peaks.
FINDSPEC: Crash if the plate list file is missing w/ an informative message.
            Do not crash if spPlate files missing for some plates.
FITARCIMAGE: Bug fix to prevent IDL 5.5 from crashing.
FITSN: The logic for choosing fitting limits for all possible bands
            has been moved to this function.  This function will now
            choose the full mag range [0,23] to fit if there are fewer
            than 20 points in the default ranges and at least 3 good points.
            This function is called by the following routes in Son-of-Spectro:
               APO_PLOTSN -> PLOTSN -> FITSN
               QUICKEXTRACT -> FITSN
            This function is called by the following routes in Spectro-2D:
               PLATESN -> PLOTSN -> FITSN
               EXTRACT_OBJECT -> FITSN
MULTISYNTHSPEC,SYNTHSPEC: Bug fix for when wavelength spacing is different
            between the template and the requested synthetic spectrum.
PCA_CVSTAR: New proc for generating eigen-spectra for CV stars.
PCA_QSO: Major re-write now that we're trying to use the eigen-spectra
            from this routine for the redshift-finding code, rather
            than using the single QSO template that we've used to date.
            Solve for 4 eigencomponents in rest-frame [460,9300] Ang.
            Try solving for one eigen-component at a time.  When I tried
            solving for them all simultaneously, this resulted in an
            unphysical 1st eigencomponent, probably because each spectrum
            only covers a small range of rest wavelength.
            Also, make some plots.
PCA_SOLVE: Add NRETURN keyword for returning a different number of
            eigen-components from the number used (NKEEP) for replacing
            bad and noisy data points.  Optionally return NEWFLUX,NEWIVAR.
PCA_STAR: Major changes to read stellar classes and subclasses,
          then generate the 2-component PCA solution for all M stars
          (for example) and reconstruct types M1 through M9.
PLATECOMPARE: Add /PSFILE option.
PLATELIST: Add NEXP,EXPT_B1,EXPT_B2,EXPT_R1,EXPT_R2,SMEARUSE,TAI_BEG,TAI_END,
          SEEING*,RMSOFF*,AIRTEMP,CARTID to output struct.
          Now show the status of 2D and Combine separately, which will make it
          obvious when this problem occurs. When it happens, Status2D
          might still be "Running" even though StatusCombine is "Done".
          That case would mean that one of the night's of 2D data
          probably crashed, and we combined from whatever subset of data
          did run through from other nights.  This addressed PR #2993.
          Add the /KILLPARTIAL option for deleting data from partially-
          combined nights, which only happens from the Spectro-Robot
          operating in real-time.
PLOTSN: Changed auto-scaling of fitted magnitudes, when less than 20 objects
            are in the desired range.  Now the fitting range will expand to
            [10.0, snmag + 1.0].  So in case of g' [10.0, 21.2], this should
            work much better for the photo-z S/N estimates.
PLOTSPEC: New keyword option /NETIMAGE to plot corresponding PHOTO images
            in a Netscape window using Steve Kent's web tool.
QAPLOT_SKYSUB: Don't be quite so severe with warning messages.  If a single
            sky fiber has bad flux levels, report as a "Warning" instead
            of a "WARNING".  Trigger the "WARNING" about "Max sky-residual
            chi" at 5.0 instead of 4.0.
QUICKBIAS: Remove message which preempts logging.  Instead, return a
            set of precentiles that are all -9999, which shows up as ****
            in the HTML file.
QUICKEXTRACT: Put exposure time dependence in scattered light warning.
            It is the same limit as we had before for 900-sec exposures,
            the same limit for shorter exposures, and a (scaled) higher
            limit for longer exposures.
            Include FIBERMAG in the output structure, where we use MAG[1] for
            any blue frames, and MAG[3] for any red frames.
REDMONSTER: Change the warning message to "Bad sky residuals...",
            and only send the message "Red Monster at..." if it
            is around 6400-6600 Ang, where we think the problem may
            be due to the hand-paddle LED.  This change is for the
            benefit of the observers (from Son-of-Spectro warnings).
            Also output the peak chi.
REDMONSTERLIST: New procedure: List of number of galaxies and quasars per
            plate, the number of redshifts that differ from prior reductions,
            and the fraction of various 2D flags set.
REMOVE2REDO: Make more robust, and give more descriptive messages.
            Another attempt to fix errors in remove2redo.  It might now
            work with plate argument: "sos_redo plate=665", but should
            definitely work with simple invocation: "sos_redo".
            --> Now a re-write of this, allowing either PLATE or EXPNUM
                keywords (but not both) as of 8 Jan 2002.
RLINE_FINDPEAKS: Updated to demand minimum separation, and commented.
SDSS_FLAGS: Add "SOUTHERN_SURVEY" flags for TARGET and TTARGET.
            Also, return a warning message for any bits that are set
            but whose meaning is unknown.  Previously, a wrong answer
            would just be given in that case.
SDSSPROC: Reverted to calls to specflat_version,speclog_version that work.
            New option /APPLYBIAS to bias-subtract.  This fixes PR #2595,
            subtracting the bias-induced flux at 3800-4600 Ang flux (b1) in
            fibers 17+18.
SLATEC_EFC (in idutils):  Call FILL_BSPLINE() instead of EFC2D().
SPBIASAVE: New routine to average biases already generated with SPBIASGEN.
SPCOMBINE: Bug fix for dealing with missing spFrame files (as for plate
            204/51455, where this proc would crash).
SPPLAN2D: Change the default of MINEXP to 1 sec, so that special plates
            like the M67 plate (#321) will be reduced.
            Make a plan file if either science or smear exposures exist
            (before it required the existence of science exposures).
            Get the MJD from the directory name $RAWDATA_DIR/$MJD, not
            from the header of the 1st file which may be wrong.  This
            happened on MJD 52247, where there was a bias taken on MJD 52246
            which messed up the plan file for plate 766 on MJD 52247.
            But I will at least issue a warning in the proc if there is an
            MJD that appears incorrect in one of the headers, as in this case.
SMOOTH_SUPERFLAT: Located the spurious WARNING, changed to Warning, and
            upped the threshold.  It was not the critical one of the two
            smooth_superflat warnings.
SPBIASGEN: New routine for generating mean biases for a night.
SPCALIB,SPFLATTEN2,SPREDUCE: Use /APPLYBIAS option in call to SDSSPROC.
SPCOADD_FRAMES: Convert dispersion vectors to log-lambda units (1.0d-4, PR 1870)
            When combining fibers, we used to use MAXITER=20.  Now use
            MAXITER=50, MAXREJ=1.
            Bug fix for SMEARUSE keyword in header, which was incorrectly
            always set to 'F'.
SPCOMBINE: New optional keyword MINSN2 to set the minimum S/N to include
            in co-adding; default to 0.0 for the time being (see PR 1901).
            Otherwise, special plates that have all bright objects will not
            get combined (since the extrapolated S/N at 20th mag is so low).
            Include 'smear' exposures as well as 'science' in the co-adds,
            which should let us recover some spectra that are otherwise
            saturated in 15 min exposures.
SPFLATGEN: Add optional keywords EXPNUM,EXPSTART,EXPEND.
SPHDRFIX: Add support for editing raw frame (sdR-*) headers by putting
            OPHDRFIX entries in the sdReport-$MJD.par files, of the
            same form as that used in the file "opHdrFix.par".
            We've changed the structure name SPECHDRFIX to OPHDRFIX, since
            we can use exactly the same thing for PT or 2.5-m data.
SPREDUCE1D, ZFIND, ZCOMPUTE, FIND_NMINIMA: Plotting and debugging
            tools added with the /DOPLOT, /DEBUG keywords.
SPREDUCE1D: Change flag for small chi^2 difference to be triggered
            when RCHI2DIFF < 0.01 or when RCHI2DIFF < 0.01 * RCHI2.
            This means that the difference in reduced chi^2 should be at
            least 0.01 if chi^2/DOF=1, or at least 0.10 if chi^2/DOF=10.
            Print the versions of idlspec2d,idlutils in the log file.
            If the outputs spZall,spZbest files already exist, then rename
            those files rather than destructively over-writing them (using
            CPBACKUP).
            Added search for CV's using the eigenfile 'spEigenCVstar-*.fits'.
            Search for QSO's out to z=7.0, but this will require templates
            that span [525,9300] Ang.
            For the moment, disable setting the 32L flag for ZWARNING,
            since this seems to usually be erroneously set (when it is set)
            in the 2nd pass through the ZFIND routine.  I'll have to track
            that down later.
            Fix bug that SN_MEDIAN wasn't positive definite.
            Add FRACNSIGHI,FRACNSIGLO to outputs.  Trigger ZWARNING=16 from
            only high outliers (FRACSIGHI) for QSO's, whereas we trigger
            based upon FRACNSIGMA for all other objects.
ZCOMPUTE, FIND_NMINIMA: Return a (negative-valued) error code
            from FIND_NMINIMA, which ZCOMPUTE stuffs into Z_ERR.
ZFIND: If fewer than NFIND peaks are found, then return blank structures
            for the remaining (NFIND-NPEAK).  Previously, some of those
            fields (such as TFILE,TCOLUMN) were filled with information.

aporsync.sh: Keep archiving guider images (gzipped).
aporsync.sh: Only copy the following select set of files:
             Unplugged*.ps, fiberScan*.par, guiderMon*.par, op*.par,
             plPlugMap*.par, sdReport*.par
aporsync.sh, sprobot.sh, sprobot1d.sh, sprobot2d.sh:
             Log the UID and PPID (parent process ID) to the file "sos.log",
             and record the timestamp both when this script is launched
             and finishes.
aporsync_logs.sh, aporsync_blue.sh, aporsync_red.sh:
             New scripts called from "sos.sh" instead of "aporsync.sh".
             This should be more robust, and prevent the logging+guider
             files from hanging up the whole system.
sos.sh, sos_status, startapo.sh: Use the new aporync scripts.
sos_start: Set defaults for RAWDATA_DIR and ASTROLOG_DIR appropriate for
             the machine sos.apo.
eigeninput_cvstar.dat: New file for PCA_CVSTAR.
eigeninput_star.dat: Many more M stars added for implementing changes
            to PCA_STAR.
opHdrFix.par: Correct some values for TILEID,RADEG,DECDEG for the early plates
            187, 202 and 214.
spFluxcalib-*.fits: A canonical set of flux-calibration vectors produced
            by APOFLUXCALIB and used by APOPLOT.
sos_redo: Don't allow this to be run from the machine sdsshost!
            --> Now a re-write of this, allowing either PLATE or EXPNUM
                keywords (but not both) as of 8 Jan 2002.
sprobot_start: Copy the data over starting at 10am Princeton time,
            which will be after "mailhtml.sh" is run at APO (at 7:20 am).
sprobot.sh: Run the same version of the idlspec2d product as is set up
            for this script.  For example, even if v4_9 is declared current,
            run v4_8 if that is what's set up when this script is run.
            So, you should run "sprobot_start" from the version of the code
            that you want to reduce the data.  The only exception is if the
            current version is not a UPS version, but just NOCVS; in that
            case, the version declared current on each remote host is used.

Combine all of the install instructions into one place,
in the file "idlspec2d_install.html".  The instructions
from "spectroSOS.html" have been moved there.
Add header card info to the "spectroSOS.html" document.

In idlutils:

All Goddard libraries updated to the versions as of 3 January 2002 from
the web site "http://idlastro.gsfc.nasa.gov/homepage.html".  It looks like
the last time I did any updates was exactly two years ago, on 5 Jan 2000.
The most notable update is to MRDFITS, which Wayne Landsman modified in
Dec 2001 following suggestions from Finkbeiner & Schlegel.  It explicitly
handles more data types (like UINTs, BITPIX=8, BITPIX=64) and deals with
null strings when writing structures to FITS binary tables (w/out crashing,
as it did before).
The following procedures moved within the Goddard repository:
      astro/oploterr.pro (moved from /jhuapl)
The following duplicate procedure was removed from the Goddard repository:
      misc/ydn2md.pro (other copy is in /plot)
All of the procedures in pro/tape_io have been removed from Goddard.
The following procedures are new to the Goddard repository:
      astro/cosmo_param.pro
      astro/galage.pro
      astro/lumdist.pro
      astro/observatory.pro
      astro/planet_coords.pro
      astro/gal_uvw.pro
      astro/calz_unred.pro
      astro/jplephinterp.pro
      astro/jplephread.pro
      astro/tdb2tdt.pro
      astro/jplephtest.pro
      astro/lsf_rotate.pro
      fits/fxmove.pro
      idlphot/pixwt.pro
      math/meanclip.pro
      math/minf_parabol_d.pro
      math/value_locate.pro
      math/asinh.pro
      misc/fstring.pro
      misc/n_bytes.pro
      misc/checksum32.pro
      plot/vsym.pro
Files in goddard/data and goddard/text have also been added+deleted+modified.

BSPLINE_ITERFIT: Properly passing INMASK to allow for recouping lost data
           points.  Small cosmetic changes to work clearly with INMASK
           and OUTMASK.
DJS_REJECT: Added GROW option to mask neighboring pixels.
            Added /GROUPBADPIX option, which probably fails with multi-
            dimensional data (Scott thinks).
            Also some small changes to the way grouping works.
EFCMN: Small change declaring a loop index as a long int.
EXTAST: Allow GSSS coordinate systems other than RA,DEC.  Specifically,
            allow the use of 'GLON-GSS' and 'GLAT-GSS' which we use
            in the PT image headers.  This means that our version of this
            code is currently branched from Wayne Landsman's Goddard version.
RMFILE: Bug fix for the case that one element of the filename array is blank.
YANNY_FREE: Don't crash if PDATA is not set.
YANNY_READ: If there are too few words on a line for a structure entry,
           then set ERRCODE=-1 and return PDATA=0.
           Also, increase the allowed line-length to 1023 characters
           (was 255).  The file can still have longer lines by using
           the back-slash as a continuation.  And one can still use
           the /QUICK option for lines with more than 1023 characters,
           but that option fails if continuation characters are used.
           Add the STNAMES keyword to return the names of structures
           for when /ANONYMOUS must be used.
           Special-case the replacement of {{}} with "", since it seems
           that some bonehead used the former to denote blank strings in
           the idReport files.
vector_avsigclip_mask: Fix a bug in the C code vector_avsigclip_mask
           that could potentially affect the IDL proc DJS_AVSIGCLIP
           in the case when a mask is used but all points are rejected.
evilinstall: If unable to check-out or install the code,
           then do not declare it current in the UPS table!
           Print "ABORT" for any failures in the install.
evilmake: Turn optimization flags back on, which we commented
           out some time ago because it failed on an OSF platform.
           Still might not work under OSF as far as we know, but who cares?
           We'll pick up 20% in speed for Spectro-2D under Linux by optimizing.

-------------------------------------------------------------------------------
v4_9_0 (Nov 10, 2001 idlutils only) running on IDL 5.3 - 5.5
Built against specflat v1_2.

YANNY_PAR (in idlutils): Add INDX keyword, and fix bug in returned COUNT.
         Support for KEYNAME input as an array.
evilinstall (in idlutils): If $CVSROOT is not set, then set it either
         by setting up the "sdsscvs" product or explicitly setting to the
         Fermi CVS location.  This allows the option of installing from a
         different repository (i.e., Princeton or NYU) by setting $CVSROOT
         first.

-------------------------------------------------------------------------------
v4_8_4 (Aug 29, 2001 idlspec2d+idlutils) running on IDL 5.3 - 5.4
Built against specflat v1_2.

Minor fix to 2D-combining code for running plates 214,340,270 which failed.

MYFLUXCALIB: Fix bug whereby the PCA spectrum could be negative.
     (The routine PCA_SOLVE() can return a negative-valued spectrum even
     if all the input spectra are positive-valued.)  This crashed plate 340.
PCA_SOLVE: Forgot to return optional outputs OUTMASK, USEMASK in the case
           of only a single spectrum being passed.  This happened in the
           combining of plate 214 in MYFLUXCALIB, and crashed.
SDSSPROC: Prevent dividing-by-zero when using /APPLYPIXFLAT,
          though the resulting NaN's had been caught and replaced anyway.
SPREDUCE1D: The outputs ANYANDMASK,ANYORMASK were not being constructed
            properly, and were simply wrong.  Should be fixed now.
sprobot,sprobot_start: Scripts now use the environment variables
          SPROBOT_HOST,SPROBOT_LOCALDISKS for telling which machine to copy
          the raw data from, and which local disks to write to.
          These scripts are now generalized to the point where they can
          be run from anywhere by just setting up environment variables.
spChunkList.par: Update chunk list for chunks 20-25 (up to plate 769).

BSPLINE_BKPTS (in idlutils): Do not crash even in the case of very few
         data points.  But untested whether this actually does what we want
         in that case.
BSPLINE_ITERFIT (in idlutils): Return cleanly in the case of no un-masked
         data points.
eviltarball (in idlutils): New script to export a version of a code
         and build a tar file for distribution.

-------------------------------------------------------------------------------
v4_8_3 (Aug 24, 2001 idlspec2d+idlutils) running on IDL 5.3 - 5.4
Built against specflat v1_2.

Cut version for running P-1D, improving the redshift fits + errors.

BATCH1D,BATCH2D: Added /CLOBBER option to reduce all specified plates,
         over-writing any previous reductions.
BATCH2D: Enabled keywords PLATESTART,PLATEEND,MJD,MJSTART,MJEND.
         Change the logical link to the raw data directory to be
         topdir+'/rawdata' rather than simply '../rawdata'.
         The latter would fail when outputs for some plates were
         in other linked directories, and then '../rawdata' did not
         resolve to anything.
FIND_NMINIMA: Replacement code for FIND_NPEAKS, for solving the chi^2
              minima for redshifts.  This routine will fit a quadratic
              if there are only 3 points, and a gaussian plus a constant
              if there are more than 3 points.
              If there is an error in the fit, return an error code as a
              negative integer in XERR.
GET_MJD_DIR: Make leading zeros significant.  This was necessary to fix
             the bug that '5*' would match 500 but also 050 and 150.
MJD_MATCH: New routine split out of SPPLAN1D.
READSPEC: Minor change to prevent crashing if data for some objects
          does not exist.  Specifically, if structures for some objects
          (e.g., ZANS or TSOBJ) did not exist, this routine could crash.
          Read the synthetic spectrum from the Zbest file if ZNUM is not set.
          This is much faster than regenerating the spectrum.
SPEC_APPEND: Minor change to prevent crashing if data for some objects
             does not exist.  (This routine is used by READSPEC).
SPPLAN1D: Now call MJD_MATCH().
SPREDUCE1D: Change the width in velocity space for fitting the chi^2
            minima in the redshift-finding.  These widths can be broader
            now that we'll be fitting with gaussians rather than quadratic.
            (The quadratic fits were not a good approximation when fitting
            more than a few points.)  Now always use at least 5 points.
            Add another ZWARNING flag: Set the 32L bit if the redshift-error
            warning flag is set to -1, which means that the chi^2 minimum
            was at the edge of the redshift-fitting range.
VDISPFIT: Increase chi^2 computation from [0,475] to [0,600].
ZCOMPUTE: Replace call to FIND_NPEAKS() with FIND_NMINIMA().
ZFIND: Do not modify any errors that are less than zero, since those
       can be used as just warning flags from the fit.
       Increase to search lags (as specified by PMIN,PMAX) according to
       the values of both PWIDTH and WIDTH.
ZFITMAX: Replace call to POLY_FIT with SVDFIT such that this routine
         behaves the same under either IDL 5.3 or 5.4.  It was the
         case that the errors were improperly computed using the re-
         write of POLY_FIT in IDL 5.4.

New template files spEigenGal-52146.fits,spEigenStar-52146.fits
based upon v4_8_1 reductions, though using the same input list of
spectra that we've been using for ages.

In idlutils, added MPFIT routines from Craig Markwardt.  These will
be used for the redshift-finding code (specifically, FIND_NMINIMA).

build_links (in idlutils): Do not build a link for any file if the link
        name already exists.

-------------------------------------------------------------------------------
v4_8_2 (Aug 16, 2001 idlspec2d+idlutils) running on IDL 5.3 - 5.4
Built against specflat v1_2.

Trivial changes for running this version at Fermi.

SPALLREDUCE: SPECFLAT_DIR is not set now, if SPECFLAT product exists and 
          is specified (this proc only used at Fermi).

PLATECOMPARE: New proc for interactive comparison of descrepant redshifts.
PLATELIST: Added /PURGE2D, /PURGE1D options.
PLOTSPEC: Added /NOERASE keyword.  Minor fix to Y plotting range.

RMFILE (in idlutils): Add support for deleting a list of files.
SPLOT (in idlutils): Minor bug fix to avoid plotting the axes twice.
evilinstall (in idlutils): Syntax changes to work with bash on spectro.

-------------------------------------------------------------------------------
v4_8_1 (Aug 9, 2001 idlspec2d+idlutils) running on IDL 5.3 - 5.4
Built against specflat v1_2.

Cut version for re-running Spectro-2D on all data.

EXTRACT_OBJECT,SMOOTH_SUPERFLAT: Better working smooth_superflat (with a QA
          plot).  Added "Area" to plot anything above 0.01 gives a warning.
FILTER_THRU: Fix failure mode when only a 1-d WAVEIMG is passed.
PLATELIST: Add EXPTIME to output files.
PLOTSPEC: Major re-write to allow flipping through many plots on a plate
          and change plotting parameters.  Or, send plots to PostScript files.
          Usage of ZNUM changed -- see READSPEC for new usage.
          Plot labels in green for legibility in the plot window, and
          include the ZWARNING flag in the label if it is nonzero.
READSPEC: Return successfully even if redshift files not found.
          Change usage of ZNUM such that ZNUM=1 is best fit, ZNUM=2 is 2nd best.
SPCOADD_FRAMES: Set keyword SMEARUSE to T or F.
SPFLATAVE, SPFLATTEN2: Handle edge effects better.  In SPFLATTEN2, set
          any pixels more than 2 pixels from the left/right of the first/last
          fiber equal to zero.  Then, in SPFLATAVE, any edge pixels that are
          zero from all nights are set to unity.
VDISPFIT: Bug fix for objects with negative velocities.
idlspec2d.table: Make an optional dependence upon the "specflat" product.
sprobot.sh: Copy only the compressed ("sdR-*.fit.gz") files from
            sos.apo.nmsu.edu, instead of the raw files from sdsshost.apo.

evilinstall (in idlutils): Minor syntax changes to work with RH7.1 on spectro.
ATV (in idlutils): Handle unsupported CTYPE, CTYPE reversal gracefully;
                   left click on apphot (Imexam) prints coords
SPHEREMATCH (in idlutils): New code to match two lists of RA,DEC.

-------------------------------------------------------------------------------
v4_8_0 (Jul 17, 2001 idlspec2d+idlutils) running on IDL 5.3 - 5.4
Built against specflat v1_1.

First cut of v4_8 with many major changes.  Not yet tested for prime time.

******MAJOR CHANGE: spFrame output is now normalized with superflat,
                    to correct for small scale features which cannot be removed
                    by standard star correction.
                    HDU 6 now contains the superfit in spFrame
                    Telluric correction has been moved to HDU 7.
          The B-spline break-points in the files blue.bkpts, red.bkpts
          have been changed.

SKYSUBTRACT: Increased rejection limit for 1d fit.  This should be more robust
          anyway, and tighter rejection was masking out real PSF variations
          which led to very big sky residuals in 2d fit.
          Also decreased the number of blue side breakpoints to 1024.

FITVACSET :  keyword "airset" which return air wavelength solution with
          no heliocentric correction (required to properly sample superflat
          shifted to skyline frame)
FIBERFLAT :  keyword superflatset to return normalized superflat fit
DIVIDEFLAT:  removed all traces of fibermask 
EXTRACT_OBJECT, SKYSUBTRACT, SPCALIB: Implement 2D-splining for sky-
          subtraction, now set to do quadratic PSF fit.
          Also, first attempt to put in airmass correction to the sky
          brightness by dividing all the sky vectors by the airmass of
          each fiber, then fitting for the supersky, then multiplying
          back in the airmass terms. 
          New limits to mask in pixelflat 0.8 < flat < 1.2.
                              old values: 0.5 < flat < 1.5
          
EXTRACT_OBJECT: Set the "NEARWHOPPER" mask bits only for fibers within 2
          fibers of a bright fiber, but not the bright fiber itself.
          For the bright fibers, add the bit "WHOPPER" (added to the
          param file spMaskbits.par).
            Changed the rejection thresholds yet again, and also uncommented
          2-D sky subtraction to test.
EXTRACT_OBJECT, SKYSUBTRACT: Exit gracefully in the case of no good sky
          fibers.  In that case, issue an "ABORT" log message, return
          SKYSTRUCT=0 from SKYSUBTRACT, then do not write an spFrame file.
EXTRACT_ROW: Do not correct rejection levels in relative mode if chi^2 < 1.0.
             This means that we can boost the errors to be larger than the
             expected Poisson errors, but not smaller.
FIBERFLAT: Update to call SUPERFLAT() as a function instead of a proc,
           though should not be functionally different yet.
FILTER_THRU: Switch to the newly-measured filtered curves, "sdss_jun2001*.dat".
             Use the Goddard routine LINTERP instead of the IDL built-in
             INTERPOL.  Also, correct the integrations for the pixel size.
FITMEANX: Make robust to no good sky lines for tweaking wavelength solution.
          In that case, the routine LOCATESKYLINES will return SKYSHIFT=0.
FPOLY, FUNC_FIT, TRACESET2PIX, TRACESET2XY, XY2TRACESET:
             Added "poly" as one of the functions for trace sets.
LOCATESKYLINES: Test that the sky line file is successfully read.
MYFLUXCALIB: Fairly major changes: Do a pre-filtering of the spectra that
             go into the PCA-fitting of the flux-calibration vector, and
             mask out the most deviant points.  Run the PCA-fitting with
             more iterations to ensure convergence.  Also, finally comment
             this code.
PCA_SOLVE: Construct the USEMASK from the output mask (OUTMASK) instead of
           from NEWIVAR.  This is equivalent to TOTAL(OUTMASK,2).
           This should make the flux-calibration vectors produced by
           the proc MYFLUXCALIB more robust, since it rejects pixels in
           the solution based upon USEMASK.
PLATELIST: Read MJDLIST keyword from the spPlate files, which will only exist
           with future reductions.
           Include a computation of the airmass in the FITS version of the
           platelist file.
PLATESN: Pass a plot title to PLOTSN.
PLOTSN: For the 2nd page of plots with Synthesized mags. vs. PHOTO fiber mags.,
        make these residual plots.  Also, use plot titles.
QAPLOT_SKYLINE: Plot skyline strength residuals as a function of airmass,
        which in fact is exactly what they are correlated with!
        Issue a warning message if the computed airmasses are out of the
        range [1,3].
REJECT_SCIENCE: New proc to reject science exposures if they are blatantly
                bad (typically, if they are saturated).  We have already been
                doing this for arc + flat exposures.  This proc is called
                by SPREDUCE, and will issue an "ABORT" log message if a
                science frame is rejected.
SDSSPROC: Add VERSLOG, VERSFLAT keywords to specify versions of the
          products SPECLOG, SPECFLAT.
          First search for files "pixflatave-*.fits", and if not found then
          look for "pixflat-*.fits".
SDSSPROC, SPCALIB, SPREDUCE, SPREDUCE2D: No longer pass the name of the pixel
          flat between all these files.  Instead, just let SDSSPROC find the
          correct one in the "specflat" product, in $SPECLOG_DIR/flats.
SMOOTH_HALO: A new version of smooth halo, which should be closer to the truth.
SORTPLUGMAP: Fill in unplugged fibers with arbitrary entries, and assign
       them a FIBERID.  For spectrograph #1, we assign the unplugged fibers
       from the beginning of the plugmap, and for #2 from the end.
       This should result in the unplugged objects being uniquely placed
       on only one of the spectrographs.  This addressed PR #2487.
SPCOADD_FRAMES: Include MJDLIST keyword in spPlate header, which will be
                the list of all MJD's used in an SPCOMBINE.
                Add BUNIT keyword for the flux, inverse variance, and
                dispersion HDU's.
SPFLATAVE: New routine to average together a set (or all!) pixel flats
           in the SPECFLAT directory.
SPFLATGEN: New routine.  Wrapper for SPFLATTEN2 for generating pixel-to-pixel
           flat-fields.
SPFLATTEN2: Major changes! Now call the 2-dimensional B-spline code when
            generating the superflats.  However, there seem to be problems
            with this code for some combinations of NORD and NPOLY.  I have
            set NORD=3, NPOLY=4 which seems to be a combination that works.
            (A PR has been filed against idlutils.)
            Subtract the scattered light image before dividing by the super-
            flat evaluations -- w/out doing this, we had bad residuals where
            the scattered light contribution was large compared to the signal
            (particularly in the UV).
            Also, small changes to how directory names are parsed, and retain
            the header from the file ALLFLATS[0] for the output file.
SUPERFLAT: Pass X2, NORD and NPOLY keywords to support fitting 2-dimensional
           B-splines in the call to BSPLINE_ITERFIT().  At the moment,
           this will only be implemented for the proc SPFLATTEN2, not for
           FIBERFLAT.  (So this shouldn't effect the spectro reductions
           except for updated pixel flats.)
           Also, make this a function instead of a proc.
TELLURIC_CORR: Fixed horrible bug in using fibermask to reject bad fibers
               (fixes PR #2162).  Also, when fitting the local continuum
               around a single telluric band for a single star with a
               polynomial, do the fit with weighted points and iterated
               rejections using DJS_REJECT().
THROUGHPUT_CALIB: New proc for assessing total system throughput using
                  the intermediate files "spFluxcalib*.fits".
TRACE320CRUDE: Added call to DJS_MASKINTERP() in the beginning to prevent
               hot columns from throwing the initial trace (which does
               not use the errors at all).
zplot: Quick-and-dirty script for finding and plotting a spectrum (at Princeton)
       w/out setting up any path variables or SDSS products.

f8v.abs: Increase flux-calibrating mask around H-alpha by 50%, now
         masking +/- 1500 km/s (+/- 32.8 Ang).
opBC-51813.par: One extra bad column [370,1800:2047] on r2.
       There are a few extra additions to match the new pixflatave-00000 files.
       Instead of flagging all of the "pits", these are not included, but
       can be rejected using minflat/maxflat = 0.8/1.2

BSPLINE_ACTION, INTRV (in idlutils): Bug fixes for 2-D spline fitting.
     Include 'poly1' function in BSPLINE_ACTION(), and set the function
     properly in BSPLINE_ITERFIT.
BSPLINE_FIT, BSPLINE_ITERFIT (in idlutils):
     Remove MASK keyword, since it is too confusing with INMASK, OUTMASK
     already used in BSPLINE_ITERFIT().  It didn't look like it was
     actually used anyway!
DJS_REJECT (in idlutils): Add the GROUPDIM keyword, and allow GROUPDIM,
          MAXREJ and GROUPSIZE to be vectors for several limits in the
          rejection algorithm.  These were some major changes, and hopefully
          are completely backwards-compatable.
SPLOT (in idlutils): Changed interactive gaussfit (g) so amplitude is correct.
YANNY_READ (in idlutils): Try to make backwards-compatable with IDL 5.2
          by replacing calls to STRSPLIT() with calls to STR_SEP.
build_links (in idlutils): New script for building links between directories.
evilinstall (in idlutils): Add another option for location of sdssfue
          scripts (for the installation on sos.apo), and also set the
          CVS locations to the default at Fermi if not set up with
          "setup sdsscvs".

-------------------------------------------------------------------------------
v4_7_6 (Jun 9, 2001 idlspec2d only)

data_rysnc.sh: Bug fixes in SOS copy, and adaptation to sos.apo.nmsu.edu
               (i.e. ps -elf does not work, and scp1 does not exist).

-------------------------------------------------------------------------------
v4_7_5 (Jun 8, 2001 idlspec2d only)

data_rsync.sh: SOS should now attempt to archive data with gzip and move
               offsite in the morning.
killdata.sh, mailhtml.sh, sos.sh, startapo.sh, APOREDUCE:
               Adapted to work on sos.apo.nmsu.edu, and fixed file transfer
               bugs.  For APOREDUCE, changed spawn of "scp1" to "scp", since
               the former did not exist on the new machine sos.apo.

sprobot_start: Remove "sprobotcopy" from the cron jobs, since copying
               reduced data to Fermi always fails.
               Set SPECLOG_DIR=$ASTROLOG_DIR for the Spectro-Robot.

-------------------------------------------------------------------------------
v4_7_4 (May 10, 2001 idlspec2d+idlutils)

COPY_STRUCT, COPY_STRUCT_INX (in idlutils):
          These routines didn't work properly for structures with more
          than 32768 elements, because of using only 2-byte integers.
          This resulted in READSPEC not working properly for large lists,
          and other dependent routines such as ZPLOT (where I noticed it!).
READSPEC: Bug fix when reading one range of fiber numbers for a FITS
          binary table, i.e. "READSPEC, 301, [1,2,3], ZANS=ZANS" was not
          returning the correct values.
ZPLOT: Include MJD in call to READSPEC.

spPlateList.par: Enlarge list of EDR plates to include multiple pluggings,
       and other plates that should have been in the list according to van
       den Berk's mail to sdss-spectro/665 on 2 May 2001.  The list now
       includes 136 plates, many of which are repeat observations.

Spectro-Robot scripts:
       Let the scripts "sprobot2d.sh" and "sprobot1d.sh" test whether they
       are already running, and quit if they are.
       Update the syntax to "ps" commands as per RHL's suggestions.
       From sprobot.sh: Batch process 2D first, wait for it to complete,
       then batch process 1D in the background.

-------------------------------------------------------------------------------
v4_7_3 (Apr 30, 2001 idlspec2d+idlutils)

PLATESN: Typo introduced on April 13th that crashes SPCOMBINE -- fixed!
SDREPORTMAKE: New proc for generating sdReport files from raw idR files.

In idlutils:
YANNY_READ: Add optional /ANONYMOUS flag to avoid conflicts in structure
            types, in the event that named structures actually change
            between calls (will be used by SDREPORTMAKE).
            Split lines with semi-colons, for when reading early sdReport
            files with SDREPORTMAKE; however, this may introduce bugs
            elsewhere because it was not done totally generally.

In the Spectro-Robot bash scripts, change the top-level directory for
the plug-map files from $SPECLOG_DIR to $ASTROLOG_DIR.  Use the $SPECLOG_DIR
only for re-running with cut versions of everything, including the "speclog"
product.

-------------------------------------------------------------------------------
v4_7_2 (Apr 27, 2001 idlspec2d only)

PLATELIST: Use the "spPlateList.par" file to determine which data are public.
           Add a PUB column to denote if a plate is in a public data release.
PLATEMERGE: Add the /PUBLIC option to trim only to public data.

More updates to "opHdrFix.par" file.
Makefile in /bin did not copy all executables when installing; now it does.
Update the batch files to use the wire machines as a default.
Update spectro home page to reflect v4_7 reductions.

-------------------------------------------------------------------------------
v4_7_1 (Apr 9, 2001 idlspec2d+idlutils)

FILTER_THRU: Add new Doi filter curves (CCD+atmosphere+telescope), and
             add /TOAIR flag to convert from vacuum to air wavelengths.
             (But not yet called by 2D or 1D).
PCA_SOLVE, COMPUTECHI2: Make robust to one or all of the template spectra
              (e.g., the STARFLUX vectors) being identically zero.
              The routine PCA_SOLVE could crash w/out special-casing this
              due to an apparent bug in the built-in routine PCOMP().
SPCOMBINE, SPCOADD_FRAMES: Optionally allow spFrame files to be g-zipped.
READSPEC, SPREDUCE1D: Allow spPlate, spZ files to be g-zipped.
READSPEC: Major changes to speed up the code when reading a sparse number
          of fibers per plate.  It used to read all the fibers between the
          smallest and largest fiber number.  Now it divides up the requested
          fibers into contiguous chunks, and reads in only those chunks.
          (The plate file is still only opened once, and the header is only
          read once.)

Add new mask bit: NEARWHOPPER.  This effects the following routines:
              EXTRACT_OBJECT, FLUXCORR_NEW, MYFLUXCALIB, TELLURIC_CORR.
              These fibers are also implicitly ignored by sky-subtraction
              because the sky-fiber selection implicitly assumes all fiber-
              mask bits are fatal (in EXTRACT_OBJECT).

Son-of-Spectro changes:
New executable, "sos_redo" to re-run SOS on failed reductions.
APO_APPENDLOG: Now overwrite entries in the file "logfile-$MJD.fits" if an
              exposure is re-reduced (e.g., with "sos_redo").
APO_LOG2HTML: Placed a lower limit of (S/N)^2 > 2.0 to count towards total
              in each camera
QUICKEXTRACT: Change message about post-cabibs from "REQUIRED" to merely
              "recommended."
              Slightly loosened constraints on match_trace to +/- 0.15 pixels.
QUICKTRACE: Tweak test for putative Argon lines in flats to be a less
            sensitive trigger.
REMOVE2REDO: (New proc) Checks for missing entries in logfile*fits and
            removes corresponding raw data; called by script "sos_redo".
The routine FIND_WHOPPING is moved out of EXTRACT_OBJECT so that it can
            be called by QUICKEXTRACT.
Changed SOS signal-to-noise warning to a yellow warning below S/N=15/pix,
            and S/N=13/pix.
More entries in "opHdrFix.par" to fix all the incorrect plugmap files
            known to date.  However, we still need to get the correct
            files copied into the /astrolog directories.

-------------------------------------------------------------------------------
v4_7_0 (Mar 16, 2001 idlspec2d+idlutils)

FLUXCORR_NEW: Replace deviant fluxcorr coefficients with the median
              Attempt to mask large positive deviations in inverse variance
              (PR #2040) 
SPCOMBINE:    combinedir is now a keyword for spcoadd_frames.
              SPFLUX and SPCOADD_FRAMES utilize directory keywords as well.
              Start by zeroing-out the 4 mask bits set by combining step.
FIBERFLAT:     Simple check to exclude extrema  (PR #2123)
COMBINE1FIBER: Replace the lines which errantly set NODATA with a check for the
               extrema wavelengths which have no signal. (PR #1939)
SPPLANCOMB, 
SPALLCOMBINE:  Fixed Bug to combine a specific MJD

BSPLINE_ITERFIT (in idlutils): Modified to avoid crashing SPREDUCE1D.
   Two changes: (1) Return a valid solution even in the case where the variance
   of the y-vector is zero.  (2) In the case where there are too few points to
   fit, still return a valid solution of all zeros.
FINDSPEC: New routine for finding SDSS spectra that match a given RA, DEC.
MULTISYNTHSPEC: New routine that is sometimes faster than SYNTHSPEC, but
           I would not recommend using this yet.
MYFLUXCALIB: Make robust to degenerate case of only 1 input spectro-photo std.
PLATELIST: Lower (S/N)^2 cutoff to 13 for all G,I bands (from 15 previously).
           If ZWARNING flag exists in 1D outputs, use that to determine
           number of UNKNOWN or SKY identifications.
PLOTSPEC: Add ZNUM option (also new to READSPEC).
READSPEC: Add option to generate the synthetic spectra.
          Add ZNUM option to get fits other than the best fit.
REDMONSTER: New routine for looking for Red Monster (large regions of
            bad sky residuals, which, for example happens when the hand-paddle
            light is on at the telescope).  Flag these pixels with the
            REDMONSTER mask bit.  This routine replaces MONSTER.
SPREDUCE1D: Search for stars at velocities to +/- 1200 km/s (was 600 km/s).
            No longer identify objects as UNKNOWN, but rather set bits
              in a ZWARNING flag.
            Add outputs ZWARNING, SN_MEDIAN, FRACNSIGMA,
              COUNTS_SPECTRO, COUNTS_SYNTH, COUNTS_SKY (not used yet),
              VDISP, VDISP_ERR, ANYANDMASK, ANYORMASK.
            Compute velocity dispersions using real-space method (VDISPFIT).
            Slightly increase width for re-fitting galaxy redshifts from
              PWIDTH=5 to 7.  This may fix PR #1938.
            Speed up computation of FRACNSIGMA by calling FILTER_THRU()
              for the whole plate at once.
            Output SYNFLUX as a 2nd HDU in the spZbest*.fits file.
SYNTHSPEC: Calling sequence now allows for returning an array of spectra.
TELLURIC_CORR: If a telluric star is deemded bad, then reject all of
            its FITFLUX pixels from the global fit.  Previously, we were
            only rejecting the pixels INDT, but still allowing bad continuum
            pixels into the fit.  This fixes PR #2028.
YANNY_PAR (in idlutils): If several lines have the same keyword name,
            then return all of those values as an array.  This makes this
            routine backwards-compatable with Yanny files written previously
            with SPPLAN2D.
ZFIND: Get rid of SIGMA2,SIGMA2_ERR and add VDISP,VDISP_ERR.

Add new mask bits: BADSKYCHI, REDMONSTER, SMEARIMAGE, SMEARHIGHSN, SMEARMEDSN.

New installation script "evilinstall" in the idlutils product.

Add a line to the cron tables from "sos_start" and "sprobot_start" to
keep the disk auto-mount points alive at Princeton (or anywhere using an
amd daemon).

-------------------------------------------------------------------------------
v4_6_2 (Feb 14, 2001)

For the Fermi calling script SPALLREDUCE, add an NCOMBINE keyword
to limit the number of exposures combined.  Default to a maximum of 7.

-------------------------------------------------------------------------------
v4_6_1 (Feb 14, 2001)

SPCOMBINE: Reverting to adderr=0.03 to prevent rejections in high S/N regions
SKYSUBTRACT: The "fix" in the previous version didn't properly check the
             bad mask bits, and in fact could make things worse.  Now fixed.

-------------------------------------------------------------------------------
v4_6_0 (Feb 9, 2001)

EXTRACT_OBJECT: Reverted to Gaussian Profile, more robust flat field 
                 interpolation, still 3% are fluctuations when 
                 NEARBADPIXEL is set.
FIBERFLAT: Fiber is flagged BADFLAT is more than 30% of pixels are masked.
FLATINTERP: Remove call to this code.
SPCALIB: Back to original flat field rejection levels matches object extraction.
SKYSUBTRACT: Check for NEARBADPIXEL and LOWFLAT bit as well in pixelmask.

Add BADFLUXFACTOR mask bit when applying flux-calibration and flux-correction
vectors.

Fixed DJS_BATCH to work properly on remote but cross-mounted CPU's.

Plan files (spPlancomb*.par) written by SPPLAN1D now puts all the "planfile2d"
entries on the same line to be consistent with how YANNY_PAR() works now.

Fix the spike in memory usage at the end of SPCOMBINE.

Major changes to PLATELIST routine to return more info, and make a FITS
binary table.

-------------------------------------------------------------------------------
v4_5_0 (Jan 31, 2001)

Edits to raw frame headers now possible with SPHDRFIX procedure, which
reads the list of changes from opHdrFix.par file.  In particular, this
allows us to edit wrong headers in some of the earliest data.

The F-star flux-calibration vectors are generated with a PCA analysis
that now allows several rejection iterations.

More iterations added to the arc-line centroiding in FITARCIMAGE
(addresses PR #874).

Son-of-Spectro now tests for the Red Monster (light at 6400-6550 Ang in
science frames), and tests for argon lines in the flat-fields.  The Red
Monster is presumably from the handpaddle being left plugged in.

SPREDUCE1D: If an object is fit by a negative STAR or negative QSO, then
            re-classify it as UNKNOWN.

-------------------------------------------------------------------------------
v4_4_0 (Jan 23, 2001)

Remove any telluric-correction beyond 8250 Ang, since we don't believe
any of it there.  In fact, it looks like we were multiplying-in features
that are F-star absorption lines at 8540 and 8660 Ang.  But what about
the broad feature at 8665 Ang -- is that a telluric-band, or an intrinsic
F-star feature??

Keyword CARTID added to headers to track cartridge ID's.

Spectro robot scripts included in /bin directory (sprobot_start, etc.)

For Son-of-Spectro, the WARNING and ABORT messages are now saved in HDU #5
of the FITS log file, rather than as an element of the other HDU's.

For Son-of-Spectro, now only copies astrolog directory of existing
/data/spectro/$MJD data directory, since from now on the astrolog directory
will never be purged.

-------------------------------------------------------------------------------
v4_3_1 (Dec 10, 2000)

This version of "idlspec2d" has the following enhancements for
Son-of-Spectro (SOS):

(1) The hard-wired user/machine/version dependencies have been removed.
    SOS can now be run by any user on any machine, which we may want to
    do to avoid conflicts with the fiber-mapper.  Though for now, this
    will continue to be run from "observer@plate-mapper".
(2) Starting+stopping SOS is now done with the commands
       sos_start
       sos_status
       sos_stop
    which will start-up whichever version of the code has been either
    declared or set up.  Backing out of versions is now straight-forward.
(3) The code can now be managed remotely.  For example, from "sdsshost"
    you can type:
       setup idlspec2d
       sos_status observer@plate-mapper
    to check the status of SOS.
(4) SOS delays execution when the fiber-mapper is being run.
(5) More logging information is kept.
(6) Identified and removed Y2022 bugs which would have stopped SOS from
    working at MJD=60000.  It should now work until the year 2132.
(6) Documentation is now complete, and updated to reflect all above changes.
    The relevant documentation is also in the "sdssProcedures" product.

-------------------------------------------------------------------------------
v4_3_0 (Dec 6, 2000)

The changes are primarily to the Son-of-Spectro (SoS) code, specifically:

(1) The FITS log files have been re-structured to significantly speed
    up reading these files.  This was the bottleneck that slowed SoS
    down towards the end of a night, since each instance of reading these
    files locked out other processes.  Our hope is that now SoS will
    keep up during the night.
(2) Bias and dark exposures are now analyzed, and the 98th percentile
    of all values in these images are reported to SoS.  For example,
    if 98% of the pixels in a bias are below 8 ADU, then PERCENTILE98 = 8.
(3) The operational limits file has been edited so that SoS values
    that appear in red should definitely be considered very bad.
    For example, if the number of arc lines found (NLAMPS) is red, then
    that arc exposure should be considered bad and another should be
    taken until a good number are found.
      In practice, we expect it to be rare that anything falls out of spec.

-------------------------------------------------------------------------------
v4_2_0 (Nov 28, 2000?)

1)  Skip low S/N smear images in flux correction (previously aborted)

2)  Added bad columns to opBC.par

3)  Fixed bug in sdssproc when dealing with shifted rows between
    MJD 51578 AND 51580 inclusive.

4)  Changed structure of spMerge2d to have [flux,err] as image
    in HDU 0, and [andmask, ormask, dispersion] as binary table in HDU 1.

5)  Added headers cards to HDU's 1-5 in spPlate*fits to include wavelength
    information.

6)  Fixed bug to work on sdR*gz files.


-------------------------------------------------------------------------------
v4_1_0 (Oct 20, 2000?)

The following lists the highlights/lowlights
of the new 2d version:

Here is a catalog of the raw 2d output:

    spFrame-cc-xxxxxxxx.fits       Object Frame extraction

        HDU0 :  "Flattened" counts per pixel   Float 2048x320
        HDU1 :  Inverse variance of HDU0       Float 2048x320
        HDU2 :  Pixelmask (see below)          Long  2048x320
        HDU3 :  Wavelength coefficients        Structure
        HDU4 :  Dispersion coefficients        Structure
        HDU5 :  plPlugMapP for 320 fibers      Structure
        HDU6 :  Telluric correction image      Float 2048x320  (only for red)

    spSky-cc-xxxxxxxx.fits    2048x320  Subtracted sky image
    spFlat-cc-xxxxxxxx.fits   2048x320  flat field vectors
    spArc-cc-xxxxxxxx.fits    2048x320  Arc spectra extractions +
                                           HDU1: inverse variance
    spDiag2d-pppp-mmmmm.ps
    spDiag2d-pppp-mmmmm.log

Legend:

xxxxxxxx  Frame number
pppp      Plate number
mmmmm     MJD
cc        camera
s         spectrograph

Just before combining 2 or more exposures into fully merged spectra
we perform two flux calibration steps.   The outputs are:

    spFluxcalib-xxxxxxxx-s.fits   Bspline structure to convert 
                                  flattened counts to 10^-17 ergs/s/cm^2/A

    spFluxcorr-xxxxxxxx-s.fits    Polynomial coefficients to correct 
                                  science frames to smear frame

The final coaddition uses spFrame, spFluxcalib, and spFluxcorr to create

    spPlate-pppp-mmmmm.fits    Fully calibrated final 2d output

        HDU0 :  Fluxed log-linear spectra   Float npix x 640  where npix ~3900
                 units of 10^(-17) ergs/s/cm^2/A

        HDU1 :  Inverse variance of HDU0
        HDU2 :  Pixelmask (Intersection  aka AND mask)  LONG npix x 640
        HDU3 :  Pixelmask (Union  aka OR mask)          LONG npix x 640
        HDU4 :  Dispersion Image (sigma of arc lines)
                  in units of 1.0e-4 log10 lambda
        HDU5 :  plPlugMapP                              STRUCTURE

After the final coaddition, the data will be restructured into 
individual files, one for each fiber:

    spMerge2d-pppp-mmmmm-fff.fits   (fff is fiber number 1 through 640)
        
        HDU0 :  Flux and err      Float npix x 2
        HDU1 :  Pixelmask AND,OR  LONG  npix x 2
        HDU2 :  Dipsersion image  Float npix x 1


!!!!!Notice:  Multiple MJDs with the same plugging will be combined!!!!!
             into single outputs, but will be labeled with the 
                 highest MJD of the group.
  
             Bad data which should not be combined
             with subsequent data should be deleted before the subsequent
             data is run through 2d.

New features of v4_1_0:

  Major New Features:

    1) Spectrophotometry:
       
      a)  Flux calibrate with all available SPECTROPHOTO_STD and
          REDDEN_STD stars.  Use PCA to derive first and second
          eigenspectra.  Compare directly with SDSS Fundamentals to
          calibrate each smear exposure.  
      
      b)  Flux correct each science frame with throughput and color
          terms to match spectrophoto solution of smear image for
          each fiber.  Use SPECTROPHOTO_STD solution to low S/N fibers.

    2) Correct for Near Infrared Scattering (see msg from jeg) and
       possible optical scattering.  The scattered light background
       is estimated from a model profile of the full 2048x2048 image.

    3) New maskbits:
       
        Each individual frame extracted by 2d has the following maskbits
        possibly set for each pixel: (found in idlspec2d/etc/spMaskbits.par)

      # The following mask bits are for the fiber, set in FIBERMASK_BITS()
maskbits  0 NOPLUG          # Fiber not listed in plugmap file
maskbits  1 BADTRACE        # Bad trace from routine TRACE320CRUDE
maskbits  2 BADFLAT         # Low counts in fiberflat
maskbits  3 BADARC          # Bad arc solution
maskbits  4 MANYBADCOLUMNS  # >10% pixels are bad columns
maskbits  5 MANYREJECTED    # >10% pixels are rejected in extraction
maskbits  6 LARGESHIFT      # Large spatial shift between flat and object pos'n
maskbits  7 BADSKYFIBER     # Sky Fiber shows extreme residuals

# The following mask bits are for a pixel, set in PIXELMASK_BITS()
maskbits 16 NEARBADPIXEL    # Bad pixel within 3 pixels of trace
maskbits 17 LOWFLAT         # Flat field less than 0.5
maskbits 18 FULLREJECT      # Pixel fully rejected in extraction (INVVAR=0)
maskbits 19 PARTIALREJECT   # Some pixels rejected in extraction
maskbits 20 SCATTEREDLIGHT  # Scattered light significant
maskbits 21 CROSSTALK       # Cross-talk significant
maskbits 22 NOSKY           # Sky level unknown at this wavelength (INVVAR=0)
maskbits 23 BRIGHTSKY       # Sky level > flux + 10*(flux-error)
maskbits 24 NODATA          # No data available in combine B-spline (INVVAR=0)
maskbits 25 COMBINEREJ      # Rejected in combine B-spline

        Maskbits 0 through 7 apply to the full set of 2048 pixels on 
        blue or red spectra.

        The combined spectra found in spPlate*fits or spMerge2d*fits
        have two masks:  
          AND mask: the bit is set if all overlapping pixels is set.
          OR  mask:         "         any overlapping pixel bit is set.

Minor changes: 
     
    1) Lower limit to variance in raw image, 
       equivalent to S/N < 100 per pixel.

    2) New optimal extraction profile: 0.5 * exp(-x^2) + 0.5*exp(-|x|^3)
       (proftype 3)

    3) Restricted wavelength range in telluric correction
    
    4) Tighter rejection limits, more stringent cosmic rejection
       limits: +- 4 sigma

    5) Sign has been corrected in heliocentric velocity

    6) The header has the following changes:

         CALID*  has been deleted
         UNSIGNED has been deleted
         
         FRAMESN2    S/N^2 for each frame, does not apply to merged
                          spectra
         EXPID       can accomodate more than 10 exposures
         PIXFLAT:    2d pixel flat used
         OPBC:       bad pixel file applied
         OPECALIB:   opEcalib file applied
         OPCONFIG:   opConfig file applied

         SPEC1_G, SPEC1_R, SPEC1_I
         SPEC2_G, SPEC2_R, SPEC2_I :  Fiducial S/N across spectrographs
            
         MAG_G, MAG_R, MAG_I : Synthetic magnitude after
                               spectrophotometry

      
     7) Bspline package no longer requires slatec library

     8) Sky fibers with significant extra flux are rejected

     9) Number of bad fibers with given bits set are tabulated at end
   
    10) pipeline can run and use .fit.gz  gzipped raw data files,
        saving about 40% of space required by raw spectro data
     
    11) Spectral Resolution is output in the final merged spectra.

    12) Use a better algorithm to tweak flat field trace to match object
        trace.

    13) Fixes in to account for electronics problem in August

-------------------------------------------------------------------------------
v3c (May 12, 2000?)

It still requires idlutils v3b to run.
It is tagged on the branch, v3branch, and includes the following
improvements to the 2d pipeline:

- Auto-generation of S/N plot at conclusion of spectra merging.
- Increased number of supersky breakpoints to achieve better sky subtraction
- Added entries to opBC.par file, this will remove most of the remaining
  glitches.
- Added a new routine, "spmulti", which can combine multiple MJDs
  with the same plugmap file
- Heliocentric correction is now done on an exposure by exposure basis in 2d.
- Removed header cards which are no longer pertinent, and added some
  extras requested by Andy.
    Ones to note are NGOOD (number of good pixels in final spectrum)
    SN_G, SN_R, SN_I  (3 measures of S/N)
- Dispersion and spatial widths are output as a function of fiber
  fiber number & pixel (in spArcInfo and spFlatInfo respectively)

