Skip to main content

GMN Python API

Project description

PyPI Status Python Version License

Read the documentation at https://gmn-python-api.readthedocs.io/ Tests Codecov

pre-commit Black

Python package for accessing open Global Meteor Network (GMN) meteor trajectory data. Global meteor data is generated using a network of low-light cameras pointed towards the night sky. Meteor properties (radiants, orbits, magnitudes and masses) are produced by the GMN and are available through this package.

Demo on Google Colab

Features

  • Listing available daily and monthly csv trajectory summary files from the GMN data directory.

  • Downloading specific daily and monthly csv trajectory summary files from the data directory.

  • Functions for loading the data directory trajectory summary data into Pandas DataFrames or Numpy arrays.

  • Functions for retrieving meteor summary data from the future GMN Data Store using the GMN REST API.

  • Functions for loading REST API meteor summary data into Pandas DataFrames or Numpy arrays.

  • Functions for retrieving the current meteor trajectory schema in AVRO format.

  • Functions for retrieving available IAU registered meteor showers.

Requirements

  • Python 3.7.1+, 3.8, 3.9 or 3.10

Installation

You can install GMN Python API via pip from PyPI:

$ pip install gmn-python-api

Or install the latest development code, through TestPyPI or directly from GitHub via pip:

$ pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple gmn-python-api==<version>
Or
$ pip install git+https://github.com/gmn-data-platform/gmn-python-api

There is also a development Google Colab notebook.

See the Troubleshooting section if you encounter installation issues.

Usage

Simple meteor analysis example:

from datetime import datetime
from gmn_python_api.data_directory import get_daily_file_content_by_date
from gmn_python_api.meteor_summary_reader import read_meteor_summary_csv_as_datafram

trajectory_summary_file_content = get_daily_file_content_by_date(datetime(2019, 7, 24))
trajectory_summary_dataframe = read_meteor_summary_csv_as_dataframe(
    trajectory_summary_file_content,
    csv_data_directory_format=True,
)

print(f"{trajectory_summary_dataframe['Vgeo (km/s)'].max()} km/s "
       "was the fastest geostationary velocity out of all meteors for that day.")
# 65.38499 km/s was the fastest geostationary velocity out of all meteors (24th of July 2019).

print(f"{trajectory_summary_dataframe.loc[trajectory_summary_dataframe['IAU (code)'] == 'PER'].shape[0]} "
       "meteors were estimated to be part of the Perseids shower.")
# 8 meteors were estimated to be part of the Perseids shower (24th of July 2019).

print(f"Station {trajectory_summary_dataframe['Num (stat)'].mode().values[0]} "
       "recorded the highest number of meteors.")
# Station 2 recorded the highest number of meteors (24th of July 2019).

Please see the Usage and API Reference section for more details.

Contributing

Contributions are very welcome. To learn more, see the Contributor Guide.

License

Distributed under the terms of the MIT license, GMN Python API is free and open source software.

Issues

If you encounter any problems, please file an issue along with a detailed description.

Credits

Hypermodern Python Cookiecutter template.

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

gmn-python-api-0.0.5.tar.gz (199.6 kB view hashes)

Uploaded Source

Built Distribution

gmn_python_api-0.0.5-py3-none-any.whl (202.0 kB view hashes)

Uploaded Python 3

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