craterpy

A python library for impact crater data science

https://github.com/cjtu/craterpy

Science Score: 100.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 1 DOI reference(s) in JOSS metadata
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
    3 of 8 committers (37.5%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

data-science open-science planetary python

Keywords from Contributors

mesh interpretability sequences generic projection interactive optim hacking network-simulation
Last synced: 4 months ago · JSON representation ·

Repository

A python library for impact crater data science

Basic Info
Statistics
  • Stars: 20
  • Watchers: 5
  • Forks: 8
  • Open Issues: 13
  • Releases: 14
Topics
data-science open-science planetary python
Created over 8 years ago · Last pushed 4 months ago
Metadata Files
Readme Contributing License Code of conduct Citation Authors

README.md

Craterpy: Impact crater data science in Python

PYPI version Code Quality Checks Code Coverage
Cite on Zenodo Cite on Zenodo Contributor Covenant

Overview

Craterpy makes it easier to work with impact crater data in Python. Highlights:

  • convert a table of crater data to a GeoDataFrame or GIS-ready shapefile
  • extract zonal statistics associated with each crater in circlular or annular regions (rasterstats)
  • eliminate some pain points of planetary GIS analysis (antimeridian wrapping, projection conversions, etc.)

Note: Craterpy is not a crater detection algorithm (e.g. PyCDA), nor is it a crater count age dating tool (see craterstats).

Note: Craterpy is in development. We appreciate bug reports and feature requests on the issues board.

Quickstart

Install with pip install craterpy then follow the full worked example in the docs Getting Started.

Demo

Quickly import tabluar crater data from a CSV and visualize it on a geotiff in 2 lines of code:

```python from craterpy import CraterDatabase, sample_data

cdb = CraterDatabase(sampledata['vestacraters.csv'], 'Vesta', units='m') cdb.plot(sample_data['vesta.tif'], alpha=0.5, color='tab:green') ```

Vesta map plot

Clip and plot targeted regions around each crater from large raster datasets.

python cdb.add_circles('crater_rois', 3) cdb.plot_rois(sample_data['vesta.tif'], 'crater_rois', range(1500, 1503))

Vesta plot rois

Extract zonal statistics for crater regions of interest.

```python

Import lunar crater and define the floor and rim

cdb = CraterDatabase(sampledata['mooncraters.csv'], 'Moon', units='km') cdb.addannuli("floor", 0.4, 0.8) # Crater floor (exclude central peak and rim) cdb.addannuli("rim", 0.9, 1.1) # Thin annulus at crater rim

Compute summary statistics for every ROI see docs for supported stats

stats = cdb.getstats(sampledata['moon_dem.tif'], regions=['floor', 'rim'], stats=['median'])

Compute crater depth as rim elevation - floor elevation

stats['depth (m)'] = (stats.medianrim - stats.medianfloor) print(stats.head(3).round(2))

Name Rad Lat Lon medianfloor medianrim depth (m)

Olbers D 50.015 10.23 -78.03 -1452.50 -1322.88 129.62

Schuster 50.04 4.44 146.42 445.58 1976.97 1531.39

Gilbert 50.125 -3.20 76.16 -2213.66 -731.64 1482.02

```

Documentation

Full API documentation and usage examples are available at ReadTheDocs.

Installation

We recommend pip installing craterpy into a virtual environment, e.g. with conda or venv:

bash pip install craterpy - Note: Craterpy is currently only tested on Ubuntu and OS X but may work on some versions of Windows.

Contributing

There are two major ways you can help improve craterpy:

  • Report bugs or request new features on the issues board.

  • Contributing directly. See CONTRIBUTING.rst for full details. First time open source contributors are welcome!

Citing craterpy

Craterpy is MIT Licenced and is free to use with attribution. Citation information can be found here.

Owner

  • Name: Christian J. Tai Udovicic
  • Login: cjtu
  • Kind: user
  • Location: Honolulu, HI

Open planetary science, software dev, data science @openplanetary

JOSS Publication

Craterpy: Impact crater data science in Python
Published
September 29, 2025
Volume 10, Issue 113, Page 8663
Authors
Christian J. Tai Udovicic ORCID
Hawaiʻi Institute of Geophysics and Planetology, School of Ocean and Earth Science and Technology, University of Hawaiʻi at Manoa, Honolulu, HI, United States of America
Ari Essunfeld ORCID
Los Alamos National Laboratory, Los Alamos, NM, United States of America
Emily S. Costello ORCID
Hawaiʻi Institute of Geophysics and Planetology, School of Ocean and Earth Science and Technology, University of Hawaiʻi at Manoa, Honolulu, HI, United States of America
Editor
James Gaboardi ORCID
Tags
planetary science data analysis spatial analysis

Citation (CITATION.cff)

cff-version: 1.2.0
type: software
message: "If you use this software, please cite it as below."
authors:
- family-names: "Tai Udovicic"
  given-names: "Christian J."
  affiliation: University of Hawaii at Manoa
  orcid: "https://orcid.org/0000-0001-9972-1534"
- family-names: "Essunfeld"
  given-names: "Ari"
  orcid: "https://orcid.org/0000-0001-8689-0734"
title: "Craterpy"
doi: 10.5281/zenodo.830057
url: "https://github.com/cjtu/craterpy"
license: MIT

GitHub Events

Total
  • Create event: 17
  • Release event: 5
  • Issues event: 34
  • Watch event: 4
  • Delete event: 16
  • Member event: 1
  • Issue comment event: 50
  • Push event: 56
  • Pull request review event: 17
  • Pull request review comment event: 30
  • Pull request event: 41
Last Year
  • Create event: 17
  • Release event: 5
  • Issues event: 34
  • Watch event: 4
  • Delete event: 16
  • Member event: 1
  • Issue comment event: 50
  • Push event: 56
  • Pull request review event: 17
  • Pull request review comment event: 30
  • Pull request event: 41

Committers

Last synced: almost 2 years ago

All Time
  • Total Commits: 266
  • Total Committers: 8
  • Avg Commits per committer: 33.25
  • Development Distribution Score (DDS): 0.195
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Christian c****c@g****m 214
Cjtu c****i@r****m 41
Cong c****s@g****m 3
Cailin Gallinger c****r@m****a 3
Cjtu c****c@m****a 2
Alex Boivin a****n@m****a 1
Dylan Hickson d****n@g****m 1
dependabot[bot] 4****] 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 34
  • Total pull requests: 87
  • Average time to close issues: almost 2 years
  • Average time to close pull requests: 4 months
  • Total issue authors: 7
  • Total pull request authors: 7
  • Average comments per issue: 0.65
  • Average comments per pull request: 1.09
  • Merged pull requests: 31
  • Bot issues: 0
  • Bot pull requests: 51
