A python library for impact crater data science

cjtu, updated 🕥 2023-02-23 19:49:04
Craterpy: Impact crater data science in Python.
PYPI version Code Quality Checks Code Coverage
Cite on Zenodo Cite on Zenodo Code Style: Black

Overview

Craterpy simplifies the extraction and statistical analysis of impact craters in planetary datasets. It can:

  • work with tables of crater data in Python (using pandas)
  • load and manipulate planetary image data in Python (using rasterio)
  • extract, mask, filter, and compute stats on craters located in planetary imagery
  • plot crater regions of interest

Craterpy currently only supports simple cylindrical images and requires you to provide a table of crater locations and sizes (e.g. it isn't a crater detection program). See the example below!

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

Example

Craterpy in action:

python import pandas as pd from craterpy import dataset, stats df = pd.DataFrame({'Name': ["Orientale", "Langrenus", "Compton"], 'Lat': [-19.9, -8.86, 55.9], 'Lon': [-94.7, 61.0, 104.0], 'Rad': [147.0, 66.0, 82.3]}) moon = dataset.CraterpyDataset("moon.tif") stat_df = cs.ejecta_stats(df, moon, 4, ['mean', 'median', 'std'], plot=True)

ejecta image

python stats_df.head()

crater stats

New users should start with the Jupyter notebook tutorial for typical usage with examples. See also craterpy documentation on Read the Docs.

Note: This package currently only accepts image data in simple-cylindrical (Plate Caree) projection. If your data is in another projection, please reproject it to simple-cylindrical before importing it with craterpy. If you would like add reprojection functionality to craterpy, consider Contributing.

Installation

With pip:

bash pip install craterpy python -c "import craterpy; print(craterpy.__version__)"

In a new conda environment:

```bash

Create and activate a new conda environment called "craterpy"

conda create -n craterpy python=3.9 conda activate craterpy

Install craterpy with pip

pip install craterpy python -c "import craterpy; print(craterpy.version)" ```

With git and poetry (for latest version & development):

```bash

Clone this repository

$ cd ~ $ git clone https://github.com/cjtu/craterpy.git

Enter the repository

$ cd craterpy

Configure poetry

poetry config virtualenvs.create true --local poetry config virtualenvs.in-project true --local

Install craterpy with poetry

$ poetry install

Check installation

poetry version

Either open a Jupyter server

$ poetry run jupyter notebook

Or activate the venv from your Python editor of choice

The venv is path is ~/craterpy/.venv/bin/python

```

On Windows (see rasterio installation for Windows):

  • Note: Craterpy is tested on Ubuntu and OS X. If you would like to use craterpy on Windows, we recommend getting the Windows Subsystem for Linux (WSL) and installing into a Linux distribution. However, the following may also work for a native Windows installation and depends on a working installation of rasterio from pre-compiled binaries (see link above).

```bash

Windows requires gdal binaries specific to the OS (32/64-bit) and python version

First download the rasterio and GDAL binaries for your system (link above)

If rasterio imports with no error then craterpy should be pip installable

pip install GDAL-X.Y.Z-...-win.whl pip install rasterio-X.Y.Z-...-win.whl python -c "import rasterio" pip install craterpy python -c "import craterpy; print(craterpy.version)" ```

Trouble installing craterpy? Let us know on the issues board.

Dependencies

Craterpy requires python >3.7.7 and is tested on Ubuntu and OS X. It's core dependencies are:

  • rasterio
  • pandas
  • numpy
  • matplotlib

Documentation

Full API documentation is available at readthedocs.

Contributing

There are two major ways you can help improve craterpy:

Bug Reporting and Feature Requests

You can report bugs or request new features on the issues board.

Contributing Directly

Want to fix a bug / implement a feature / fix some documentation? We welcome pull requests from all new contributors! You (yes you!) can help us make craterpy as good as it can be! See CONTRIBUTING.rst for details on how to get started - first time GitHub contributors welcome - and encouraged!

Citing craterpy

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

Contact

If you have comments/question/concerns or just want to get in touch, you can email Christian at [email protected] or follow @TaiUdovicic on Twitter.

Issues

Bump markdown-it-py from 2.1.0 to 2.2.0

opened on 2023-02-23 19:49:04 by dependabot[bot]

Bumps markdown-it-py from 2.1.0 to 2.2.0.

Release notes

Sourced from markdown-it-py's releases.

v2.2.0

What's Changed

New Contributors

Thanks to 🎉

Full Changelog: https://github.com/executablebooks/markdown-it-py/compare/v2.1.0...v2.2.0

Changelog

Sourced from markdown-it-py's changelog.

2.2.0 - 2023-02-22

What's Changed

New Contributors

Thanks to 🎉

Full Changelog: https://github.com/executablebooks/markdown-it-py/compare/v2.1.0...v2.2.0

Commits


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/cjtu/craterpy/network/alerts).

Bump ipython from 8.4.0 to 8.10.0

opened on 2023-02-11 01:54:39 by dependabot[bot]

