void he_map2alm(int nside,int lmax,int ntrans,flouble **maps,fcomplex **alms) { int nbatches,nodd,itrans; double time; sharp_alm_info *alm_info; sharp_geom_info *geom_info; sharp_make_triangular_alm_info(lmax,lmax,1,&alm_info); sharp_make_weighted_healpix_geom_info(nside,1,NULL,&geom_info); nbatches=ntrans/MAX_SHT; nodd=ntrans%MAX_SHT; for(itrans=0;itrans<nbatches;itrans++) { time=0; #ifdef _SPREC sharp_execute(SHARP_MAP2ALM,0,&(alms[itrans*MAX_SHT]), &(maps[itrans*MAX_SHT]),geom_info, alm_info,MAX_SHT,0,&time,NULL); #else //_SPREC sharp_execute(SHARP_MAP2ALM,0,&(alms[itrans*MAX_SHT]), &(maps[itrans*MAX_SHT]),geom_info, alm_info,MAX_SHT,SHARP_DP,&time,NULL); #endif //_SPREC // printf(" Took %lf s according to libsharp\n",time); } if(nodd>0) { time=0; #ifdef _SPREC sharp_execute(SHARP_MAP2ALM,0,&(alms[nbatches*MAX_SHT]), &(maps[nbatches*MAX_SHT]),geom_info, alm_info,nodd,0,&time,NULL); #else //_SPREC sharp_execute(SHARP_MAP2ALM,0,&(alms[nbatches*MAX_SHT]), &(maps[nbatches*MAX_SHT]),geom_info, alm_info,nodd,SHARP_DP,&time,NULL); #endif //_SPREC // printf(" Took %lf s according to libsharp\n",time); } sharp_destroy_geom_info(geom_info); sharp_destroy_alm_info(alm_info); }
sht( size_t const l_max, size_t const m_max, size_t const num_pixels, size_t const num_fields ) throw() :m_l_max(l_max) ,m_m_max(m_max) ,m_num_pixels(num_pixels) ,m_num_fields(num_fields){ if(num_pixels % size_t(12) != size_t(0)){ std::stringstream msg; msg << "number of pixels = " << num_pixels << " should be a multiple of 12."; throw std::invalid_argument(msg.str()); } size_t const num_sides = (size_t) std::sqrt(double(num_pixels)/double(12)); if(is_power_of_2(num_sides) == false){ std::stringstream msg; msg << "number of sides = " << num_sides << " should be a power of 2."; throw std::invalid_argument(msg.str()); } sharp_make_healpix_geom_info ( (int) num_sides, int(1), &m_p_geom_info ); sharp_make_triangular_alm_info ( (int) l_max, (int) m_max, int(1), &m_p_alm_info ); }