regcntsSubs.c
/* knowing region count, allocate result data in the res structs */
knowing region count, allocate result data in the res structs
knowing region count allocate result data in the res structs
void regcntsInitResults(Opts opts, Data src, Data bkg, Res res){
  if( bkg->name ){ 
    if( (src->dpp > 0.0) && (bkg->dpp > 0.0) ){
      res->dppnorm = (src->dpp/bkg->dpp) * (src->dpp/bkg->dpp);
    }
  } else {
    if( src->wcs && iswcs(src->wcs) ){
      if( !src->wcs->coorflip ){
	src->dpp = ABS(src->wcs->cdelt[0]) * src->block;
      } else {
	src->dpp = ABS(src->wcs->cdelt[1]) * src->block;
      }
    }
  }
  if( opts->doradang && src->reg ){
    res->radang = xstrdup(src->reg->radang);
  }
  res->bncnts = (double *)xcalloc(src->nreg, sizeof(double));
  res->bnerr = (double *)xcalloc(src->nreg, sizeof(double));
  res->bscnts = (double *)xcalloc(src->nreg, sizeof(double));
  res->bserr = (double *)xcalloc(src->nreg, sizeof(double));
}
void regcntsInitResults ( Opts opts , Data src , Data bkg , Res res ) { if ( bkg -> name ) { if ( ( src -> dpp > 0.0 ) && ( bkg -> dpp > 0.0 ) ) { res -> dppnorm = ( src -> dpp / bkg -> dpp ) * ( src -> dpp / bkg -> dpp ) ; } } else { if ( src -> wcs && iswcs ( src -> wcs ) ) { if ( ! src -> wcs -> coorflip ) { src -> dpp = ABS ( src -> wcs -> cdelt [ 0 ] ) * src -> block ; } else { src -> dpp = ABS ( src -> wcs -> cdelt [ 1 ] ) * src -> block ; } } } if ( opts -> doradang && src -> reg ) { res -> radang = xstrdup ( src -> reg -> radang ) ; } res -> bncnts = ( double * ) xcalloc ( src -> nreg , sizeof ( double ) ) ; res -> bnerr = ( double * ) xcalloc ( src -> nreg , sizeof ( double ) ) ; res -> bscnts = ( double * ) xcalloc ( src -> nreg , sizeof ( double ) ) ; res -> bserr = ( double * ) xcalloc ( src -> nreg , sizeof ( double ) ) ; }
knowing region count, allocate result data in the res structs
knowing region count allocate result data in the res structs
/* look for degrees/pixel in source and background files -- we will
     use these to normalize background area, if both are present */ /* note that BOTH must be present or we do not do this normalization */ /* get degrees/pixel for source; not used in norm, but users want to know */ /* get radii and angle string, if needed */ /* allocate space for results */