Bumps ipython from 8.4.0 to 8.10.0.

Commits
  • 15ea1ed release 8.10.0
  • 560ad10 DOC: Update what's new for 8.10 (#13939)
  • 7557ade DOC: Update what's new for 8.10
  • 385d693 Merge pull request from GHSA-29gw-9793-fvw7
  • e548ee2 Swallow potential exceptions from showtraceback() (#13934)
  • 0694b08 MAINT: mock slowest test. (#13885)
  • 8655912 MAINT: mock slowest test.
  • a011765 Isolate the attack tests with setUp and tearDown methods
  • c7a9470 Add some regression tests for this change
  • fd34cf5 Swallow potential exceptions from showtraceback()
  • Additional commits viewable in compare view


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/cjtu/craterpy/network/alerts).

Bump certifi from 2022.6.15 to 2022.12.7

opened on 2022-12-09 07:19:42 by dependabot[bot]

Bumps certifi from 2022.6.15 to 2022.12.7.

Commits


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/cjtu/craterpy/network/alerts).

Bump certifi from 2022.6.15 to 2022.12.7 in /docs

opened on 2022-12-09 07:19:36 by dependabot[bot]

Bumps certifi from 2022.6.15 to 2022.12.7.

Commits


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/cjtu/craterpy/network/alerts).

Bump nbconvert from 6.5.0 to 6.5.1

opened on 2022-08-23 19:28:25 by dependabot[bot]

Bumps nbconvert from 6.5.0 to 6.5.1.

Commits


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/cjtu/craterpy/network/alerts).

Bump mistune from 0.8.4 to 2.0.3

opened on 2022-07-29 22:58:08 by dependabot[bot]

Bumps mistune from 0.8.4 to 2.0.3.

Release notes

Sourced from mistune's releases.

Version 2.0.2

Fix escape_url via lepture/mistune#295

Version 2.0.1

Fix XSS for image link syntax.

Version 2.0.0

First release of Mistune v2.

Version 2.0.0 RC1

In this release, we have a Security Fix for harmful links.

Version 2.0.0 Alpha 1

This is the first release of v2. An alpha version for users to have a preview of the new mistune.

Changelog

Sourced from mistune's changelog.

Changelog

Here is the full history of mistune v2.

Version 2.0.4


Released on Jul 15, 2022
  • Fix url plugin in <a> tag
  • Fix * formatting

Version 2.0.3

Released on Jun 27, 2022

  • Fix table plugin
  • Security fix for CVE-2022-34749

Version 2.0.2


Released on Jan 14, 2022

Fix escape_url

Version 2.0.1

Released on Dec 30, 2021

XSS fix for image link syntax.

Version 2.0.0


Released on Dec 5, 2021

This is the first non-alpha release of mistune v2.

Version 2.0.0rc1

Released on Feb 16, 2021

Version 2.0.0a6


</tr></table> 

... (truncated)

Commits
  • 3f422f1 Version bump 2.0.3
  • a6d4321 Fix asteris emphasis regex CVE-2022-34749
  • 5638e46 Merge pull request #307 from jieter/patch-1
  • 0eba471 Fix typo in guide.rst
  • 61e9337 Fix table plugin
  • 76dec68 Add documentation for renderer heading when TOC enabled
  • 799cd11 Version bump 2.0.2
  • babb0cf Merge pull request #295 from dairiki/bug.escape_url
  • fc2cd53 Make mistune.util.escape_url less aggressive
  • 3e8d352 Version bump 2.0.1
  • Additional commits viewable in compare view


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/cjtu/craterpy/network/alerts).

Releases

craterpy v0.5.2 2022-07-29 22:55:27

Bump minimum python version to 3.8, update dependencies and docs

craterpy v0.5.1 2021-05-22 05:56:58

Update metadata

craterpy v0.5.0 2021-05-22 04:42:03

Improve CI, documentation and testing.

craterpy v0.4.1 2021-05-14 00:45:03

Fix project metadata.

craterpy v0.4.0: Switch to rasterio and poetry 2021-05-14 00:23:44

Many changes in this version of craterpy: - This release removes the GDAL dependency which caused the package to be much more difficult to install. - Image I/O is now handled completely by rasterio. - The default installation method is now poetry which will hopefully also clear up dependency conflicts. - The build is now tested and passing on macOS and Ubuntu. - More tests were added. - Minor bug fixes.

Waning: There are some API breaking changes in this release! Most notable will be if your workflow accessed gdal attributes or methods through the CraterpyDataset wrapper. It now wraps the rasterio.DatasetReader so you will need to migrate your CraterpyDataset operations to the rasterio syntax (see Switching from GDAL bindings in the rasterio docs)

craterpy v0.3.0 2021-04-08 22:54:17

New craterpy release with some bug fixes and improvements

Original: Apr 8, 2021 Edited: May 21, 2021 to fix semantic versioning

Christian J. Tai Udovicic

Planetary science, software dev, data science

GitHub Repository

planetary data-science python open-science