Skip to main content

Craterstats - a tool to analyse and plot crater count data for planetary surface dating

Project description

Craterstats-III

This is a Python reimplementation and extension of the Craterstats-II software, a tool to analyse and plot crater count data for planetary surface dating.

Gallery

Quick reference

Installation

The following procedure for installation on Windows, MacOS or Linux is recommended:

  1. Install the Python environment manager, Conda, using the miniforge installer for your OS.
  2. Launch the Miniforge prompt (Windows) or any command prompt (MacOS, Linux) and enter the following to create a virtual environment for craterstats:
    conda create -n craterstats python=3.12
    
  3. Activate the virtual environment:
    conda activate craterstats
    
  4. Install the craterstats package with its dependencies:
    pip install craterstats
    
  5. If on Windows, create a desktop shortcut for future start-up:
    craterstats --create_desktop_icon
    
    Modify properties for preferred start-up folder if desired.

Alternative installation methods here.

Quick demonstration and try-out

After installation, the following command will produce a series of example output plots as in the gallery, demonstrating the main features of the software. Plot image files are placed into the subfolder demo/ of the current folder.

craterstats -demo

Visit the Gallery and copy some of the commands there to recreate the example plots.

Normal start-up

  1. Double-click the desktop icon if present. Otherwise, launch the Miniforge prompt (Windows) or any command prompt (MacOS, Linux) and activate the virtual environment:
    conda activate craterstats
    
  2. Begin entering craterstats commands.

Usage

The program operates through the command line to produce output in the form of publication or presentation ready graphics, or tabulated analysis results for further processing.

There are two parts to creating a Craterstats plot:

  1. Specify the type of plot and any characteristics which apply to the analysis as a whole, e.g. whether differential, cumulative or other data presentation; the chronology system, displayed axis ranges

  2. Specify the data to be overplotted, and which chronology model evaluations should be applied to it

In the following example, the first items define characteristics for the whole plot: -cs neukumivanov specifies the chronology system, Mars, Neukum-Ivanov (2001) (any unambiguous abbreviation is acceptable), and the -title Example plot adds the chosen title.

