• atCosmicMagSet
  • atCosmicMagScatterSet
  • atTransNew
  • atTransDel
  • atTransApply
  • atTransInverseApply
  • atTransInverseApplyNowrap
  • atTrans

      TRANS structures are SDSS-specific coordinate transformations from frame
      coordinates (row,col) to great circle coordinates (mu, nu).
      The transformation is of the form:
    
      r'-i' < riCut:
    
          rowm = row + dRow0 + dRow1*col + dRow2*(col^2) + dRow3*(col^3) + csRow*c
          colm = col + dCol0 + dCol1*col + dCol2*(col^2) + dCol3*(col^3) + csCol*c
    
      r'-i' >= riCut
    
          rowm = row + dRow0 + dRow1*col + dRow2*(col^2) + dRow3*(col^3) + ccRow
          colm = col + dCol0 + dCol1*col + dCol2*(col^2) + dCol3*(col^3) + ccCol
    
      mu = a + b * rowm + c * colm
      nu = d + e * rowm + f * colm
    
    row, col) are the measured frame coordinates (measured in pixels). dRow0, dRow1, dRow2, dRow3, dCol0, dCol1, dCol2, and dCol3 are the coefficients to correct for high-order optical distortions in the camera (because TRANS structures are set up for drift scan data, high-order optical distortions are a function of column only). c is the color of the star (which color depends on which filter this TRANS applies to), so csRow and csCol correct for differential chromatic refraction (DCR, where the other terms in the TRANS are set up such that DCR = 0 for c = 0). If the r'-i' color is greater than or equal to a given value (riCut), then a constant value is used for DCR (ccRow in row, ccCol in col; for some filters this is not the case, which is handled by setting riCut to a very large value which will never be exceeded in practice). (rowm, colm) are thus the frame coordinates corrected for optical distortions and DCR (in pixels). A simple affine transformation then converts (rowm, colm) to great circle coordinates mu,nu, in degrees) on the sky.

    The errors, muErr and nuErr, are the errors in the transformation (that is, the rms systematic errors) in great circle longitude and latitude, respectively (in arcsec). For the r' chips, this is the error in the absolute astrometry (r' coordinates to sky). For the u', g', i', and z' chips, this is the error in the relative astrometry (u', g', i', or z' to r'). For example, to transform g' pixel coordinates to r' pixel coordinates, one applies the g' TRANS structure to the g' coordinates, and then the inverse r' TRANS structure to the intermediate sky coordinates. The total error in this transformation is just the errors listed in the g' TRANS structure. Those errors are in arcsec; to convert to errors in the transformed r' coordinates just divide by the pixel scale for the r' CCD.

    
    

    atCosmicMagSet

     Set the TRANS routine's ideas of cosmic magnitudes, returning the old
     values; if mag is NULL the current values will be unchanged
    
    SIGNATURE:
      const float *
      atCosmicMagSet(const float *mag)
    

    atCosmicMagScatterSet

     Set the TRANS routine's ideas of the scatter in cosmic magnitudes,
     returning the old values; if mag is NULL the current values will be unchanged
    
    SIGNATURE:
      const float *
      atCosmicMagScatterSet(const float *magScatter)
    

    atTransNew

    DESCRIPTION:
    
    Make a new TRANS struct. The structure in initialized to give a unity transformation in the affine terms, with all higher-order distortion and color terms set to 0.
    RETURN VALUES:
    
    Returns a new TRANS struct.
    SIGNATURE:
        TRANS *atTransNew(void)
      
    

    atTransDel

    DESCRIPTION:
    
    Delete a TRANS struct
    RETURN VALUES:
    
    Returns SH_SUCCESS
    SIGNATURE:
        RET_CODE atTransDel(TRANS *t_ptr)
      
    

    atTransApply

     Apply a TRANS structure to convert CCD coordinates (row,col) in
     pixels to great circle coordinates (mu,nu) in degrees.
    
     The colour of the object is specified by the AT_NBAND element
     array mag (with associated error array magErr), and the filter
     which must be one of u, g, r, i , or z. If the errors are too
     large the colour will be taken from the cosmic values, which
     may be set (or retrieved) using atCosmicMagSet and atCosmicMagScatterSet
    
     If mag is NULL, the cosmic values are used.
    
     Each TRANS structure has an element "riCut"; stars with r'-i'
     colors redder than or equal to the value of "riCut" have their
     differential chromatic refraction (DCR) set to a constant (i.e.,
     independent of the color of the star), while stars whose r'-i'
     color is bluer than "riCut" have their DCR calculated based on the
     value of "color" (where the color used for "color" depends on the
     TRANS structure, and can be r'-i').  If "riCut" in the TRANS
     structure is greater than or equal to 10, then the r'-i' color is
     ignored, and DCR is based solely on "color".  If the error on r'-i'
     exceeds 0.5 mag (and "riCut" is less than 10), or if the error on
     "color" exceeds 0.5 mag and r'-i' is less than "riCut" (or "riCut"
     is greater than or equal to 10), then the cosmic color is used to
     calculate DCR.  The cosmic color is always in the color system of
     "color" (i.e., the cosmic color is always assumed to be for a star
     whose r'-i' is less than "riCut").
    
     muErr and/or nuErr may be NULL, in which case no error is returned
     for that quantity
    
    RETURN VALUES:
    	0	calibrated using measured colors
    	1	calibrated using the cosmic color
    
    SIGNATURE:
      int
      atTransApply(const TRANS *trans,	/* TRANS structure for the frame */
      	     char filter,		/* filter in which row, and col are
      					   measured */
      	     double row,		/* frame row position (pixels) */
      	     double rowErr,		/* error in row position (pixels) */
      	     double col,		/* frame column position (pixels) */
      	     double colErr,		/* error in column position (pixels) */
      	     const float *mag,		/* magnitudes for this object, or NULL
      					   (only the colours are used)*/
      	     const float *magErr,	/* error in mag, or NULL */
      	     double *mu,		/* OUT: great circle longitude
      					   (degrees) */
      	     double *muErr,		/* OUT: error in mu, or NULL */
      	     double *nu,		/* OUT: great circle latitude
      					   (degrees) */
      	     double *nuErr)		/* OUT: error in nu, or NULL */
    

    atTransInverseApply

    DESCRIPTION:
    
    Apply the inverse of a TRANS structure to convert great circle coordinates (mu,nu) in degrees to CCD coordinates (row,col) in pixels. Each TRANS structure has an element "riCut"; stars with r'-i' colors redder than or equal to the value of "riCut" have their differential chromatic refraction (DCR) set to a constant (i.e., independent of the color of the star), while stars whose r'-i' color is bluer than "riCut" have their DCR calculated based on the value of "color" (where the color used for color" depends on the TRANS structure, and can be r'-i'). If "riCut" in the TRANS structure is greater than or equal to 10, then the r'-i' color is ignored, and DCR is based solely on "color". If the error on r'-i' exceeds 0.5 mag (and "riCut" is less than 10), or if the error on "color" exceeds 0.5 mag and r'-i' is less than "riCut" (or "riCut" is greater than or equal to 10), then the cosmic color is used to calculate DCR. The cosmic color is always in the color system of color" (i.e., the cosmic color is always assumed to be for a star whose r'-i' is less than "riCut").
    RETURN VALUES:
    
    1       error inverting the TRANS
    	0	calibrated using measured colors
    	1	calibrated using the cosmic color
      
    SIGNATURE:
      int
      atTransInverseApply(const TRANS *trans,	/* TRANS structure for the frame */
      		    char filter,	/* filter in which row, and col are
      					   measured */
      		    double mu,		/* great circle longitude (degrees) */
      		    double muErr,	/* error in mu */
      		    double nu,		/* great circle latitude (degrees) */
      		    double nuErr,	/* error in nu */
      		    const float *mag,	/* magnitudes for this object, or NULL
      					   (only the colours are used)*/
      		    const float *magErr, /* error in mag, or NULL */
      		    double *row,	/* OUT: frame row position (pixels) */
      		    double *rowErr,	/* OUT: error in row, or NULL */
      		    double *col,	/* OUT: frame column position (pixels)*/
      		    double *colErr)	/* OUT: error in col, or NULL */
    

    atTransInverseApplyNowrap

    DESCRIPTION:
    
    Apply the inverse of a TRANS structure to convert great circle coordinates (mu,nu) in degrees to CCD coordinates (row,col) in pixels. Do not apply +/-180 wrapping on mu. Each TRANS structure has an element "riCut"; stars with r'-i' colors redder than or equal to the value of "riCut" have their differential chromatic refraction (DCR) set to a constant (i.e., independent of the color of the star), while stars whose r'-i' color is bluer than "riCut" have their DCR calculated based on the value of "color" (where the color used for color" depends on the TRANS structure, and can be r'-i'). If "riCut" in the TRANS structure is greater than or equal to 10, then the r'-i' color is ignored, and DCR is based solely on "color". If the error on r'-i' exceeds 0.5 mag (and "riCut" is less than 10), or if the error on "color" exceeds 0.5 mag and r'-i' is less than "riCut" (or "riCut" is greater than or equal to 10), then the cosmic color is used to calculate DCR. The cosmic color is always in the color system of color" (i.e., the cosmic color is always assumed to be for a star whose r'-i' is less than "riCut").
    RETURN VALUES:
    
    1       error inverting the TRANS
    	0	calibrated using measured colors
    	1	calibrated using the cosmic color
      
    SIGNATURE:
      int
      atTransInverseApplyNowrap(const TRANS *trans,	/* TRANS structure for the frame */
      		    char filter,	/* filter in which row, and col are
      					   measured */
      		    double mu,		/* great circle longitude (degrees) */
      		    double muErr,	/* error in mu */
      		    double nu,		/* great circle latitude (degrees) */
      		    double nuErr,	/* error in nu */
      		    const float *mag,	/* magnitudes for this object, or NULL
      					   (only the colours are used)*/
      		    const float *magErr, /* error in mag, or NULL */
      		    double *row,	/* OUT: frame row position (pixels) */
      		    double *rowErr,	/* OUT: error in row, or NULL */
      		    double *col,	/* OUT: frame column position (pixels)*/
      		    double *colErr)	/* OUT: error in col, or NULL */