Package: craterpy
Craterpy:Impact crater data science in Python.OverviewCraterpy 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 imageryplot crater regions of interestCraterpy 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 theissues board.ExampleCraterpy in action:importpandasaspdfromcraterpyimportdataset,statsdf=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)stats_df.head()New users should start with the Jupyter notebooktutorialfor typical usage with examples. See alsocraterpy documentationon Read the Docs.Note: This package currentlyonly 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, considerContributing.InstallationWith pip:pipinstallcraterpy
python-c"import craterpy; print(craterpy.__version__)"In a newconda environment:# Create and activate a new conda environment called "craterpy"condacreate-ncraterpypython=3.9
condaactivatecraterpy# Install craterpy with pippipinstallcraterpy
python-c"import craterpy; print(craterpy.__version__)"Withgitandpoetry(for latest version & development):# Clone this repository$cd~
$gitclonehttps://github.com/cjtu/craterpy.git# Enter the repository$cdcraterpy# Configure poetrypoetryconfigvirtualenvs.createtrue--local
poetryconfigvirtualenvs.in-projecttrue--local# Install craterpy with poetry$poetryinstall# Check installationpoetryversion# Either open a Jupyter server$poetryrunjupyternotebook# Or activate the venv from your Python editor of choice# The venv is path is ~/craterpy/.venv/bin/pythonOn Windows (seerasterio 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).# 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 installablepipinstallGDAL-X.Y.Z-...-win.whl
pipinstallrasterio-X.Y.Z-...-win.whl
python-c"import rasterio"pipinstallcraterpy
python-c"import craterpy; print(craterpy.__version__)"Trouble installing craterpy? Let us know on theissuesboard.DependenciesCraterpy requires python >3.7.7 and is tested on Ubuntu and OS X. It's core dependencies are:rasteriopandasnumpymatplotlibDocumentationFull API documentation is available atreadthedocs.ContributingThere are two major ways you can help improve craterpy:Bug Reporting and Feature RequestsYou can report bugs or request new features on theissuesboard.Contributing DirectlyWant 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! SeeCONTRIBUTING.rstfor details on how to get started - first time GitHub contributors welcome - and encouraged!Citing craterpyCraterpy isMIT Licencedand is free to use with attribution. Citation information can be foundhere.ContactIf you have comments/question/concerns or just want to get in touch, you can email Christian atcj.taiudovicic@gmail.comor follow@TaiUdovicicon Twitter.