Commit 16fbec9f by Martin Reinecke

### add a few test codes

parent 13489017
 from __future__ import print_function import time import math import numpy as np import pyHealpix as ph def report (name,vlen,ntry,nside,isnest,perf): print (name,": ",perf*1e-6,"MOps/s",sep="") def random_ptg(vlen): res=np.empty((vlen,2),dtype=np.float64) res[:,0]=np.arccos((np.random.random_sample(vlen)-0.5)*2) res[:,1]=np.random.random_sample(vlen)*2*math.pi return res def random_pix(nside,vlen): return np.random.randint(low=0,high=12*nside*nside-1,size=vlen,dtype=np.int64) def dummy(vlen): inp=np.zeros(vlen,dtype=np.int64) def genperf(func,fname,inp,vlen,ntry,nside,isnest): cnt=0 t=time.time() while (cnt
pyHealpix_test.py 0 → 100644
 import pyHealpix as ph import numpy as np import math def random_ptg(vlen): res=np.empty((vlen,2),dtype=np.float64) res[:,0]=np.arccos((np.random.random_sample(vlen)-0.5)*2) res[:,1]=np.random.random_sample(vlen)*2*math.pi return res def check_pixangpix(vlen,ntry,nside,isnest): base=ph.Healpix_Base (nside,"NEST" if isnest else "RING") cnt=0 while (cnt
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!