[AstroPy] TAN WCS speedup

Maik Riechert maik.riechert at arcor.de
Fri Nov 14 13:21:29 EST 2014


Michael Droettboom:
> That is correct.  WCSLIB C code is single-threaded.  It's a relatively
> straightforward calculation such that I'd be surprised if anything else
> could account for such a large speedup.

I just tried it with numexpr.set_num_threads(1) and indeed it is
slightly slower now: 8.8s. I guess some speedup also comes numexpr
handling arrays in chunks such that they fit in the CPU cache.

Some other things I use:

numpy.core.umath_tests.matrix_multiply (rotating vectors)

I also reimplemented astropy's spherical_to_cartesian and
cartesian_to_spherical in terms of numexpr with fall-back to an
optimized numpy variant (which is also faster than astropy's, because it
doesn't calculate things twice and reuses temporary arrays where possible).

I had a quick look at astropy.modeling.projections and I think just
exchanging this part wouldn't earn that much performance.

Cheers
Maik



More information about the AstroPy mailing list