Skip to content

MagGeo/MagGeo-docs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MagGeo: GPS Trajectory Annotation with Geomagnetic Data

PyPI version DOI License: MIT Python 3.8+

MagGeo is a Python package for fusing GPS trajectories with geomagnetic data from ESA's Swarm satellite constellation. This tool enables researchers to annotate animal movement data with Earth's magnetic field measurements for enhanced migration studies and movement ecology research.

🚀 Key Features

  • GPS Trajectory Annotation: Enrich GPS tracks with geomagnetic field components (N, E, C, H, D, I, F)
  • High Performance: 5.6x faster processing compared to v0.1.0 through optimized algorithms
  • Parallel Processing: Efficient handling of large datasets with automatic chunking
  • Swarm Data Integration: Direct access to ESA Swarm satellite geomagnetic data
  • Geomagnetic Indices: Integration with AE and SME geomagnetic activity indices
  • Command Line Interface: User-friendly CLI for batch processing and automation
  • Comprehensive Documentation: Complete API reference and user guides

Documentation

Installation

Quick Install (Recommended)

pip install maggeo

Development Install

# Clone the repository
git clone https://github.com/MagGeo/MagGeo.git
cd MagGeo

# Install in development mode
pip install -e ".[dev,docs]"

Dependencies

MagGeo requires Python 3.8+ and depends on:

  • numpy, scipy, pandas - Core data processing
  • matplotlib - Visualization capabilities
  • viresclient - Swarm satellite data access
  • chaosmagpy - CHAOS geomagnetic model
  • click - Command-line interface
  • tqdm - Progress bars for long operations

Quick Start

Python API

import pandas as pd
from maggeo.core import annotate_gps_with_geomag

# Load your GPS trajectory data
gps_data = pd.read_csv('your_trajectory.csv')

# Annotate with geomagnetic data
annotated_data = annotate_gps_with_geomag(
    gps_data,
    lat_col='latitude',
    lon_col='longitude', 
    datetime_col='datetime'
)

# Save results
annotated_data.to_csv('trajectory_with_geomag.csv', index=False)

Command Line Interface

# Annotate a GPS trajectory file
maggeo annotate trajectory.csv --output annotated_trajectory.csv

# Download Swarm satellite data
maggeo swarm --start-date 2023-01-01 --end-date 2023-01-31

# Validate GPS file format
maggeo validate trajectory.csv

# Get package information
maggeo info

Advanced Usage with Parallel Processing

from maggeo.parallel_processing import parallel_maggeo_annotation
from maggeo.swarm_data_manager import SwarmDataManager

# For large datasets, use parallel processing
large_dataset = pd.read_csv('large_trajectory.csv')

annotated_data = parallel_maggeo_annotation(
    large_dataset,
    chunk_size=1000,  # Optimize based on your system
    n_jobs=-1         # Use all available cores
)

# Manage Swarm data efficiently
manager = SwarmDataManager()
swarm_data = manager.download_swarm_data(
    start_date='2023-01-01',
    end_date='2023-01-31',
    satellite='A'
)

What's New in v0.2.0

This major refactor introduces significant improvements:

Performance Enhancements

  • 5.6x faster processing for large trajectories
  • Optimized memory usage with efficient data structures
  • Smart chunking for parallel processing

New Features

  • SwarmDataManager: Unified interface for satellite data handling
  • Enhanced CLI: Four comprehensive commands for all workflows
  • Geomagnetic Indices: AE and SME index integration
  • Improved Error Handling: Better validation and user feedback

Developer Experience

  • Modern Package Structure: PyPI-ready with pyproject.toml
  • Comprehensive Documentation: MkDocs Material with API reference
  • Enhanced Testing: Expanded test suite with better coverage
  • Type Hints: Improved code clarity and IDE support

Project Lineage

MagGeo represents the evolution of a research prototype into a robust, production-ready scientific package:

Version 1.0 (2021-2024)

  • Initial Release: Basic functionality for trajectory annotation
  • Community Adoption: Used by movement ecology researchers globally
  • Feature Expansion: Added CHAOS model integration and basic parallel processing

Version 2.0 (2024-2025) - Current

  • Major Refactor: Complete codebase restructuring for performance and usability
  • Production Ready: Professional packaging, documentation, and testing
  • Enhanced Capabilities: 5.6x performance improvement and expanded feature set
  • Open Science: Full PyPI publication for broader scientific community access

Citation

If you use MagGeo in your research, please cite both the original methodology paper and the software:

Primary Citation (Required)

Benitez-Paez, F., Brum-Bastos, V.d., Beggan, C.D. et al. Fusion of wildlife tracking and 
satellite geomagnetic data for the study of animal migration. Mov Ecol 9, 31 (2021). 
https://doi.org/10.1186/s40462-021-00268-4

Software Citation (Recommended)

Benitez-Paez, F., Demšar, U., Long, J. A., & Beggan, C. D. (2025). MagGeo: A Python package 
for fusion of GPS trajectories and satellite geomagnetic data (Version 0.2.0) [Computer software]. 
https://github.com/MagGeo/MagGeo

📋 Complete citation guidelines with multiple formats →

Authors & Contributors

Core Development Team:

  • Fernando Benitez-Paez - Lead Developer - University of St Andrews
  • Urška Demšar - Principal Investigator - University of St Andrews
  • Jed A. Long - Co-Investigator - University of Western Ontario
  • Ciarán D. Beggan - Geomagnetic Expert - British Geological Survey

Contact: [email protected]

Contributing

We welcome contributions from the scientific community! Please see our Contributing Guidelines for details on:

  • 🐛 Bug Reports: Help us improve by reporting issues
  • 💡 Feature Requests: Suggest new capabilities for movement ecology research
  • 🔧 Code Contributions: Submit pull requests for enhancements
  • 📖 Documentation: Improve guides and examples
  • 🧪 Scientific Validation: Share use cases and research applications

License

MagGeo is released under the MIT License, allowing free use for academic and commercial applications with proper attribution.

Acknowledgments

  • ESA Swarm Mission - For providing high-quality geomagnetic satellite data
  • VirES Platform - For accessible Swarm data distribution
  • Movement Ecology Community - For feedback and scientific validation
  • NERC, UKRI - For funding support of the original research

Links

Resource Link
📦 PyPI Package https://pypi.org/project/maggeo/
📖 Documentation https://MagGeo.github.io/MagGeo
🐙 GitHub Repository https://github.com/MagGeo/MagGeo
📄 Original Paper https://doi.org/10.1186/s40462-021-00268-4
🎯 Issue Tracker https://github.com/MagGeo/MagGeo/issues

Contact us

MagGeo is work in progress and we are constantly making improvements that you can follow up with the commits made in the pubic GitHub repo. For general enquiries, scientific concepts, suggestions please email: [email protected], [email protected], [email protected]

For errors, or improvements please submit an issue in this repo, describing the problem you have.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published