Past Year
  • Issues: 24
  • Pull requests: 42
  • Average time to close issues: 22 days
  • Average time to close pull requests: 12 days
  • Issue authors: 4
  • Pull request authors: 3
  • Average comments per issue: 0.63
  • Average comments per pull request: 1.24
  • Merged pull requests: 21
  • Bot issues: 0
  • Bot pull requests: 15
Top Authors
Issue Authors
  • cjtu (22)
  • ESCostello (4)
  • marcsit (3)
  • athulpg007 (2)
  • cgallinger (1)
  • ghentr (1)
  • cxong (1)
Pull Request Authors
  • dependabot[bot] (51)
  • cjtu (17)
  • ariessunfeld (15)
  • boivinalex (1)
  • graduateddylinder (1)
  • cgallinger (1)
  • cxong (1)
Top Labels
Issue Labels
Status: Available (5) Type: Enhancement (5) Status: In Progress (3) Priority: Medium (3) Type: Bug (2) Priority: High (2) help wanted (2) Hacktoberfest (2) Easy (2) Type: Investigate (1) Priority: Critical (1) Status: Completed (1) Priority: Low (1) Type: Feature Request (1) good first issue (1) Maintenance (1)
Pull Request Labels
dependencies (48) python (2)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 271 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 12
  • Total maintainers: 1
pypi.org: craterpy

Impact crater data science in Python.

  • Versions: 12
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 271 Last month
Rankings
Dependent packages count: 10.1%
Forks count: 12.6%
Stargazers count: 14.6%
Average: 18.1%
Dependent repos count: 21.5%
Downloads: 31.8%
Maintainers (1)
Last synced: 4 months ago

Dependencies

docs/requirements.txt pypi
  • affine ==2.3.1
  • attrs ==21.4.0
  • certifi ==2022.6.15
  • click ==8.1.3
  • click-plugins ==1.1.1
  • cligj ==0.7.2
  • colorama ==0.4.5
  • cycler ==0.11.0
  • fonttools ==4.34.4
  • importlib-metadata ==1.7.0
  • kiwisolver ==1.4.4
  • matplotlib ==3.5.2
  • numpy ==1.21.6
  • packaging ==21.3
  • pandas ==1.3.5
  • pillow ==9.2.0
  • pyparsing ==3.0.9
  • python-dateutil ==2.8.2
  • pytz ==2022.1
  • rasterio ==1.2.10
  • setuptools-scm ==7.0.5
  • six ==1.16.0
  • snuggs ==1.4.7
  • tomli ==2.0.1
  • typing-extensions ==4.3.0
  • zipp ==3.8.1
poetry.lock pypi
  • 131 dependencies
pyproject.toml pypi
  • black ^22.6 develop
  • jupyter ^1.0.0 develop
  • myst-parser ^0.18.0 develop
  • pylint ^2.8.2 develop
  • pytest ^6.2.4 develop
  • pytest-cov ^2.11.1 develop
  • sphinx ^5.1.1 develop
  • sphinx-rtd-theme ^1.0.0 develop
  • matplotlib ^3.4.2
  • numpy ^1.20.2
  • pandas ^1.2.4
  • python ^3.8,<3.10
  • rasterio ^1.2.8
requirements.txt pypi
  • affine ==2.3.1
  • attrs ==22.1.0
  • certifi ==2022.6.15
  • click ==8.1.3
  • click-plugins ==1.1.1
  • cligj ==0.7.2
  • colorama ==0.4.5
  • cycler ==0.11.0
  • fonttools ==4.34.4
  • kiwisolver ==1.4.4
  • matplotlib ==3.5.2
  • numpy ==1.23.1
  • packaging ==21.3
  • pandas ==1.4.3
  • pillow ==9.2.0
  • pyparsing ==3.0.9
  • python-dateutil ==2.8.2
  • pytz ==2022.1
  • rasterio ==1.3.0
  • setuptools-scm ==7.0.5
  • six ==1.16.0
  • snuggs ==1.4.7
  • tomli ==2.0.1
  • typing-extensions ==4.3.0
.github/workflows/code_quality_checks.yml actions
  • Gr1N/setup-poetry v4 composite
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • codecov/codecov-action v1 composite
.github/workflows/pypi_publish.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v1 composite
.github/workflows/test_pypi_publish.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v1 composite