GithubHelp home page GithubHelp logo

danielbolan / met-src Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 3.26 MB

Continuous-Domain Constraiment of Lunar Meteorite Source Regions

Home Page: https://dcb.lu/met-src-results

License: MIT License

Python 100.00%

met-src's Introduction

Continuous-Domain Constrainment of Meteorite Source Regions

Code used to produce the results presented at the European Lunar Symposium on June 28, 2023.

If you don't want to run this code, you can download all output files at dcb.lu/met-src-results.

Installation

Instructions are written with Ubuntu 22.04 in mind. If you have instructions for getting this running on other systems, I'd love to include them here.

python3 -m pip install poetry
poetry install

# if you don't already have GDAL installed
sudo apt install gdal-bin libgdal-dev

# poetry can't quite handle installing the GDAL wheel yet, and needs to be installed separately
# https://github.com/python-poetry/poetry/issues/845
# Results as presented were made with GDAL 3.4.1
poetry run python3 -m pip install --global-option=build_ext --global-option="-I/usr/include/gdal" GDAL==`gdal-config --version`
poetry add gdal==`gdal-config --version`

Usage

# All samples from [calzada2015]
poetry run main

# All samples, output shapefiles instead of png
poetry run main --out-format shapefile
poetry run main --out-format shapefile --sample "Dho 287" --zip

# Run on one sample only
poetry run main --sample "Dho 287"

# Run on a different file. Currently handles json and csv files. See below for formats
poetry run main --input my_samples.json
poetry run main --input my_samples.json --sample "Dho 287" --show-title --show-axes --dpi 300

# Run validation on Apollo and Luna samples
poetry run validation

# Print all flags
poetry run main --help

Data Formats

This tool currently can handle JSON and CSV as input, and can output JSON, PNG, and shapefiles.

Input

Examples of valid inputs can be found in met_src/data/samples/.

JSON

JSON needs to be structured as follows:

{
    "My Sample": {
        "coordinate": {
            "lon": -23.42,
            "lat": -3.01
        },
        "composition": {
            "FeO": {
                "mu": 0.1234,
                "sigma": 0.5678
            },
            "TiO2": {
                "mu": 0.02,
                "sigma": 0.07
            },
            ...
        }
    },
    "My Sample 2": {
        "composition": {
    ...

The coordinate field is optional, and only used for validation of known sample locations.

CSV

CSV files need to have headers like this:

name,      lon,    lat,   TiO,   TiO sigma, FeO, FeO sigma,...
My Sample, -23.42, -3.01, 0.123, 0.234,     0.2, 0.4,      ...
MySample2, -11.33, 55.23, 0.321, 0.432,        ,    ,      ...

Again, lon and lat can be omitted and are only used for validation. Field names are case-insensitive. If a sample doesn't have a value for a particular mineral, it's okay to leave it blank, but make sure each row still has the correct number of fields.

Output

JSON

Outputs a GeoJSON file. If a ground truth location is supplied (as in validation sets) it will be added as a slightly non-standard field in the root object.

PNG

Outputs a raster image of the map. There are three additional flags you can use to modify the output of PNGS:

--dpi FLOAT: Change the resolution of the output image. Higher DPI means higher resolution. Default is 250.
--show-title: Add a title to the top of the image, based on the name of the sample.
--show-axes: Show the lat/lon axes along the edges of the map.

Shapefile

Outputs an ESRI Shapefile. Coefficients are stored in the coeff field.

If the --zip flag is supplied, it will make a zip file of the shapefiles as well.

Citations

This work is built on top of Abigail Calzada Díaz's PhD thesis:

@article{calzada2015,
  title={Constraining the source regions of lunar meteorites using orbital geochemical data},
  author={Calzada-Diaz, Abigail and Joy, KH and Crawford, IA and Nordheim, TA},
  journal={Meteoritics \& Planetary Science},
  volume={50},
  number={2},
  pages={214--228},
  year={2015},
  doi={10.1111/maps.12412}
}

The data comes from Lunar Prospector's Gamma Ray Spectrometer (LP-GRS):

@article{prettyman2006,
  title={Elemental composition of the lunar surface: Analysis of gamma ray spectroscopy data from Lunar Prospector},
  author={Prettyman, Thomas H and Hagerty, JJ and Elphic, RC and Feldman, WC and Lawrence, DJ and McKinney, GW and Vaniman, DT},
  journal={Journal of Geophysical Research: Planets},
  volume={111},
  number={E12007},
  year={2006},
  doi={10.17189/1519384}
}

The background image used in png outputs was provided by Solar System Scope under a CC-BY 4.0 license.

met-src's People

Contributors

danielbolan avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.