The -p indicates the start of an overplot definition. Following this, the path to the data source is given: this will produce a simple data plot with the default binning, colour and plot symbol (note that %sample% is a special path abbreviation to a craterstats installation directory - it's not needed for your own data). After the second -p, an additional overplot is specified: this time, a poisson age evaluation for the diameter range 0.2–0.7 km. Note that parameters within an overplot definition are separated by a ,.

craterstats -cs neukumivanov -p source=%sample%/Pickering.scc -p type=poisson,range=[.2,.7]

Sometimes it is useful to be able to specify the diameter range in terms of the plotted data points. Here we plot from the 8th to the 5th-from-last bins:

craterstats -cs neukumivanov -p source=%sample%/Pickering.scc -p type=poisson,range=[b8,b-5]

Or it may be easier to use a temporary bin overlay by adding the option --bins

craterstats -cs neukumivanov -p source=%sample%/Pickering.scc -p type=poisson,range=[b8,b-5] --bins

A plot image file is created in the current folder with the same name Pickering.png. The output path or name can be changed with the -o option. Different file types can be produced by giving the appropriate extension or with the -f option. Supported types are: png, tif, pdf, svg, csv, stat (multiple types can be specified, e.g. -f png csv)

An additional text file is created with the name Pickering.cs which contains the command line parameters used to create the plot. Often it is convenient to edit this file to modify the plot, which can then be regenerated with the shorter command:

craterstats -i Pickering.cs

Another file, Pickering.csv, gives dating results in tabular form for further analysis or transfer to a manuscript. Preformatted ages and N(1) values, e.g. $\mu630^{+37}_{-35}$ Ma, are provided in latex and in MathML (copy and paste into Word with CTRL-SHIFT-V to get formatted expression).

Tables of chronology systems, equilibrium functions and epoch systems – which can be used with the -cs, -ef and -ep options – may be listed with the following command:

craterstats -lcs

These items may specifed using any unambiguous abbreviated form, e.g. -cs ida. Thus, -ef lunar or -ef trask will obtain the Lunar equilibrium (Trask, 1966) equilibrium function.

Tables of plot symbols and colours – which can be used with the psym= and colour= options – may be listed with the following command:

craterstats -lpc

and can likewise be specified by name or abbreviation, e.g. psym=circle or psym=o select a circle; colour=green or col=gr select green.

Differential plots are the default data presentation. To switch to a different kind, e.g. cumulative, add -pr cumulative or -pr cml. Other possibilities are: relative (R), Hartmann, chronology, rate, sequential or uncertainty.

The complete set of options can be seen with:

craterstats --help

To simplify the construction of the command line, certain plot properties are persistent. If, for example, you specify source=C:\tmp\area1.scc in the first overplot, this becomes the default for subsequent overplots until you specify a different source file. This also applies to other properties where it is useful, including binning=, colour= and psym=.

Uncertainty plots for the evaluation of small-area, low-number counts, assuming a complete count of craters larger than d_min can be generated (plots for k, measured error and measured/actual age - see Michael, Liu (2025)):

craterstats -pr uncertainty -cs n83 -d_min 0.15

as well as plots for comparing a sequence of events (Michael, Zhang, Wu, Liu, (2025)):

craterstats.py -pr seq -ep Wilhelms -xrange 4.2 1 -legend fAca -p src=%sample%/e1.diam,range=[0.24,1.5],type=poisson -p src=%sample%/e2.diam,rng=[0.25,1.5] -p src=%sample%/e3.diam,rng=[0.24,1.5] -p src=%sample%/w1.diam,rng=[0.21,1.2],colour=red 

Upgrade

If you later need to upgrade to a newer version, use:

pip install --upgrade craterstats

In case of failure, it is always safe to delete the craterstats environment directory from <userhome>/miniforge3/envs, and reinstall fresh.

References

Explanations of concepts and calculations used in the software are given in publications below.

Standardisation of crater count data presentation

Arvidson, R.E., Boyce, J., Chapman, C., Cintala, M., Fulchignoni, M., Moore, H., Neukum, G., Schultz, P., Soderblom, L., Strom, R., Woronow, A., Young, R. Standard techniques for presentation and analysis of crater size–frequency data. Icarus 37, 1979.

Formulation of a planetary surface chronology model

Neukum G., Meteorite bombardment and dating of planetary surfaces (English translation, 1984). Meteoritenbombardement und Datierung planetarer Oberflächen (German original) Habilitation Thesis, Univ. of Munich, 186pp, 1983.

Resurfacing correction for cumulative fits; production function differential forms

Michael G.G., Neukum G., Planetary surface dating from crater size-frequency distribution measurements: Partial resurfacing events and statistical age uncertainty. Earth and Planetary Science Letters 294, 2010.

Differential fitting; binning bias correction; revised Mars epoch boundaries

Michael G.G., Planetary surface dating from crater size-frequency distribution measurements: Multiple resurfacing episodes and differential isochron fitting. Icarus 2013.

Poisson timing analysis; μ-notation

Michael G.G., Kneissl T., Neesemann A., Planetary surface dating from crater size-frequency distribution measurements: Poisson timing analysis. Icarus, 2016.

Poisson calculation for buffered crater count

Michael G.G., Yue Z., Gou S., Di K., Dating individual several-km lunar impact craters from the rim annulus in region of planned Chang’E-5 landing Poisson age-likelihood calculation. EPSL 568, 2021.

Small-area and low number counts: age-area-uncertainty plots

Michael G., Liu J., Planetary surface dating from crater size–frequency distribution measurements: interpretation of small-area and low number counts. Icarus 431, 2025.

Sequence probability and simultaneous formation

Michael G., Zhang L., Wu C., Liu J. Planetary surface dating from crater size–frequency distribution measurements: Sequence probability and simultaneous formation. Did the close Chang’E-6 mare units form simultaneously? Icarus 438, 2025.

Full references for specific chronology or other functions are listed with the function definitions in config/functions.txt.

A set of introductory slides to the methods and an earlier version of the software is here, as well an update on this python version. Note that some command syntax has changed since the slides were produced.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

craterstats-3.3.4.tar.gz (459.9 kB view details)

Uploaded Source

Built Distribution

craterstats-3.3.4-py3-none-any.whl (484.3 kB view details)

Uploaded Python 3

File details

Details for the file craterstats-3.3.4.tar.gz.

File metadata

  • Download URL: craterstats-3.3.4.tar.gz
  • Upload date:
  • Size: 459.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for craterstats-3.3.4.tar.gz
Algorithm Hash digest
SHA256 ff42505ca794f5f3ce1af9d1b8f0323c05d7e238ea97b3e648134c1f096645a4
MD5 fb60223d005ac93769352462bc275582
BLAKE2b-256 c194bf1e9568dc4b1ef75b1adcc1cab8b392ee07cc657a47cc89c61d2dc17c64

See more details on using hashes here.

File details

Details for the file craterstats-3.3.4-py3-none-any.whl.

File metadata

  • Download URL: craterstats-3.3.4-py3-none-any.whl
  • Upload date:
  • Size: 484.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for craterstats-3.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c1d665151eed5b6f5bac04912e5f93ca0692481f557fefb6be6ca6c79228eeb1
MD5 9c0b15a815a6c44bbdd01e9ca8ff8e19
BLAKE2b-256 3827b45249d39444de29754bfdfc95a3f375506e0742026894f9cb53b9169a4a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page