Skip to main content

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

Project description

Craterstats

This is a reimplementation in Python 3.8 of the CraterstatsII software, a tool to analyse and plot crater count data for planetary surface dating.

Installation

The craterstats package is available on pypi. The recommended installation entails setting up a virtual environment. We recommend using conda, because it serves a lot of scientific and data analysis use cases and runs well on all 3 major operating systems, but other virtual env managers may be used as well.

  1. Install conda via the miniforge installer (or use your preferred virtual env provider.)

  2. create a virtual environment for craterstats, with conda, e.g.:

    conda create -n craterstats python=3.8
    
  3. activate the virtual environment, with conda, e.g.:

    conda activate craterstats
    
  4. then execute the pip install:

    pip install craterstats
    

This will install also all required dependencies from the pypi server.

Advanced users

For advanced users, if you intend to add the craterstats package to your existing conda environment, we recommend to install first the requirements with conda and finish with the pip install.

Quick demonstration

After installation, the following command will produce a series of example output plots and data, demonstrating the main features of the software. Plot image files are placed into the subfolder demo/, while text output – including the full command lines as they could be typed to generate the output – goes to the terminal window.

craterstats -demo

Normal start

Open a command prompt/terminal window and run the activate script:

Windows:

c:\craterstats\Scripts\activate

Alternatively, copy windows_shortcut/craterstats.lnk to the Windows desktop to create a startup icon.

Linux:

source ~/.craterstats/bin/activate

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 of 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 chronology system 4, Mars, Neukum-Ivanov (2001) , and the -title Example plot adds the chosen title.

The -p indicates the start of an overplot definition, which should come after the part 1 settings. 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. 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 -title Example plot -p source=craterstats/sample/Pickering.scc -p type=poisson,range=[.2,.7]

By default, an output file is created in the current folder with the name out.png. The output path or name can be set with the -o option. Different file types can be produced by giving the appropriate extension or with the -f option. Supported types are: png, jpg, tif, pdf, svg, txt.

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 by their index number, e.g. -cs 4, or using any unambiguous abbreviated form, e.g. -cs ida. Similarly, -ef standard or -ef trask is equivalent to -ef 1

Numbered 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 index or abbreviation, e.g. psym=1, psym=circle or psym=o all select a circle; colour=2, colour=green or colour=gr select green.

Differential plots are produced by default. To switch to a different kind, e.g. cumulative, add -pr 1 or -pr cum to the part 1 settings. Other possibilities are: 3 - relative (R), 4 - Hartmann, 5 - chronology, 6 - rate.

The complete set of options can be seen with:

craterstats --help

Examples

Differential plot with Poisson age evaluations, equilibrium function, and epoch system

craterstats -cs neukumivanov -ep mars -ef standard -p source=src/craterstats/sample/Pickering.scc -p type=poisson,range=[2,5],offset_age=[2,-2] -p range=[.2,.7]

Differential plot with two differential fit age evaluations

craterstats -cs neukumivanov -p source=src/craterstats/sample/Pickering.scc,psym=o -p type=d-fit,range=[.2,.7],isochron=1 -p range=[2,5],colour=red

Differential age fits with 10/decade binning

craterstats -cs neukumivanov -p source=src/craterstats/sample/Pickering.scc,psym=o,binning=10/decade -p type=d-fit,range=[.2,.7],isochron=1 -p range=[2,5],colour=red

Cumulative fit with resurfacing correction

craterstats -pr cumul -cs neukumivanov -p source=src/craterstats/sample/Pickering.scc,psym=sq -p type=c-fit,range=[.2,.7],resurf=1,psym=fsq

Additional information

The useable chronology systems, equilibrium functions and epoch systems are defined in the text file config/functions.txt. User functions may be added here, following the same format.

There is a text file config/default.plt which contains all the default plot settings. This may be modified to suit the choices you use most often.

To simplify the construction of the command line, certain plot properties are 'sticky'. If, for example, you specify source=craterstats/sample/Pickering.scc in the first overplot, this becomes the default for subsequent overplots. Only if you wish to introduce a different source file do you need to specify it again. This applies to other properties where it is useful, including binning=, colour= and psym=.

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.

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

A set of introductory slides from a previous workshop is available here: https://pdsimage2.wr.usgs.gov/pub/pigpen/tutorials/FreieUni_Workshop2012/

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.0.20.tar.gz (101.9 kB view details)

Uploaded Source

Built Distribution

craterstats-3.0.20-py3-none-any.whl (115.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: craterstats-3.0.20.tar.gz
  • Upload date:
  • Size: 101.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.17

File hashes

Hashes for craterstats-3.0.20.tar.gz
Algorithm Hash digest
SHA256 edd61ece5aff43b888d5be717360a3cb093e8ba6ceddbb6539184014001c01f5
MD5 8a404b99e7a7c742c2a0a145e0d3a9cd
BLAKE2b-256 d4a2e79fc4a3808da04acaa15fd87177bf5c71b25b26ac3164d74438107bff59

See more details on using hashes here.

File details

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

File metadata

  • Download URL: craterstats-3.0.20-py3-none-any.whl
  • Upload date:
  • Size: 115.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.17

File hashes

Hashes for craterstats-3.0.20-py3-none-any.whl
Algorithm Hash digest
SHA256 f40eaf6c2d6238876bca1404bea933bff61084488282f480e889e6bd3e9ff1fb
MD5 e0a2a2ae1c8e1faddde0554490c3755f
BLAKE2b-256 8a5e808776e8fcbbc947c56a0a6cfbd49532fd082fe5e028e6b07eef4bd94515

See more details on using hashes here.

Supported by

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