From 0d8c5eae3fd34840b4fd6f6134edda7ec4b30cea Mon Sep 17 00:00:00 2001 From: Martin Reinecke Date: Fri, 6 Jul 2012 11:30:53 +0200 Subject: [PATCH] simplify normalisation for derivatives --- libsharp/sharp.c | 7 ++++--- libsharp/sharp_ylmgen_c.c | 10 ++++++++++ libsharp/sharp_ylmgen_c.h | 6 ++++++ 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/libsharp/sharp.c b/libsharp/sharp.c index 60c416e..d24753b 100644 --- a/libsharp/sharp.c +++ b/libsharp/sharp.c @@ -405,8 +405,7 @@ static void alm2almtmp (sharp_job *job, int lmax, int mi) for (int l=job->ainfo->mval[mi]; l<=lmax; ++l) { ptrdiff_t aidx = sharp_alm_index(job->ainfo,l,mi); - double fct = (job->type==ALM2MAP) ? job->norm_l[l] : - fabs(job->norm_l[l])*sqrt(l*(l+1.)); + double fct = job->norm_l[l]; for (int i=0; intrans*job->nalm; ++i) if (job->fde==DOUBLE) job->almtmp[job->ntrans*job->nalm*l+i] @@ -464,7 +463,9 @@ void sharp_execute_job (sharp_job *job) int lmax = job->ainfo->lmax, mmax=sharp_get_mmax(job->ainfo->mval, job->ainfo->nm); - job->norm_l = sharp_Ylmgen_get_norm (lmax, job->spin); + job->norm_l = (job->type==ALM2MAP_DERIV1) ? + sharp_Ylmgen_get_d1norm (lmax) : + sharp_Ylmgen_get_norm (lmax, job->spin); /* clear output arrays if requested */ init_output (job); diff --git a/libsharp/sharp_ylmgen_c.c b/libsharp/sharp_ylmgen_c.c index 7a7ec8a..46ea180 100644 --- a/libsharp/sharp_ylmgen_c.c +++ b/libsharp/sharp_ylmgen_c.c @@ -205,3 +205,13 @@ double *sharp_Ylmgen_get_norm (int lmax, int spin) res[l] = (l