simplification

This commit is contained in:
Martin Reinecke 2012-12-27 14:56:17 +01:00
parent a8a1fafebb
commit af988856e9
2 changed files with 9 additions and 16 deletions

View file

@ -35,15 +35,6 @@
#include "c_utils.h" #include "c_utils.h"
#include "ls_fft.h" #include "ls_fft.h"
void sharp_make_healpix_geom_info (int nside, int stride,
sharp_geom_info **geom_info)
{
double *weight=RALLOC(double,2*nside);
SET_ARRAY(weight,0,2*nside,1);
sharp_make_weighted_healpix_geom_info (nside, stride, weight, geom_info);
DEALLOC(weight);
}
void sharp_make_weighted_healpix_geom_info (int nside, int stride, void sharp_make_weighted_healpix_geom_info (int nside, int stride,
const double *weight, sharp_geom_info **geom_info) const double *weight, sharp_geom_info **geom_info)
{ {
@ -87,7 +78,7 @@ void sharp_make_weighted_healpix_geom_info (int nside, int stride,
theta[m] = pi-theta[m]; theta[m] = pi-theta[m];
ofs[m] = (npix - nph[m])*stride - ofs[m]; ofs[m] = (npix - nph[m])*stride - ofs[m];
} }
weight_[m]=4.*pi/npix*weight[northring-1]; weight_[m]=4.*pi/npix*((weight==NULL) ? 1. : weight[northring-1]);
} }
sharp_make_geom_info (nrings, nph, ofs, stride_, phi0, theta, weight_, sharp_make_geom_info (nrings, nph, ofs, stride_, phi0, theta, weight_,

View file

@ -38,19 +38,21 @@
extern "C" { extern "C" {
#endif #endif
/*! Creates a geometry information describing a HEALPix map with an
Nside parameter \a nside.
\ingroup geominfogroup */
void sharp_make_healpix_geom_info (int nside, int stride,
sharp_geom_info **geom_info);
/*! Creates a geometry information describing a HEALPix map with an /*! Creates a geometry information describing a HEALPix map with an
Nside parameter \a nside. \a weight contains the relative ring Nside parameter \a nside. \a weight contains the relative ring
weights and must have \a 2*nside entries. weights and must have \a 2*nside entries.
\note if \a weight is a null pointer, all weights are assumed to be 1.
\ingroup geominfogroup */ \ingroup geominfogroup */
void sharp_make_weighted_healpix_geom_info (int nside, int stride, void sharp_make_weighted_healpix_geom_info (int nside, int stride,
const double *weight, sharp_geom_info **geom_info); const double *weight, sharp_geom_info **geom_info);
/*! Creates a geometry information describing a HEALPix map with an
Nside parameter \a nside.
\ingroup geominfogroup */
static inline void sharp_make_healpix_geom_info (int nside, int stride,
sharp_geom_info **geom_info)
{ sharp_make_weighted_healpix_geom_info (nside, stride, NULL, geom_info); }
/*! Creates a geometry information describing a Gaussian map with \a nrings /*! Creates a geometry information describing a Gaussian map with \a nrings
iso-latitude rings and \a nphi pixels per ring. The azimuth of the first iso-latitude rings and \a nphi pixels per ring. The azimuth of the first
pixel in each ring is \a phi0 (in radians). The index difference between pixel in each ring is \a phi0 (in radians). The index difference between