{ "cells": [ { "cell_type": "markdown", "id": "08ccf969", "metadata": {}, "source": [ "# Planetary Body Examples\n", "\n", "Below are plots of supported planetary bodies in `craterpy`. Example crater lists and global imagery are available from `craterpy.sample_data` for plotting and testing purposes.\n", "\n", "- Image data are named `.tif` (ex. `sample_data[\"moon.tif\"]`)\n", "- Crater data are named `_craters_km.csv` (ex. `sample_data[\"moon_craters_km.csv\"]`)\n" ] }, { "cell_type": "code", "execution_count": null, "id": "0bbc8bd8", "metadata": { "tags": [ "hide-cell" ] }, "outputs": [], "source": [ "import warnings\n", "warnings.filterwarnings(\"ignore\", \"Skipping ROIs that cross pole or antimeridian*\")" ] }, { "cell_type": "code", "execution_count": null, "id": "d899b2a7", "metadata": {}, "outputs": [], "source": [ "from craterpy import all_bodies, CraterDatabase, sample_data\n", "import matplotlib.pyplot as plt\n", "print(\"Supported planetary bodies:\", all_bodies)" ] }, { "cell_type": "code", "execution_count": null, "id": "332ed4e4", "metadata": {}, "outputs": [], "source": [ "for body in all_bodies:\n", " fname = f'{body}_craters_km.csv'\n", " if fname not in sample_data:\n", " continue\n", " cdb = CraterDatabase(sample_data[fname], body, units='km')\n", " print(\"Starting\", body.capitalize(), \"with CRS:\", \":\".join(cdb.data.crs.to_authority()))\n", " cdb.add_circles('Rim', 1)\n", " cdb.add_circles('Ejecta', 2.5)\n", " ax = cdb.plot(sample_data[f'{body}.tif'], \"Rim\")\n", " ax = cdb.plot_rois(sample_data[f'{body}.tif'], \"Ejecta\")\n", " plt.show()\n" ] }, { "cell_type": "code", "execution_count": null, "id": "4649e500", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "craterpy", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.7" } }, "nbformat": 4, "nbformat_minor": 5 }