NAME:
	inst2std
 PURPOSE: (one line)
	Apply photometric transformation from instrumental to standard mags.
 DESCRIPTION:
  The formula for applying transformation to a photometric measurement
  follows the basic formalism (including signs) from Hardie.  A time
  dependent term has been added.  The formula looks like this:

    m0 = m - kX - n(t-t0)X - k"CX + eC + Z

     where
        m  = instrumental magnitude
        k  = extinction coefficient, mag/airmass
        X  = airmass
        n  = coefficient of the 1st order expansion of extinction as a
               function of time
        t  = Time of observation (in hours)
        t0 = Reference time for n, time dependent correction is zero at
               this time, usually is the middle of the observation set.
        k" = second order extinction coefficient
        C  = Standard system color of the object
        e  = color term
        Z  = zero point
        m0 = Standard magnitude

 CATEGORY:
	Photometry
 CALLING SEQUENCE:
	inst2std,jd,am,inst,instsig,color,colorsig, $
     tran,transig,jdref,std,stdsig
 INPUTS:
  jd       - Julian date of observation for each entry.
  am       - Floating point array of the airmass of observations.
	inst     - Instrumental magnitude
	instsig  - Uncertainty of the instrumental magnitude
	color    - Standard system color for object.
	colorsig - Uncertainty on the standard color
	tran     - Transformation coefficients (vector)
                tran(0) = principal extinction coefficient
                tran(1) = second order extinction coefficient
                tran(2) = color term
                tran(3) = zero-point
                tran(4) = time-dependent extinction term
  transig  - Uncertainty on the transformation coefficients (vector).
                (no uncertainty on reference time)
  jdref    - Time reference point for extinction
 OPTIONAL INPUT PARAMETERS:
 KEYWORD INPUT PARAMETERS:
 KEYWORD OUTPUT PARAMETERS:
 OUTPUTS:
	std      - Standard magnitude.
	stdsig   - Uncertainty of the standard magnitude.
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 PROCEDURE:
 MODIFICATION HISTORY:
	Written: 1992 Mar 31, Marc W. Buie, Lowell Observatory.
  97/2/10, MWB, total rewrite