moonpies

Moon Polar Ice and Ejecta Stratigraphy (MoonPIES) model

https://github.com/cjtu/moonpies

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (18.3%) to scientific vocabulary
Last synced: 6 months ago · JSON representation ·

Repository

Moon Polar Ice and Ejecta Stratigraphy (MoonPIES) model

Basic Info
  • Host: GitHub
  • Owner: cjtu
  • License: mit
  • Language: Jupyter Notebook
  • Default Branch: main
  • Size: 19.6 MB
Statistics
  • Stars: 7
  • Watchers: 4
  • Forks: 3
  • Open Issues: 2
  • Releases: 3
Created over 4 years ago · Last pushed 9 months ago
Metadata Files
Readme License Citation

README.md

Moonpies Documentation DOI Code Style: Black

MoonPIES: Moon Polar Ice and Ejecta Stratigraphy

Welcome to the Moon Polar Ice and Ejecta Stratigraphy (MoonPIES) model.

Please direct bug reports or code feedback to the GitHub issues board or general inquiries to Christian at cjtu@nau.edu.

Motivation

MoonPIES models ice and ejecta at depth below lunar polar cold traps. With the imminent return of humans to the Moon through the NASA Artemis program, models like ours will inform future exploration for water ice and other lunar resources.

Installing MoonPIES

The easiest way to get MoonPIES is with pip:

python pip install moonpies

It is currently tested on Python version 3.8+ for Windows, OS X and Linux.

To install for development, you will require Poetry. Fork this repository and then from the main moonpies folder, install the dev environment with:

python poetry install

The environment can then be activated in the shell with poetry shell (see poetry docs for more info).

Running the model

The MoonPIES model can be run directly from the terminal / command line with the moonpies command. Run moonpies --help for options.

Random seeds

MoonPIES is designed to be reproducable when given the same random seed and input parameters (on a compatible version). By default, MoonPIES will choose a random seed in [1, 99999]. Specify a particular seed with:

bash moonpies 1958

Configuring a run

MoonPIES functionality is easy to tweak by specifying any of its large list of input parameters. A configuration file can be specified as a .py file containing a single Python dictionary. For example, to change the output directory of a run, create a file called myconfig.py containing:

python { 'out_path': '~/Downloads/' }

And supply the config file when running the model:

bash moonpies --cfg myconfig.py

See the documentation for a full list of parameters that can be supplied in a config.py file.

Using MoonPIES in Python code

MoonPIES can be run directly from Python by importing the moonpies module and calling the main() function:

Python import moonpies model_out = moonpies.main()

To specify custom configuration options, create a custom Cfg object provided by config.py and pass it to moonpies.main(). Any parameter in config.Cfg() can be set as an argument like so:

Python import config custom_cfg = config.Cfg(solar_wind_ice=False, out_path='~/Downloads') cannon_model_out = moonpies.main(custom_cfg)

Unspecified arguments will retain their defaults. Consult the full API documentation for a description of all model parameters.

Outputs

MoonPIES outputs are saved by today's date, the run name, and the random seed (e.g. out/yymmdd/run/#####/, where ##### is the 5-digit random seed used. For example, a seed of 1958 will produce:

bash out/ |- yymmdd/ | |- moonpies_version/ | | |- 01958/ | | | |- ej_columns_mpies.csv | | | |- ice_columns_mpies.csv | | | |- config_mpies.py | | | |- strat_Amundsen.csv | | | |- strat_Cabeus B.csv | | | |- strat_Cabeus.csv | | | |- ...

The output directory will contain a config_<run_name>.py file which will reproduce the outputs if supplied as a config file to MoonPIES. Resulting stratigraphy columns for each cold trap are contained within the strat_... CSV files. Two additional CSVs with ejecta and ice columns over time show the raw model output (before outputs are collapsed into stratigraphic sequences).

Note: Runs with the same run name, date and random seed will overwrite one another. When tweaking config parameters, remember to specify a descriptive run_name to ensure a unique output directory.

Note on versioning

As a Monte Carlo model, MoonPIES deals with random variation but is designed to be reproducible such that a particular random seed will produce the same set of random outcomes in the model. MoonPIES uses semantic versioning (e.g. major.minor.patch). Major version changes can include API-breaking changes, minor version changes will not break the API (but may break random seed reproducibility), while patch version change should preserve both the API and random seed reproducibility.

Monte Carlo method

MoonPIES is a Monte Carlo model, meaning outputs can vary significantly from run to run. Therefore, no single MoonPIES result should be thought of as the true stratigraphy of a polar cold trap. Rather, the model should be run many times (with many random seeds) to build statistical confidence in the distribution of ice below polar cold traps.

Running with gnuparallel (Linux/Mac/WSL only)

To quickly process many MoonPIES runs in parallel, one can use GNU parallel which is available from many UNIX package managers, e.g.:

bash apt install parallel # Ubuntu / WSL brew install parallel # MacOS

Note: Not tested on Windows. On MacOS, requires homebrew first (see brew.sh).

