{"id":32176211,"url":"https://github.com/bwinkel/cygrid","last_synced_at":"2026-02-21T03:31:37.024Z","repository":{"id":45430546,"uuid":"52819253","full_name":"bwinkel/cygrid","owner":"bwinkel","description":"Cygrid is a cython-powered convolution-based gridding module for astronomy","archived":false,"fork":false,"pushed_at":"2024-10-15T07:37:22.000Z","size":118200,"stargazers_count":37,"open_issues_count":5,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-24T07:45:27.125Z","etag":null,"topics":["astronomy","gridding","python","resampling"],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bwinkel.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":null,"funding":null,"license":"licenses/LICENSE.rst","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2016-02-29T19:47:51.000Z","updated_at":"2025-10-14T08:05:13.000Z","dependencies_parsed_at":"2025-09-05T12:43:13.268Z","dependency_job_id":"2072edee-ed23-47c8-b7a2-c7150b85a397","html_url":"https://github.com/bwinkel/cygrid","commit_stats":{"total_commits":129,"total_committers":6,"mean_commits":21.5,"dds":0.627906976744186,"last_synced_commit":"11f0547804470dfb56aca880e631542dae8bdf86"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/bwinkel/cygrid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwinkel%2Fcygrid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwinkel%2Fcygrid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwinkel%2Fcygrid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwinkel%2Fcygrid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bwinkel","download_url":"https://codeload.github.com/bwinkel/cygrid/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwinkel%2Fcygrid/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29672704,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T03:11:15.450Z","status":"ssl_error","status_checked_at":"2026-02-21T03:10:34.920Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["astronomy","gridding","python","resampling"],"created_at":"2025-10-21T19:55:48.709Z","updated_at":"2026-02-21T03:31:37.016Z","avatar_url":"https://github.com/bwinkel.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"******\ncygrid\n******\n\n- *Version:* 2.0\n- *Authors:* Benjamin Winkel, Lars Flöer, Daniel Lenz\n- *User manual:* `stable \u003chttps://bwinkel.github.io/cygrid/stable/\u003e`__ |\n  `developer \u003chttps://bwinkel.github.io/cygrid/latest/\u003e`__\n\n.. image:: https://img.shields.io/pypi/v/cygrid.svg\n    :target: https://pypi.python.org/pypi/cygrid\n    :alt: PyPI tag\n\n.. image:: https://img.shields.io/badge/license-GPL-blue.svg\n    :target: https://www.github.com/bwinkel/cygrid/blob/master/COPYING\n    :alt: License\n\n.. image:: http://img.shields.io/badge/arXiv-1604.06667-blue.svg\n    :target: https://arxiv.org/abs/1604.06667\n    :alt: Publication\n\n.. image:: https://img.shields.io/badge/ascl-1606.003-blue.svg?colorB=262255\n   :target: http://ascl.net/1606.003\n\nProject Status\n==============\n\n.. image:: https://travis-ci.org/bwinkel/cygrid.svg?branch=master\n    :target: https://travis-ci.org/bwinkel/cygrid\n    :alt: cygrid's Travis CI Status\n\n.. image:: https://ci.appveyor.com/api/projects/status/1ydk0hjf04t90aw5?svg=true\n    :target: https://ci.appveyor.com/project/bwinkel/cygrid\n    :alt: cygrid's AppVeyor CI Status\n\n.. image:: https://coveralls.io/repos/github/bwinkel/cygrid/badge.svg?branch=master\n    :target: https://coveralls.io/github/bwinkel/cygrid?branch=master\n    :alt: cygrid's Coveralls Status\n\n`Cygrid` is already used in several \"production\" systems, for example it was\nutilized for two major 21-cm HI surveys, EBHIS and HI4PI. Nevertheless,\nwe cannot guarantee that it's completely bug-free. We kindly invite you to\nuse the library and we are grateful for feedback. Note, that work on the documentation is still ongoing.\n\nPurpose\n=======\n\n`cygrid` allows to resample a number of spectra (or data points) to a regular\ngrid - a data cube - using any valid astronomical FITS/WCS projection (see\nhttp://docs.astropy.org/en/stable/wcs/).\n\nThe method is a based on serialized convolution with finite gridding kernels.\nCurrently, only Gaussian (radial-symmetric or elliptical) kernels are provided\n(which has the drawback of slight degradation of the effective resolution).\nThe algorithm has very small memory footprint, allows easy parallelization,\nand is very fast.\n\nA detailed description of the algorithm is given in `Winkel, Lenz \u0026 Flöer\n(2016) \u003chttp://adsabs.harvard.edu/abs/2016A%26A...591A..12W\u003e`_, which we\nkindly ask to be used as reference if you found `cygrid` useful for your\nresearch.\n\nFeatures\n========\n\n- Supports any WCS projection system as target.\n- Conserves flux.\n- Low memory footprint.\n- Scales very well on multi-processor/core platforms.\n\nInstallation\n============\n\nWe highly recommend to use `cygrid` with the `Anaconda Python distribution \u003chttps://www.anaconda.com/\u003e`_, in which\ncase installiation is as easy as ::\n\n    conda install -c conda-forge cygrid\n\nOtherwise, you should install cygrid via `pip`::\n\n    python -m pip install cygrid\n\nThe installation is also possible from source, but you'll need a C++\ncompiler. Download the tar.gz-file, extract (or clone from GitHub) and\nexecute (in project directory)::\n\n    python -m pip install .\n\nDependencies\n------------\n\nWe kept the dependencies as minimal as possible. The following packages are\nrequired:\n\n- `Python 3.8` or later (`cygrid` versions prior to v1.0 support `Python 2.7`)\n- `NumPy 1.13` or later\n- `Cython 3` or later (if you want to build `cygrid` yourself)\n- `Astropy 4.0` or later\n\n(Older versions of these libraries may work, but we didn't test this!)\n\nIf you want to run the notebooks yourself, you will also need the Jupyter\nserver, matplotlib and wcsaxes packages. To run the tests, you'll need HealPy.\n\nNote, for compiling the C-extension, openmp is used for parallelization and\nsome C++11 language features are necessary. If you use gcc, for example, you\nneed at least version 4.8 otherwise the setup-script will fail. It is highly\nrecommended to use Anaconda, which offers the proper compilers for many\nplatforms.\n\nUsage\n=====\n\nMinimal example\n---------------\n\nUsing `cygrid` is extremely simple. Just define a FITS header (with valid\nWCS), define gridding kernel and run the grid function:\n\n.. code-block:: python\n\n    from astropy.io import fits\n    import cygrid\n\n    # read-in data\n    glon, glat, signal = get_data(...)\n\n    # define target FITS/WCS header\n    header = {\n        'NAXIS': 3,\n        'NAXIS1': 101,\n        'NAXIS2': 101,\n        'NAXIS3': 1024,\n        'CTYPE1': 'GLON-SFL',\n        'CTYPE2': 'GLAT-SFL',\n        'CDELT1': -0.1,\n        'CDELT2': 0.1,\n        'CRPIX1': 51,\n        'CRPIX2': 51,\n        'CRVAL1': 12.345,\n        'CRVAL2': 3.14,\n        }\n\n    # prepare gridder\n    kernelsize_sigma = 0.2\n\n    kernel_type = 'gauss1d'\n    kernel_params = (kernelsize_sigma, )\n    kernel_support = 3 * kernelsize_sigma\n    hpx_maxres = kernelsize_sigma / 2\n\n    mygridder = cygrid.WcsGrid(header)\n    mygridder.set_kernel(\n        kernel_type,\n        kernel_params,\n        kernel_support,\n        hpx_maxres\n        )\n\n    # do the gridding\n    mygridder.grid(glon, glat, signal)\n\n    # query result and store to disk\n    data_cube = mygridder.get_datacube()\n    fits.writeto(\n        'example.fits',\n        header=header, data=data_cube\n        )\n\n\nMore use-cases and tutorials\n----------------------------\n\nCheck out the `user manual \u003chttps://bwinkel.github.io/cygrid/latest/\u003e`_ or the\n`Jupyter tutorial notebooks \u003chttps://github.com/bwinkel/cygrid/tree/master/notebooks\u003e`_\nin the repository for further examples of how to use `cygrid`. Note that you\ncan only view the notebooks on GitHub, if you want to edit something\nit is necessary to clone the repository or download a notebook to run it on\nyour machine.\n\nWho do I talk to?\n=================\n\nIf you encounter any problems or have questions, do not hesitate to raise an\nissue or make a pull request. Moreover, you can contact the devs directly:\n\n- \u003cbwinkel@mpifr.de\u003e\n- \u003cmail@daniellenz.org\u003e\n\n\nPreferred citation method\n=========================\n\nPlease cite our `paper \u003chttp://adsabs.harvard.edu/abs/2016A%26A...591A..12W\u003e`_\nif you use `cygrid` for your projects.\n\n.. code-block:: latex\n\n    @ARTICLE{2016A\u0026A...591A..12W,\n        author = {{Winkel}, B. and {Lenz}, D. and {Fl{\\\"o}er}, L.},\n        title = \"{Cygrid: A fast Cython-powered convolution-based gridding module for Python}\",\n        journal = {\\aap},\n        archivePrefix = \"arXiv\",\n        eprint = {1604.06667},\n        primaryClass = \"astro-ph.IM\",\n        keywords = {methods: numerical, techniques: image processing},\n        year = 2016,\n        month = jun,\n        volume = 591,\n        eid = {A12},\n        pages = {A12},\n        doi = {10.1051/0004-6361/201628475},\n        adsurl = {http://adsabs.harvard.edu/abs/2016A%26A...591A..12W},\n        adsnote = {Provided by the SAO/NASA Astrophysics Data System}\n    }\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbwinkel%2Fcygrid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbwinkel%2Fcygrid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbwinkel%2Fcygrid/lists"}