Starlink-AST

 view release on metacpan or  search on metacpan

ast/src/dssmap.c  view on Meta::CPAN

*     if this function should fail for any reason.

*/

/* Local Variables: */
   char name_buff[ 10 ];          /* Buffer for keyword name */
   char *name;                    /* Pointer to jeyword name string */
   char *ckeyval;                 /* Pointer to string keyword value */
   struct WorldCoor *ret;         /* Pointer to the returned structure */
   double rah,ram,ras;            /* Centre RA hours, minutes and seconds */
   double dsign;                  /* Sign of centre dec */
   double decd,decm,decs;         /* Centre Dec degrees, minutes, seconds */
   double dec_deg;                /* Centre Dec in degrees */
   double ra_hours;               /* Centre RA in hours */
   int i;                         /* Coefficient index */

/* Check the local error status. */
   if ( !astOK ) return NULL;

/* Get memory to hold the returned structure. */
   ret = (struct WorldCoor *) astMalloc( sizeof( struct WorldCoor ) );

ast/src/dssmap.c  view on Meta::CPAN

                  "FITS keyword '%s'.", status, method, class, name );
      }

      ra_hours = rah + (ram / (double)60.0) + (ras / (double)3600.0);
      ret->plate_ra = AST__DD2R*15.0*ra_hours;


/* Plate center Dec */
      name = "PLTDECSN";
      if( !astGetFitsS( fits, name, &ckeyval ) && astOK ){
         dsign = 1.0;

      } else {
         if( *ckeyval == '-' ){
            dsign = -1.0;
         } else {
            dsign = 1.0;
         }

      }

      decd = 0.0;
      decm = 0.0;
      decs = 0.0;

      name = "PLTDECD";
      if( !astGetFitsF( fits, name, &decd ) && astOK ){

ast/src/dssmap.c  view on Meta::CPAN

         astError( AST__BDFTS, "%s(%s): No value has been supplied for the "
                  "FITS keyword '%s'.", status, method, class, name );
      }

      name = "PLTDECS";
      if( !astGetFitsF( fits, name, &decs ) && astOK ){
         astError( AST__BDFTS, "%s(%s): No value has been supplied for the "
                  "FITS keyword '%s'.", status, method, class, name );
      }

      dec_deg = dsign * (decd+(decm/(double)60.0)+(decs/(double)3600.0));
      ret->plate_dec = AST__DD2R*dec_deg;

/* Plate Scale arcsec per mm  */
      name = "PLTSCALE";
      if( !astGetFitsF( fits, name, &ret->plate_scale ) && astOK ){
         astError( AST__BDFTS, "%s(%s): No value has been supplied for the "
                  "FITS keyword '%s'.", status, method, class, name );
      }

/* X and Y corners (in pixels) */



( run in 0.404 second using v1.01-cache-2.11-cpan-71847e10f99 )