Package: craterstats
CraterstatsThis is a reimplementation in Python 3.8 of the CraterstatsII software, a tool to analyse and plot crater count data for planetary surface dating.InstallationThecraterstatspackage is available through the Python Package Index (PyPi).
We recommend the following procedure for installation on Windows, MacOS or Linux:Installcondavia theminiforge installerfor your OS.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.8Activate the virtual environment:conda activate craterstatsInstall the craterstats package with its dependencies:pip install craterstatsAdvanced usersIf you intend to add thecraterstatspackage to your existing conda environment, we recommend
first installing the requirements with conda and then finishing with the pip install.Quick demonstrationAfter 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 subfolderdemo/, while text output – including the full command lines as they could be typed to generate the output – goes to the terminal window.craterstats -demoNormal startLaunch the miniforge prompt and activate the virtual environment:conda activate craterstatsUpgradeIf you later need to upgrade to a newer version, use:pip install --upgrade craterstatsUsageThe 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: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 rangesSpecify the data to be overplotted, and which chronology model evaluations should be applied to itIn the following example, the first items define characteristics for the whole plot:-cs neukumivanovspecifies chronology system 4,Mars, Neukum-Ivanov (2001), and the-title Example plotadds the chosen title.The-pindicates 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 nameout.png. The output path or name can be set with the-ooption.  Different file types can be produced by giving the appropriate extension or with the-foption. 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,-efand-epoptions – may be listed with the following command:craterstats -lcsThese items may specifed by their index number, e.g.-cs 4, or using any unambiguous abbreviated form, e.g.-cs ida. Similarly,-ef standardor-ef traskis equivalent to-ef 1Numbered tables of plot symbols and colours – which can be used with thepsym=andcolour=options – may be listed with the following command:craterstats -lpcand can likewise be specified by index or abbreviation, e.g.psym=1,psym=circleorpsym=oall select a circle;colour=2,colour=greenorcolour=grselect green.Differential plots are produced by default. To switch to a different kind, e.g. cumulative, add-pr 1or-pr cumto 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 --helpExamplesDifferential plot with Poisson age evaluations, equilibrium function, and epoch systemcraterstats -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 evaluationscraterstats -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=redDifferential age fits with 10/decade binningcraterstats -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=redCumulative fit with resurfacing correctioncraterstats -pr cumul -cs neukumivanov -p source=src/craterstats/sample/Pickering.scc,psym=sq -p type=c-fit,range=[.2,.7],resurf=1,psym=fsqAdditional informationThe useable chronology systems, equilibrium functions and epoch systems are defined in the text fileconfig/functions.txt. User functions may be added here, following the same format.There is a text fileconfig/default.pltwhich 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 specifysource=craterstats/sample/Pickering.sccin 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, includingbinning=,colour=andpsym=.ReferencesExplanations of concepts and calculations used in the software are given in publications below.Standardisation of crater count data presentationArvidson, 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 modelNeukum 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 formsMichael 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 boundariesMichael G.G.,Planetary surface dating from crater size-frequency distribution measurements: Multiple resurfacing episodes and differential isochron fitting.Icarus 2013.Poisson timing analysis;μ-notationMichael 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 countMichael 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 inconfig/functions.txt.A set of introductory slides from a previous workshop is available here:https://pdsimage2.wr.usgs.gov/pub/pigpen/tutorials/FreieUni_Workshop2012/