Cygrid: A fast Cython-powered convolution-based gridding module for Python

B. Winkel, D. Lenz, L. Flöer
4/22/2016
21 citations
astro-ph.IM

Official code: bwinkel/cygrid (37 stars, Jupyter Notebook, last commit 2024-10-15).

Abstract

Data gridding is a common task in astronomy and many other science disciplines. It refers to the resampling of irregularly sampled data to a regular grid.

Show full abstract

We present cygrid, a library module for the general purpose programming language Python. Cygrid can be used to resample data to any collection of target coordinates, although its typical application involves FITS maps or data cubes. The FITS world coordinate system standard is supported. The regridding algorithm is based on the convolution of the original samples with a kernel of arbitrary shape. We introduce a lookup table scheme that allows us to parallelize the gridding and combine it with the HEALPix tessellation of the sphere for fast neighbor searches. We show that for $n$ input data points, cygrids runtime scales between O(n) and O(n log n) and analyze the performance gain that is achieved using multiple CPU cores. We also compare the gridding speed with other techniques, such as nearest-neighbor, and linear and cubic spline interpolation. Cygrid is a very fast and versatile gridding library that significantly outperforms other third-party Python modules, such as the linear and cubic spline interpolation provided by SciPy.

View on arXivView PDF

Code Implementations(1)

bwinkel/cygridOfficial100%

Cygrid is a cython-powered convolution-based gridding module for astronomy

379Jupyter Notebook, PythonFeb 29, 20162 years ago
astronomygriddingpythonresampling

Similar Papers

Cite this paper

@article{winkel2016cygrid,
  title  = {Cygrid: A fast Cython-powered convolution-based gridding module for Python},
  author = {B. Winkel and D. Lenz and L. Flöer},
  year   = {2016},
  eprint = {1604.06667},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/1604.06667}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/1604.06667.svg)](https://codeofpaper.com/paper/1604.06667)

Discussion