Skip to main content

Earth to Moon, Moon to Earth — 地月空间转移轨道设计库

Project description

e2m2e — Earth to Moon, Moon to Earth

地月空间转移轨道设计库

License: Apache 2.0

e2m2e 是一个设计地月空间运行轨道转移轨道的Python库。该库使用了面向对象编程,提供了模块化的设计。

安装

从源码安装

# 克隆仓库
git clone https://gitee.com/cislunarspace/e2m2e.git
cd e2m2e

# 安装依赖
python -m pip install -e .

快速开始

import e2m2e
from e2m2e.core.system import CR3BP_System

# 1. 创建地月系统
system = CR3BP_System.from_known_system("earth_moon")
system.set_characteristic_scales(distance=384400, period=27.32 * 86400)
system.compute_libration_points()

# 使用 info() 方法查看系统信息
system.info()

# 2. 获取平动点信息
print(f"L1点位置: {system.L1}")
print(f"L2点位置: {system.L2}")

# 3. 计算Jacobi常数
state = [0.8, 0.1, 0.0, 0.0, 0.2, 0.0]
jacobi_constant = system.get_jacobi_constant(state)
print(f"Jacobi常数: {jacobi_constant:.4f}")

可视化功能

e2m2e 提供了强大的轨道可视化功能:

from e2m2e.visualization.plotting import OrbitVisualizer

# 创建可视化器
viz = OrbitVisualizer(system)

# 绘制2D投影(假设orbit是轨道数据)
viz.plot_2d_projection(orbit, plane='xy', color='blue', label='My Orbit')
viz.plot_primary_bodies()      # 添加天体
viz.plot_libration_points()    # 添加平动点
viz.show()                     # 显示图形

# 创建综合概览图
viz.create_overview_plot(orbit)
viz.show()

更多可视化功能和使用示例,请参考 可视化模块使用指南

开发与贡献

运行测试

# 安装开发依赖
pip install -e ".[dev]"

# 运行测试
pytest tests/

代码规范

本项目使用 Ruff 进行代码格式化:

# 检查代码格式
ruff check .

# 自动修复代码格式
ruff check --fix .

# 格式化代码
ruff format .

提交贡献

  1. Fork 本仓库
  2. 创建功能分支 (git checkout -b feature/amazing-feature)
  3. 提交更改 (git commit -m 'Add some amazing feature')
  4. 推送到分支 (git push origin feature/amazing-feature)
  5. 开启 Pull Request

🙏 致谢

  • 感谢所有三体问题研究者的开创性工作
  • 感谢开源社区提供的优秀工具和库

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

e2m2e-3.1.11.tar.gz (74.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

e2m2e-3.1.11-py3-none-any.whl (83.5 kB view details)

Uploaded Python 3

File details

Details for the file e2m2e-3.1.11.tar.gz.

File metadata

  • Download URL: e2m2e-3.1.11.tar.gz
  • Upload date:
  • Size: 74.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for e2m2e-3.1.11.tar.gz
Algorithm Hash digest
SHA256 f518582bc569fb4642288c9217e3c858be550dcf71f4da6af544a807b34efba6
MD5 e09b7a90246d34e1e32eeca79bcc57c7
BLAKE2b-256 40a9ada3a29ef385498ccecfba43ba0162ed9979bac9eab5d8873f623aeebbc4

See more details on using hashes here.

File details

Details for the file e2m2e-3.1.11-py3-none-any.whl.

File metadata

  • Download URL: e2m2e-3.1.11-py3-none-any.whl
  • Upload date:
  • Size: 83.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for e2m2e-3.1.11-py3-none-any.whl
Algorithm Hash digest
SHA256 f69e9fd979c989eeb4c5aa59c21679768e222c33f0d335f785edefac983b6f2c
MD5 260b21e6143476a453a7dcf931178e12
BLAKE2b-256 219043b552a60fa1fce26609a9c6ce5638bbed961ce146a56eeb06d86cf2c936

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page