lex.reg.c
/*
 *
 * _regInitWCS -- initialize WCS from supplied FITS cards
 *
 */
- initialize WCS from supplied FITS cards
- initialize WCS from supplied FITS cards
static void _regInitWCS() {
  wcssys = xstrdup(DEFAULT_WCS);
  lcx_init(xreg->cards, lcxm);
  if( !xreg || !xreg->cards || !*xreg->cards ){
    return;
  }
  wcsfree(wcs);
  hlength(xreg->cards, 256000);
  wcs = wcsinit(xreg->cards);
  if( wcs && iswcs(wcs) ){
    if( !wcs->coorflip ){
      cdelt1 = wcs->cdelt[0];
      cdelt2 = wcs->cdelt[1];
    } else {
      cdelt1 = wcs->cdelt[1];
      cdelt2 = wcs->cdelt[0];
    }
    if( wcs->imflip ) {
	crot = -wcs->rot;
    } else {
	crot =  wcs->rot;
    }
  } else {
    cdelt1 = 0.0;
    cdelt2 = 0.0;
    crot   = 0.0;
  }
}
static void _regInitWCS ( ) { wcssys = xstrdup ( DEFAULT_WCS ) ; lcx_init ( xreg -> cards , lcxm ) ; if ( ! xreg || ! xreg -> cards || ! * xreg -> cards ) { return ; } wcsfree ( wcs ) ; hlength ( xreg -> cards , 256000 ) ; wcs = wcsinit ( xreg -> cards ) ; if ( wcs && iswcs ( wcs ) ) { if ( ! wcs -> coorflip ) { cdelt1 = wcs -> cdelt [ 0 ] ; cdelt2 = wcs -> cdelt [ 1 ] ; } else { cdelt1 = wcs -> cdelt [ 1 ] ; cdelt2 = wcs -> cdelt [ 0 ] ; } if ( wcs -> imflip ) { crot = - wcs -> rot ; } else { crot = wcs -> rot ; } } else { cdelt1 = 0.0 ; cdelt2 = 0.0 ; crot = 0.0 ; } }
_regInitWCS -- initialize WCS from supplied FITS cards
_regInitWCS -- initialize WCS from supplied FITS cards
/* default coord sys */ /* make up logical matrix (doesn't need any cards) */ /* make sure we have something to process (from global regions struct) */ /* free up old wcs */ /* init new wcs, if possible */ /* set some extra wcs parameters */