예제 #1
0
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);
}
예제 #2
0
파일: sht.hpp 프로젝트: tbs1980/bpl
 ~sht(){
     if( m_p_geom_info ) sharp_destroy_geom_info(m_p_geom_info);
     if( m_p_alm_info ) sharp_destroy_alm_info(m_p_alm_info);
 }