• atEqToGC
  • atGCToEq
  • atEqToGal
  • atGalToEq
  • atEqToSurvey
  • atSurveyToEq
  • atGCToSurvey
  • atSurveyToGC
  • atSurveyToAzelpaOld
  • atSurveyToAzelpa
  • atBound
  • atBound2
  • atVEqToGC
  • atVGCToEq
  • atVEqToGal
  • atVGalToEq
  • atVEqToSurvey
  • atVSurveyToEq
  • atDefineGC
  • atGCDecFromRa
  • atAngleGCToRa
  • atEtaToStripeNum
  • atCoordToCobePix
  • atCobePixToCoord
  • atVCoordToCobePix
  • atVCobePixToCoord
  • atParallacticAngleGC
  • atSurveyGeometry

       Routines which convert to and from survey-specific coodinate systems
       

    There are five coordinate systems:

    The functions here convert Equatorial coordinates to and from Galactic, Great Circle, and Survey coordinates; also between Survey and Azelpa.

    Survey coordinates are (lambda, eta). Lines of constant lambda are parallels, and lines of constant eta are meridians which go through the survey pole. The center of a great circle scan will be a line of constant eta.

    Great circle coordinates (mu, nu) are defined so that the line down the center of a stripe (which is a meridian in survey coordinates) is the parallel nu=0. So, lines of constant mu are meridians and lines of constant nu are parallels. Great circle coordinates are specific to a survey stripe.

    To convert to and from Great Circle coordinates, you must input the node and inclination of the reference great circle. For "normal" drift scan great circles, use node=at_surveyCenterRa - 90degrees, and inc=survey latitude + at_surveyCenterDec.

    The survey latitudes for SDSS stripes are +/- n*at_stripeSeparation .

    The limits on these coordinates are:

    The survey center is defined with the external const double values

    This (ra,dec) transforms to:
    
    

    atEqToGC

    DESCRIPTION:
    
    Converts Equatorial coordinates to Great Circle coordinates.
    RETURN VALUES:
    
    void
    SIGNATURE:
      void atEqToGC (
      	       double ra,	/* IN -- ra in degrees*/
      	       double dec,	/* IN -- dec in degrees*/
      	       double *amu,	/* OUT -- mu in degrees*/
      	       double *anu,	/* OUT -- nu in degrees*/
      	       double anode,	/* IN -- node in degrees*/
      	       double ainc	/* IN -- inclination in degrees*/
      	       )
    

    atGCToEq

    DESCRIPTION:
    
    Converts Great Circle to Equatorial coordinates.
    RETURN VALUES:
    
    void
    SIGNATURE:
      
      void atGCToEq (
      	       double amu,	/* IN -- mu in degrees */
      	       double anu,	/* IN -- nu in degrees */
      	       double *ra,	/* OUT -- ra in degrees */
      	       double *dec,	/* OUT -- dec in degrees */
      	       double anode,	/* IN -- node in degrees */
      	       double ainc	/* IN -- inclination in degrees */
      	       )
    

    atEqToGal

    DESCRIPTION:
    
    Converts Equatorial to Galactic coordinates.
    RETURN VALUES:
    
    void
    SIGNATURE:
      void atEqToGal (
      		double ra,	/* IN -- ra in degrees */
      		double dec,	/* IN -- dec in degrees */
      		double *glong,	/* OUT -- Galactic longitude in degrees */
      		double *glat	/* OUT -- Galactic latitude in degrees */
      		)
    

    atGalToEq

    DESCRIPTION:
    
    Converts Galactic to Equatorial coordinates.
    RETURN VALUES:
    
    void
    SIGNATURE:
      
      void atGalToEq (
      		double glong,	/* IN -- Galactic longitude in degrees*/
      		double glat,	/* IN -- Galactic latitude in degrees*/
      		double *ra,	/* OUT -- ra in degrees*/
      		double *dec	/* OUT -- dec in degrees*/
      		)
    

    atEqToSurvey

    DESCRIPTION:
    
    Converts Equatorial to Survey coordinates.
    RETURN VALUES:
    
    void
    SIGNATURE:
      void atEqToSurvey (
      		   double ra,	   /* IN -- ra in degrees*/
      		   double dec,	   /* IN -- dec in degrees*/
      		   double *slong,  /* OUT -- survey longitude in degrees */
      		   double *slat   /* OUT -- survey latitude in degrees */
      		   )
    

    atSurveyToEq

    DESCRIPTION:
    
    Converts Survey to Equatorial coordinates.
    RETURN VALUES:
    
    void
    SIGNATURE:
      void atSurveyToEq (
      		   double slong,	/* IN -- survey longitude in degrees */
      		   double slat,		/* IN -- survey latitude in degrees */
      		   double *ra,		/* OUT -- ra in degrees */
      		   double *dec)		/* OUT -- dec in degrees */
    

    atGCToSurvey

    DESCRIPTION:
    
    Converts Great Circle to Survey Coordinates
    RETURN VALUES:
    
    void
    SIGNATURE:
      
      /*
       * This does nothing fancy, the code from atGCToEq and atEqToSurvey
       * has been glued together to convert GC to Survey coordinates
       */
      
      
      void atGCToSurvey (
                          double amu,      
                          double anu,     
                          double anode,  
                          double ainc,  
                          double *slong,  
                          double *slat   
                        )
      
    

    atSurveyToGC

    DESCRIPTION:
    
    Converts Survey to Great Circle coordinates
    RETURN VALUES:
    
    void
    SIGNATURE:
      
      /* This does nothing fancy, atSurveyToEq and atEqToGC have been glued together */
      
      void atSurveyToGC (
                          double slong,
                          double slat,
                          double anode,
                          double ainc,
                          double *amu,
                          double *anu
                        )
    

    atSurveyToAzelpaOld

    DESCRIPTION:
    
    Convert from survey to azelpa coordinates
    RETURN VALUES:
    
    void
    SIGNATURE:
      void atSurveyToAzelpaOld(double slong, /* IN: survey longitude (lambda) */
      		      double slat, /* IN: survey latitude (eat) */
      		      TSTAMP *tstamp, /* IN: time stamp of the observation */
      		      double *az,	/* OUT:  azimuth  */
      		      double *el,	/* OUT: elevation */
      		      double *pa	/* OUT: position angle */
      		      )
    

    asatSurveyGeometry

       Routines which convert to and from survey-specific coodinate systems
       

    There are five coordinate systems:

    The functions here convert Equatorial coordinates to and from Galactic, Great Circle, and Survey coordinates; also between Survey and Azelpa.

    Survey coordinates are (lambda, eta). Lines of constant lambda are parallels, and lines of constant eta are meridians which go through the survey pole. The center of a great circle scan will be a line of constant eta.

    Great circle coordinates (mu, nu) are defined so that the line down the center of a stripe (which is a meridian in survey coordinates) is the parallel nu=0. So, lines of constant mu are meridians and lines of constant nu are parallels. Great circle coordinates are specific to a survey stripe.

    To convert to and from Great Circle coordinates, you must input the node and inclination of the reference great circle. For "normal" drift scan great circles, use node=at_surveyCenterRa - 90degrees, and inc=survey latitude + at_surveyCenterDec.

    The survey latitudes for SDSS stripes are +/- n*at_stripeSeparation .

    The limits on these coordinates are:

    The survey center is defined with the external const double values

    This (ra,dec) transforms to:
    
    

    atSurveyToAzelpa

    DESCRIPTION:
    
    Convert from survey to azelpa coordinates
    RETURN VALUES:
    
    void
    SIGNATURE:
      void atSurveyToAzelpa(double slong, /* IN: survey longitude (lambda) */
      		      double slat, /* IN: survey latitude (eat) */
      		      TSTAMP *tstamp, /* IN: time stamp of the observation */
      		      double *az,	/* OUT:  azimuth  */
      		      double *el,	/* OUT: elevation */
      		      double *pa	/* OUT: position angle */
      		      )
    

    atBound

    DESCRIPTION:
    
    Set the angle within the specified bounds
    RETURN VALUES:
    
    void
    SIGNATURE:
      void atBound (
      	      double *angle,	/* MODIFIED -- the angle to bound in degrees*/
      	      double min,	/* IN -- inclusive minimum value */
      	      double max	/* IN -- exclusive maximum value */
      	      )
    

    atBound2

    DESCRIPTION:
    
    Set the two angles within legal bounds
    RETURN VALUES:
    
    void
    SIGNATURE:
      void atBound2(
      	      double *theta,	/* MODIFIED -- the -90 to 90 angle */
      	      double *phi	/* MODIFIED -- the 0 to 360 angle */
      	      )
    

    atVEqToGC

    DESCRIPTION:
    
    Converts Equatorial coordinates to Great Circle coordinates.
    RETURN VALUES:
    
    void
    SIGNATURE:
      void atVEqToGC (
      	       VECTOR *vRaMu,	/* IN -- ra in degrees OUT -- mu in degrees*/
      	       VECTOR *vDecNu,	/* IN -- dec in degrees OUT -- nu in degrees*/
      	       VECTOR_TYPE anode,	/* IN -- node in degrees*/
      	       VECTOR_TYPE ainc	/* IN -- inclination in degrees*/
      	       )
    

    atVGCToEq

    DESCRIPTION:
    
    Converts Great Circle to Equatorial coordinates.
    RETURN VALUES:
    
    void
    SIGNATURE:
      void atVGCToEq (
      	       VECTOR *vMuRa,	/* IN -- mu in degrees OUT -- ra in degrees*/
      	       VECTOR *vNuDec,	/* IN -- nu in degrees OUT -- dec in degrees*/
      	       VECTOR_TYPE anode,	/* IN -- node in degrees*/
      	       VECTOR_TYPE ainc	/* IN -- inclination in degrees*/
      	       )
    

    atVEqToGal

    DESCRIPTION:
    
    Converts Equatorial to Galactic coordinates.
    RETURN VALUES:
    
    void
    SIGNATURE:
      void atVEqToGal (
      		VECTOR *vRaGLong,/* IN -- ra in degrees OUT -- Galactic longitude in degrees */
      		VECTOR *vDecGLat  /* IN -- dec in degrees OUT -- Galactic latitude in degrees */
      		)
    

    atVGalToEq

    DESCRIPTION:
    
    Converts Galactic to Equatorial coordinates.
    RETURN VALUES:
    
    void
    SIGNATURE:
      
      void atVGalToEq (
      		VECTOR *vGLongRa,/* IN -- Galactic longitude in degrees OUT -- ra in degrees */
      		VECTOR *vGLatDec  /* IN -- Galactic latitude in degrees OUT -- dec in degrees */
      		)
    

    atVEqToSurvey

    DESCRIPTION:
    
    Converts Equatorial to Survey coordinates.
    RETURN VALUES:
    
    void
    SIGNATURE:
      void atVEqToSurvey (
      		    VECTOR *vRaSLong,/* IN -- ra in degrees OUT -- Survey longitude in degrees */
      		    VECTOR *vDecSLat  /* IN -- dec in degrees OUT -- Survey latitude in degrees */
      		    )
    

    atVSurveyToEq

    DESCRIPTION:
    
    Converts Survey to Equatorial coordinates.
    RETURN VALUES:
    
    void
    SIGNATURE:
      void atVSurveyToEq (
      		    VECTOR *vSLongRa,/* OUT -- ra in degrees IN -- Survey longitude in degrees */
      		    VECTOR *vSLatDec  /* OUT -- dec in degrees IN -- Survey latitude in degrees */
      		    )
    

    atDefineGC

    DESCRIPTION:
    
    Given two points on a great circle (in decimal degrees), compute the node and inclination.
    RETURN VALUES:
    
    void
    SIGNATURE:
      void atDefineGC(double ra1,		/* IN: */
      		double dec1,		/* IN: */
      		double ra2,		/* IN: */
      		double dec2,		/* IN: */
      		double *anode,		/* OUT: */
      		double *ainc		/* OUT: */
      		)
    

    atGCDecFromRa

    DESCRIPTION:
    
    Given an RA, find a corresponding dec on the great circle. If the pole of the great circle lies on the equator, this is an undefined operation.
    RETURN VALUES:
    
    void
    SIGNATURE:
      void atGCDecFromRa(double ra,	/* IN: */
      		double anode,	/* IN: */
      		double ainc,	/* IN: */
      		double *dec	/* OUT: */
      		)
    

    atAngleGCToRa

    DESCRIPTION:
    
    Given a point on the great circle, determine the angle between the great circle and increasing RA.
    RETURN VALUES:
    
    void
    SIGNATURE:
      void atAngleGCToRa(double ra,			/* IN: */
      		double dec,			/* IN: */
      		double anode,			/* IN: */
      		double ainc,			/* IN: */
      		 double *angle			/* OUT: */
      		)
    

    atEtaToStripeNum

    DESCRIPTION:
    
    Determine stripe number, given eta
    RETURN VALUES:
    
    void
    SIGNATURE:
      void atEtaToStripeNum(
      		      double eta,	       	/* IN: */
      		      int *num			/* OUT: */
      		      )
    

    atCoordToCobePix

      DESCRIPTION:  transform sky coordinates to COBE pixel number
    
    SIGNATURE:
      void atCoordToCobePix(
      		      float longitude,
      		      float latitude,
      		      char *coord, /* q for equatorial; 
      				      g for galactic; e for ecliptic */
      		      int resolution, /* 9 for DIRBE data */
      		      int *pixel /* the pixel number */
      		      )
    

    atCobePixToCoord

      DESCRIPTION:  transform COBE pixel numbers to sky coordinates
    
    SIGNATURE:
      void atCobePixToCoord(
      		      int pixel, /* the input pixel number */
      		      char *coord, /* q for equatorial; 
      				      g for galactic; e for ecliptic */
      		      int resolution, /* 9 for DIRBE data */
      		      float *longitude,
      		      float *latitude
      		      )
    

    atVCoordToCobePix

      DESCRIPTION:  transform sky coordinates to COBE pixel number for VECTORS
    
    SIGNATURE:
      void atVCoordToCobePix(
      		      VECTOR *longitude,
      		      VECTOR * latitude,
      		      char *coord, /* q for equatorial; 
      				      g for galactic; e for ecliptic */
      		      int resolution, /* 9 for DIRBE data */
      		      VECTOR *pixel /* the pixel number */
      		      )
    

    atVCobePixToCoord

      DESCRIPTION:  transform COBE pixel number to sky coordinates for VECTORS
    
    SIGNATURE:
      void atVCobePixToCoord(
      		       VECTOR *pixel, /* the pixel number */
      		       char *coord, /* q for equatorial; 
      				       g for galactic; e for ecliptic */
      		       int resolution, /* 9 for DIRBE data */
      		       VECTOR *longitude,
      		       VECTOR * latitude
      		       )
    

    atParallacticAngle

       

    Based on an experimental version of atSurveyToAzelpa, this gets the parallactic angle wrt scanning direction correctly- 5 March 1998

    This version converts (LMST,lat) to (LAST,lat), which are zenith coordinates referred to true equator and equinox of date, then applies precession/nutation to convert to zenith coordinates referred to mean eqtr & eqnx of J2000. From that, can convert to GC coordinates, and determine difference between zenith direction and direction of scanning. This could all be done as well in survey coordinates, but still need to know the node and inclination of GC path. The survey coordinates of a star do not tell you what great circle is being scanned, which is what is needed to get mu & nu components of refraction.

    Survey coordinates are (lambda, eta). Lines of constant lambda are parallels, and lines of constant eta are meridians which go through the survey poles. The center of a great circle scan will be a line of constant eta.

    Great circle coordinates (mu, nu) are defined so that the line down the center of a stripe (which is a meridian in survey coordinates) is the parallel nu=0. So, lines of constant mu are meridians and lines of constant nu are parallels. Great circle coordinates are specific to a survey stripe.

    To convert to and from Great Circle coordinates, you must input the node and inclination of the reference great circle. For "normal" drift scan great circles, use node=at_surveyCenterRa - 90degrees, and inc=survey latitude + at_surveyCenterDec.

    The survey latitudes for SDSS stripes are +/- n*at_stripeSeparation .

    The limits on these coordinates are:

    The survey center is defined with the external const double values

    This (ra,dec) transforms to:
    
    

    atParallacticAngleGC

    DESCRIPTION:
    
    Calculate the parallactic angle in GC, ie direction to zenith wrt (mu,nu) axes
    RETURN VALUES:
    
    void
    SIGNATURE:
      void atParallacticAngleGC(
      	double smu,     /* IN: star mu */
              double snu,     /* IN: star nu */
      	TSTAMP *tstamp, /* IN: TAI time stamp of the observation */
      	double anode,   /* IN: mu value of GC node */
      	double ainc,    /* IN: inclination of GC */
      	double *pa	/* OUT: pier-allactic angle */
      		      )