craterstats


Namecraterstats JSON
Version 3.1.1 PyPI version JSON
download
home_pagehttps://github.com/ggmichael/craterstats
SummaryCraterstats - a tool to analyse and plot crater count data for planetary surface dating
upload_time2025-01-14 03:29:10
maintainerNone
docs_urlNone
authorGreg Michael
requires_python<4,>=3.8
licenseBSD license
keywords craters
VCS
bugtrack_url
requirements colorama cycler kiwisolver matplotlib numpy pandas Pillow pyparsing python-dateutil pytz scipy six
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# 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 through the Python Package Index (PyPi).
The following procedure for installation on Windows, MacOS or Linux is recommended:

1. Install `conda` using the [miniforge installer](https://github.com/conda-forge/miniforge#miniforge3) for your OS. 
1. 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.8
    ```
1. Activate the virtual environment:

   ```
   conda activate craterstats
   ```
1. Install the craterstats package with its dependencies:

   ```
   pip install craterstats
   ```

 
# 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/` of the current folder, 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

Launch the miniforge prompt and activate the virtual environment:
   ```
   conda activate craterstats
   ```
On Windows, you can alternatively create a desktop shortcut with this target: 

```
%windir%\system32\cmd.exe "/K" %homedrive%%homepath%\miniforge3\Scripts\activate.bat craterstats
```

# Upgrade 

If you later need to upgrade to a newer version, use:
   ```
   pip install --upgrade craterstats
   ```


# 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, which should come after the part 1 settings. Following this, the path to the data source is given 
(note that %sample% is a path abbreviation to a craterstats installation directory): 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 -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]

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

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`. Similarly, `-ef standard` or `-ef trask` will obtain equilibrium function 1. 

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 `colour=gr` select green.  

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

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. Only when you wish to introduce a different source file do you need to specify it again. This also applies to other properties where it is useful, including `binning=`, `colour=` and `psym=`.


# Examples

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

    craterstats -cs neukumivanov -ep mars -ef standard -p source=%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 NI2001 -p source=%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=%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=%sample%/Pickering.scc,psym=sq -p type=c-fit,range=[.2,.7],resurf=1,psym=fsq

# Manual
[Complete command option list](docs/manual.md)

# 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. [<i>Standard
techniques for presentation and analysis of crater size–frequency data.</i>](https://doi.org/10.1016/0019-1035%2879%2990009-5) Icarus 37, 1979.

#### Formulation of a planetary surface chronology model

>Neukum G., [<i>Meteorite bombardment and dating of planetary surfaces</i>](http://ntrs.nasa.gov/search.jsp?R=19840027189) (English translation, 1984). [<i>Meteoritenbombardement und Datierung planetarer Oberflächen</i>](http://www.planet.geo.fu-berlin.de/public/Neukum-Thesis%201983.pdf) (German original) Habilitation Thesis, Univ. of Munich, 186pp, 1983.

#### Resurfacing correction for cumulative fits; production function differential forms

>Michael G.G., Neukum G., [<i>Planetary surface dating from crater size-frequency distribution measurements: Partial resurfacing events and statistical age uncertainty.</i>](http://doi.org/10.1016/j.epsl.2009.12.041) Earth and Planetary Science Letters 294, 2010.

#### Differential fitting; binning bias correction; revised Mars epoch boundaries

>Michael G.G., [<i>Planetary surface dating from crater size-frequency distribution measurements: Multiple resurfacing episodes and differential isochron fitting.</i>](http://doi.org/10.1016/j.icarus.2013.07.004) Icarus 2013.

#### Poisson timing analysis; <i>μ</i>-notation

>Michael G.G., Kneissl T., Neesemann A., [<i>Planetary surface dating from crater size-frequency distribution measurements: Poisson timing analysis.</i>](https://doi.org/10.1016/j.icarus.2016.05.019) Icarus, 2016.

#### Poisson calculation for buffered crater count
       
>Michael G.G., Yue Z., Gou S., Di K., [<i>Dating individual several-km lunar impact craters from the rim annulus in region of planned Chang’E-5 landing Poisson age-likelihood calculation.</i>](https://doi.org/10.1016/j.epsl.2021.117031) 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 to the methods and an earlier version of the software is [here](https://github.com/ggmichael/craterstats/tree/main/docs),
as well an update on this python version. Note that some command syntax has changed since the slides were produced.






            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ggmichael/craterstats",
    "name": "craterstats",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4,>=3.8",
    "maintainer_email": null,
    "keywords": "craters",
    "author": "Greg Michael",
    "author_email": "ggmichael@users.noreply.github.com",
    "download_url": "https://files.pythonhosted.org/packages/6c/28/4942b71ec65e880388dae9deffdc66a96c2f2bb2206d369e182cbc21c777/craterstats-3.1.1.tar.gz",
    "platform": null,
    "description": "\r\n# Craterstats\r\n\r\nThis is a reimplementation in Python 3.8 of the CraterstatsII software, a tool to analyse and plot crater count data for planetary surface dating.\r\n\r\n# Installation\r\n\r\nThe `craterstats` package is available through the Python Package Index (PyPi).\r\nThe following procedure for installation on Windows, MacOS or Linux is recommended:\r\n\r\n1. Install `conda` using the [miniforge installer](https://github.com/conda-forge/miniforge#miniforge3) for your OS. \r\n1. Launch the Miniforge prompt (Windows) or any command prompt (MacOS, Linux) and enter the following to create a virtual environment for craterstats:\r\n  \r\n    ```\r\n    conda create -n craterstats python=3.8\r\n    ```\r\n1. Activate the virtual environment:\r\n\r\n   ```\r\n   conda activate craterstats\r\n   ```\r\n1. Install the craterstats package with its dependencies:\r\n\r\n   ```\r\n   pip install craterstats\r\n   ```\r\n\r\n \r\n# Quick demonstration\r\n\r\nAfter 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/` of the current folder, while text output \u2013 including the full command lines as they could be typed to generate the output \u2013 goes to the terminal window.\r\n    \r\n    craterstats -demo\r\n\r\n# Normal start\r\n\r\nLaunch the miniforge prompt and activate the virtual environment:\r\n   ```\r\n   conda activate craterstats\r\n   ```\r\nOn Windows, you can alternatively create a desktop shortcut with this target: \r\n\r\n```\r\n%windir%\\system32\\cmd.exe \"/K\" %homedrive%%homepath%\\miniforge3\\Scripts\\activate.bat craterstats\r\n```\r\n\r\n# Upgrade \r\n\r\nIf you later need to upgrade to a newer version, use:\r\n   ```\r\n   pip install --upgrade craterstats\r\n   ```\r\n\r\n\r\n# Usage\r\n\r\nThe 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.\r\n\r\nThere are two parts to creating a Craterstats plot:\r\n\r\n1. 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\r\n\r\n2. Specify the data to be overplotted, and which chronology model evaluations should be applied to it\r\n\r\nIn the following example, the first items define characteristics for the whole plot: `-cs neukumivanov` specifies the chronology system, *Mars, Neukum-Ivanov (2001)* \r\n(any unambiguous abbreviation is acceptable), and the `-title Example plot` adds the chosen title.\r\n\r\nThe `-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 \r\n(note that %sample% is a path abbreviation to a craterstats installation directory): this will produce a simple data plot with the default binning, colour and plot symbol. After the second `-p`, \r\nan additional overplot is specified: this time, a poisson age evaluation for the diameter range 0.2\u20130.7 km. Note that parameters within an overplot definition are separated by a `,`.  \r\n\r\n    craterstats -cs neukumivanov -p source=%sample%/Pickering.scc -p type=poisson,range=[.2,.7]\r\n\r\nSometimes 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:\r\n\r\n    craterstats -cs neukumivanov -p source=%sample%/Pickering.scc -p type=poisson,range=[b8,b-5]\r\n\r\nA 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. \r\nSupported types are: png, tif, pdf, svg, csv, stat (multiple types can be specified, e.g. `-f png csv`)\r\n\r\nAn 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 \r\nto edit this file to modify the plot, which can then be regenerated with the shorter command:\r\n\r\n    craterstats -i Pickering.cs\r\n\r\nTables of chronology systems, equilibrium functions and epoch systems \u2013 which can be used with the `-cs`, `-ef` and `-ep` options \u2013 may be listed with the following command:\r\n\r\n    craterstats -lcs\r\n\r\nThese items may specifed using any unambiguous abbreviated form, e.g. `-cs ida`. Similarly, `-ef standard` or `-ef trask` will obtain equilibrium function 1. \r\n\r\nTables of plot symbols and colours \u2013 which can be used with the `psym=` and `colour=` options \u2013 may be listed with the following command:\r\n\r\n    craterstats -lpc\r\n\r\nand can likewise be specified by name or abbreviation, e.g. `psym=circle` or `psym=o` select a circle; `colour=green` or `colour=gr` select green.  \r\n\r\nDifferential plots are produced by default. To switch to a different kind, e.g. cumulative, add `-pr cumulative` or `-pr cml` to the part 1 settings. \r\nOther possibilities are: relative (R), Hartmann, chronology, or rate.\r\n\r\nThe complete set of options can be seen with:\r\n\r\n    craterstats --help\r\n\r\nTo 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. Only when you wish to introduce a different source file do you need to specify it again. This also applies to other properties where it is useful, including `binning=`, `colour=` and `psym=`.\r\n\r\n\r\n# Examples\r\n\r\nDifferential plot with Poisson age evaluations, equilibrium function, and epoch system\r\n\r\n    craterstats -cs neukumivanov -ep mars -ef standard -p source=%sample%/Pickering.scc -p type=poisson,range=[2,5],offset_age=[2,-2] -p range=[.2,.7]\r\n\r\nDifferential plot with two differential fit age evaluations\r\n\r\n    craterstats -cs NI2001 -p source=%sample%/Pickering.scc,psym=o -p type=d-fit,range=[.2,.7],isochron=1 -p range=[2,5],colour=red\r\n\r\nDifferential age fits with 10/decade binning\r\n\r\n    craterstats -cs neukumivanov -p source=%sample%/Pickering.scc,psym=o,binning=10/decade -p type=d-fit,range=[.2,.7],isochron=1 -p range=[2,5],colour=red\r\n\r\nCumulative fit with resurfacing correction\r\n\r\n    craterstats -pr cumul -cs neukumivanov -p source=%sample%/Pickering.scc,psym=sq -p type=c-fit,range=[.2,.7],resurf=1,psym=fsq\r\n\r\n# Manual\r\n[Complete command option list](docs/manual.md)\r\n\r\n# References\r\n\r\nExplanations of concepts and calculations used in the software are given in publications below.\r\n\r\n#### Standardisation of crater count data presentation\r\n\r\n>Arvidson, R.E., Boyce, J., Chapman, C., Cintala, M., Fulchignoni, M., Moore, H., Neukum,\r\nG., Schultz, P., Soderblom, L., Strom, R., Woronow, A., Young, R. [<i>Standard\r\ntechniques for presentation and analysis of crater size\u2013frequency data.</i>](https://doi.org/10.1016/0019-1035%2879%2990009-5) Icarus 37, 1979.\r\n\r\n#### Formulation of a planetary surface chronology model\r\n\r\n>Neukum G., [<i>Meteorite bombardment and dating of planetary surfaces</i>](http://ntrs.nasa.gov/search.jsp?R=19840027189) (English translation, 1984). [<i>Meteoritenbombardement und Datierung planetarer Oberfl\u00e4chen</i>](http://www.planet.geo.fu-berlin.de/public/Neukum-Thesis%201983.pdf) (German original) Habilitation Thesis, Univ. of Munich, 186pp, 1983.\r\n\r\n#### Resurfacing correction for cumulative fits; production function differential forms\r\n\r\n>Michael G.G., Neukum G., [<i>Planetary surface dating from crater size-frequency distribution measurements: Partial resurfacing events and statistical age uncertainty.</i>](http://doi.org/10.1016/j.epsl.2009.12.041) Earth and Planetary Science Letters 294, 2010.\r\n\r\n#### Differential fitting; binning bias correction; revised Mars epoch boundaries\r\n\r\n>Michael G.G., [<i>Planetary surface dating from crater size-frequency distribution measurements: Multiple resurfacing episodes and differential isochron fitting.</i>](http://doi.org/10.1016/j.icarus.2013.07.004) Icarus 2013.\r\n\r\n#### Poisson timing analysis; <i>\u03bc</i>-notation\r\n\r\n>Michael G.G., Kneissl T., Neesemann A., [<i>Planetary surface dating from crater size-frequency distribution measurements: Poisson timing analysis.</i>](https://doi.org/10.1016/j.icarus.2016.05.019) Icarus, 2016.\r\n\r\n#### Poisson calculation for buffered crater count\r\n       \r\n>Michael G.G., Yue Z., Gou S., Di K., [<i>Dating individual several-km lunar impact craters from the rim annulus in region of planned Chang\u2019E-5 landing Poisson age-likelihood calculation.</i>](https://doi.org/10.1016/j.epsl.2021.117031) EPSL 568, 2021.\r\n\r\nFull references for specific chronology or other functions are listed with the function definitions in `config/functions.txt`.\r\n\r\nA set of introductory slides to the methods and an earlier version of the software is [here](https://github.com/ggmichael/craterstats/tree/main/docs),\r\nas well an update on this python version. Note that some command syntax has changed since the slides were produced.\r\n\r\n\r\n\r\n\r\n\r\n",
    "bugtrack_url": null,
    "license": "BSD license",
    "summary": "Craterstats - a tool to analyse and plot crater count data for planetary surface dating",
    "version": "3.1.1",
    "project_urls": {
        "Homepage": "https://github.com/ggmichael/craterstats"
    },
    "split_keywords": [
        "craters"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a8288815390daf872e7b45b698bb4e8c846b62ee25a963028493b13707641e91",
                "md5": "ea490c4c9acb13a9f683760d47366e11",
                "sha256": "8851bbbf99847f92779d600994e80656d670626ef117f99e9d7d28f2ea0dccd0"
            },
            "downloads": -1,
            "filename": "craterstats-3.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ea490c4c9acb13a9f683760d47366e11",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4,>=3.8",
            "size": 123972,
            "upload_time": "2025-01-14T03:29:07",
            "upload_time_iso_8601": "2025-01-14T03:29:07.643346Z",
            "url": "https://files.pythonhosted.org/packages/a8/28/8815390daf872e7b45b698bb4e8c846b62ee25a963028493b13707641e91/craterstats-3.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6c284942b71ec65e880388dae9deffdc66a96c2f2bb2206d369e182cbc21c777",
                "md5": "1f65abe2d9ee188ca4329db8c006e536",
                "sha256": "a9a0bf4c1fb40c555ace71acd1a11352cb34c6b77756ceb3ad222171db2666f1"
            },
            "downloads": -1,
            "filename": "craterstats-3.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "1f65abe2d9ee188ca4329db8c006e536",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4,>=3.8",
            "size": 110395,
            "upload_time": "2025-01-14T03:29:10",
            "upload_time_iso_8601": "2025-01-14T03:29:10.037201Z",
            "url": "https://files.pythonhosted.org/packages/6c/28/4942b71ec65e880388dae9deffdc66a96c2f2bb2206d369e182cbc21c777/craterstats-3.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-14 03:29:10",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ggmichael",
    "github_project": "craterstats",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "colorama",
            "specs": []
        },
        {
            "name": "cycler",
            "specs": []
        },
        {
            "name": "kiwisolver",
            "specs": []
        },
        {
            "name": "matplotlib",
            "specs": []
        },
        {
            "name": "numpy",
            "specs": []
        },
        {
            "name": "pandas",
            "specs": []
        },
        {
            "name": "Pillow",
            "specs": []
        },
        {
            "name": "pyparsing",
            "specs": []
        },
        {
            "name": "python-dateutil",
            "specs": []
        },
        {
            "name": "pytz",
            "specs": []
        },
        {
            "name": "scipy",
            "specs": []
        },
        {
            "name": "six",
            "specs": []
        }
    ],
    "lcname": "craterstats"
}
        
Elapsed time: 8.18554s