Now, many iterations of the model may be run in parallel. To spawn 100 runs:

seq 100 | parallel -P-1 moonpies

This example will start 100 runs of MoonPIES, with random seeds 1-100. To configure your parallel runs:

  • The number of runs is given by the seq N parameter (for help see seq).
  • By default, parallel will use all available cores on your system. Specifying -P-1 instructs GNU parallel to use all cores except one (P-2 would use all cores except 2, etc).

Plotting outputs

Some functions are provided to help visualize model outputs

Coming soon!

Authors

This model was produced by C. J. Tai Udovicic, K. Frizzell, K. Luchsinger, A. Madera, and T. Paladino with input from M. Kopp, M. Meier, R. Patterson, F. Wroblewski, G. Kodikara, and D. Kring.

License and Referencing

This code is made available under the MIT license which allows warranty-free use with proper citation. The model can be cited as:

Tai Udovicic et al. (2022). Moonpies (vX.Y.Z). Zenodo. doi: 10.5281/zenodo.7055800

See CITATION.cff or MoonPIES on zenodo for easy import to any reference manager.

Acknowledgements

This model was produced during the 2021 LPI Exploration Science Summer Intern Program which was supported by funding from the Lunar and Planetary Institute (LPI) and the Center for Lunar Science and Exploration (CLSE) node of the NASA Solar System Exploration Research Virtual Institute (SSERVI).

Owner

  • Name: Christian J. Tai Udovicic
  • Login: cjtu
  • Kind: user
  • Location: Honolulu, HI

Open planetary science, software dev, data science @openplanetary

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!
# You can import this citation directly to Zotero

cff-version: 1.2.0
title: Moonpies
message: >-
  If you use this software, please cite it using the
  metadata from this file.
type: software
authors:
  - given-names: Christian
    family-names: Tai Udovicic
    email: cjtu@nau.edu
    affiliation: Northern Arizona University
    orcid: 'https://orcid.org/0000-0001-9972-1534'
  - given-names: Katelyn R.
    family-names: Frizzell
  - given-names: Kristen M.
    family-names: Luchsinger
  - given-names: Alissa
    family-names: Madera
  - given-names: Tyler G.
    family-names: Paladino
identifiers:
  - type: doi
    value: 10.5281/zenodo.7055800
    description: Moonpies codebase DOI
repository-code: 'https://github.com/cjtu/moonpies/'
abstract: >-
  The Moon Polar Ice and Ejecta Stratigraphy model
  predicts ice and ejecta layers below lunar polar
  cold traps.
license: MIT

GitHub Events

Total
  • Release event: 1
  • Watch event: 1
  • Issue comment event: 1
  • Push event: 4
  • Fork event: 1
  • Create event: 1
Last Year
  • Release event: 1
  • Watch event: 1
  • Issue comment event: 1
  • Push event: 4
  • Fork event: 1
  • Create event: 1

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 113
  • Total Committers: 3
  • Avg Commits per committer: 37.667
  • Development Distribution Score (DDS): 0.027
Top Committers
Name Email Commits
Christian Tai Udovicic c****c@g****m 110
Kristen k****r@g****m 2
frizkat15 7****5@u****m 1

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 4
  • Total pull requests: 2
  • Average time to close issues: 16 days
  • Average time to close pull requests: 1 day
  • Total issue authors: 2
  • Total pull request authors: 2
  • Average comments per issue: 0.75
  • Average comments per pull request: 0.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 0
  • Average comments per issue: 2.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • cjtu (3)
  • jordankando (1)
Pull Request Authors
  • cjtu (1)
  • frizkat15 (1)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 30 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 4
  • Total maintainers: 1
pypi.org: moonpies

Moon Polar Ice and Ejecta Stratigraphy model

  • Versions: 4
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 30 Last month
Rankings
Dependent packages count: 6.6%
Stargazers count: 21.8%
Forks count: 23.2%
Average: 26.4%
Dependent repos count: 30.6%
Downloads: 49.9%
Maintainers (1)
Last synced: 6 months ago

Dependencies

docs/requirements.txt pypi
  • myst-parser ==0.15.2
  • numpydoc ==1.4.0
  • sphinx ==4.5.0
  • sphinx_rtd_theme ==0.5.2
poetry.lock pypi
  • 132 dependencies
pyproject.toml pypi
  • Sphinx ^4.1.2 develop
  • black ^22.3.0 develop
  • jupyter ^1.0.0 develop
  • myst-parser ^0.15.1 develop
  • numpydoc ^1.1.0 develop
  • pandoc ^1.1.0 develop
  • pylint ^2.9.3 develop
  • pytest ^6.2.4 develop
  • seaborn ^0.11.2 develop
  • snakeviz ^2.1.0 develop
  • sphinx-rtd-theme ^0.5.2 develop
  • matplotlib ^3.3
  • numpy ^1.17
  • pandas ^1.0
  • python ^3.8,<3.12
  • scipy ^1.9.1