Python tools for working with Orbit Ephemeris Messages (OEMs).

Overview

Python Orbit Ephemeris Message tools

Python tools for working with Orbit Ephemeris Messages (OEMs).

Development Status

GitHub Release GitHub

GitHub last commit Pipeline Status Coverage Status Documentation Status

Installation

The oem package is available through pip.

pip install oem

Usage

The OrbitEphemerisMessage class is the primary interface for OEM Files.

from oem import OrbitEphemerisMessage

ephemeris = OrbitEphemerisMessage.open("input_file.oem")

Each OEM is made up of one or more segments of state and optional covariance data. The OrbitEphemerisMessage class provides iterables for both.

for segment in ephemeris:
    for state in segment:
        print(state.epoch, state.position, state.velocity, state.acceleration)

    for covariance in segment.covariances:
        print(covariance.epoch, covariance.matrix)

All vectors and matrices are numpy arrays.

It is also possible to retrieve a complete list of states and covariances through the .states and .covariances properties. These attributes streamline interaction with single-segment ephemerides.

for state in ephemeris.states:
    print(state.epoch, state.position, state.velocity)
for covariance in ephemeris.covariances:
    print(covariance.epoch, covariance.matrix)

To sample a state at an arbitrary epoch, simply call the ephemeris with an astropy Time object

epoch = Time("2020-01-01T00:00:00", scale="utc")
sampled_state = ephemeris(epoch)

Note that this type of sampling is only supported if the time system of the target ephemeris is supported by astropy Time objects. The .steps method of both OrbitEphemerisMessage and EphemerisSegment objects enables iterable, equal-time sampling of ephemeris data. The following example samples an OEM at a 60-second interval.

for state in oem.steps(60)
    pass

The above example works for both single- and multi-segment OEMs, however the step sizes may vary at the boundary of the segments. To get consistent step sizes with multiple segments, use the segment interface directly.

for segment in oem:
    for state in segment.steps(60):
        pass

The OrbitEphemerisMessage facilitates writing of OEMs. To save an already-open OEM, use .save_as:

ephemeris.save_as("output.oem", file_format="xml")

To convert an ephemeris from one type to another, use the .convert class method.

OrbitEphemerisMessage.convert("input_file.oem", "output_file.oem", "kvn")

Reference Standards

This implementation follows the CCSDS recommended standards for Orbit Data Messages.

[1] Orbit Data Messages, CCSDS 502.0-B-2, 2012. Available: https://public.ccsds.org/Pubs/502x0b2c1e2.pdf

[2] XML Specification for Navigation Data Messages, CCSDS 505.0-B-1, 2010. Available: https://public.ccsds.org/Pubs/505x0b2.pdf

Comments
  • Namespaced xml

    Namespaced xml

    I prepared this modification in order to handle the reading of an OEM file in XML format that has a namespace in it. The modification will remove from the tag the namespace, it is transparent for XML files without namespace.

    opened by TommasoPino 6
  • Sample OEMs do not work with oacmpy

    Sample OEMs do not work with oacmpy

    Describe the bug I've originally came across your samples folder in a google search when looking for other example OEM other than the ones provided in ccsds2czml: https://gitlab.com/jorispio/ccsds2czml/-/tree/master/example

    All OEM files in samples/real threw a generic datetime microsecond error, but i could not discern any differences between your OEMs and the sample_OEM generated by ccsds2czml. Their sample_OEM worked fine. Below is the traceback error:

    C:\Users\khoohuibo\Desktop\ccsds2czml-master>python -m oacmpy -i LEO_10s.oem -o one_sat.czml -v
    Input File : LEO_10s.oem
    Output File: one_sat.czml
      File:  LEO_10s.oem
    Traceback (most recent call last):
      File "C:\Users\Hubert Khoo\.conda\envs\arcsim\lib\runpy.py", line 193, in _run_module_as_main
        "__main__", mod_spec)
      File "C:\Users\Hubert Khoo\.conda\envs\arcsim\lib\runpy.py", line 85, in _run_code
        exec(code, run_globals)
      File "C:\Users\Hubert Khoo\.conda\envs\arcsim\lib\site-packages\oacmpy\__main__.py", line 5, in <module>
        main(sys.argv[1:])
      File "C:\Users\Hubert Khoo\.conda\envs\arcsim\lib\site-packages\oacmpy\oem2czml.py", line 78, in main
        _ccsds2czml(inputfile, outputfile, verbose)
      File "C:\Users\Hubert Khoo\.conda\envs\arcsim\lib\site-packages\oacmpy\oem2czml.py", line 35, in _ccsds2czml
        print(" Simulation time span: {} - {}".format(start, end))
      File "C:\Users\Hubert Khoo\.conda\envs\arcsim\lib\site-packages\oacmpy\datetime\Date.py", line 297, in __str__
        return self.strftime(ISO8601_FORMAT_Z)
      File "C:\Users\Hubert Khoo\.conda\envs\arcsim\lib\site-packages\oacmpy\datetime\Date.py", line 291, in strftime
        return self.datetime.strftime(fmt)
      File "C:\Users\Hubert Khoo\.conda\envs\arcsim\lib\site-packages\oacmpy\datetime\Date.py", line 251, in datetime
        self._datetime = datetime(year=year, month=month, day=day, hour=h, minute=m, second=s, microsecond=ms)
    ValueError: microsecond must be in 0..999999
    

    I have attached the sample_object.oem file generated for easier reference sample_object.zip

    Steps to Reproduce

    1. Download both repositories
    2. Run the following code in the root directory of ccsds2czml-master to generate a sample_OEM file
    python -m example.single.simple_oem
    
    1. Generate CZML file using sample_object.oem file generated in root directory of ccsds2czml-master, using the code below
    python -m oacmpy -i sample_object.oem -o one_sat.czml -v
    
    1. Visualize using Cesium Viewer
    2. Attempt to generate CZML file by using OEM file from oem-master/samples/real, (Used LEO_10s and GEO_20s)
    3. Obtain traceback error as described
    # Insert reproducing code snippet here
    

    Python/Package Version Information Python: [e.g. 3.5.1] oem: [e.g. 1.0.0]

    bug 
    opened by khoohuibo 2
  • Importing OEM data message with long trajectory crashes due to unbounded memory usage of Regex

    Importing OEM data message with long trajectory crashes due to unbounded memory usage of Regex

    Describe the bug When importing an OEM file in KVN format with a size of 450 MB which contains about 7 years of trajectory data the regex match statement in _from_kvm_oem() immediately hogs > 16GB RAM and gets killed. Maybe a transition to a slower, but more stable state machine processing line by line as in https://gitlab.com/jorispio/ccsds2czml. Although the parsing algorithm there is also behaving poorly with multiple segments.

    I've tried to use google/re2 python wrappers for a more efficient processing of the file, but still fails. I'll take a look on rewriting the parser.

    Edit: only the match() call seems to create issues, find_all() and running the match for the header section separately works fine.

    bug 
    opened by noc0lour 2
  • Namespaced xml

    Namespaced xml

    I prepared this modification in order to handle the reading of an OEM file in XML format that has a namespace in it. The modification will remove from the tag the namespace, it is transparent for XML files without namespace.

    opened by TommasoPino 1
  • Add realistic ephemeris compare sample

    Add realistic ephemeris compare sample

    This branch implements a test demonstrating compare between two non-identical ephemerides with reference results taken from an independent software package.

    enhancement 
    opened by bradsease 0
  • Add segment comparison tools

    Add segment comparison tools

    Add EphemerisSegment.__sub__ method to support EphemerisSegment comparisons. Subtraction will return a SegmentCompare instance with steps method for sampling the compare segment.

    enhancement 
    opened by bradsease 0
  • Add state comparison tools

    Add state comparison tools

    Add State.__sub__ method to support State comparisons. Subtraction will return a StateCompare instance with range, range_rate, position, and velocity attributes.

    enhancement 
    opened by bradsease 0
  • Update package metadata

    Update package metadata

    This change updates the package setup.py to better communicate the details and dependencies of the package. The requirements.txt file has also been updated to remove an unused dependency.

    documentation 
    opened by bradsease 0
  • Generalize setup.py for local builds

    Generalize setup.py for local builds

    The current setup.py is configured for CI/CD use only and does not properly support local builds. Find a solution that works for both.

    Issue noted in PR #69

    bug 
    opened by bradsease 0
Releases(v0.3.3)
  • v0.3.3(Dec 8, 2021)

  • v0.3.2(Feb 7, 2021)

  • v0.3.1(Oct 15, 2020)

  • v0.3.0(Aug 29, 2020)

    OEM v0.3.0 Release Notes

    Key Changes

    • Implemented interpolation interface for OrbitEphemerisMessage and EphemerisSegment
    • Implemented .steps and .resample methods to facilitate common usage of interpolation
    • Incorporated defusedxml to address XML-related parsing vulnerabilities
    Source code(tar.gz)
    Source code(zip)
  • v0.2.2(Jun 3, 2020)

  • v0.2.1(May 28, 2020)

  • v0.2.0(May 26, 2020)

    OEM v0.2.0 Release Notes

    Key Changes

    • The primary interface for reading OEM files is now OrbitEphemerisMessage.open.

    • Added support for XML OEM files.

    • Added .save_as method to OrbitEphemerisMessage instances to allow writing of OEMs in both KVN and XML formats.

    • Added OrbitEphemerisMessage.convert class method to allow direct conversion of OEM files between KVN and XML formats.

    • States now use astropy Time objects to represent epochs with the correct scale.

    Source code(tar.gz)
    Source code(zip)
  • v0.1.1(May 23, 2020)

    OEM v0.1.1 Release Notes

    Modified constraints applied to ephemeris segments to prevent rejection of valid ephemerides when a state epoch is outside the useable range but within START_TIME and STOP_TIME.

    Source code(tar.gz)
    Source code(zip)
  • v0.1.0(May 21, 2020)

    OEM v0.1.0 Release Notes

    This is the initial release of the OEM package. At this stage, the OEM module supports basic interactions with ASCII OEM files.

    Source code(tar.gz)
    Source code(zip)
  • v0.0.1(May 21, 2020)

Owner
Brad Sease
Brad Sease
Submission from Team OMR for the TRI-NIT Hackathon

Submission from Team OMR for the TRI-NIT Hackathon

0 Feb 01, 2022
Fully cross-platform toolkit (and library!) for MachO+Obj-C editing/analysis

fully cross-platform toolkit (and library!) for MachO+Obj-C editing/analysis. Includes a cli kit, a curses GUI, ObjC header dumping, and much more.

cynder 301 Dec 28, 2022
This is collection of Managementsystem programs: Hospital Management, Student Managemen, etc

Contribute in this repository and help other students with their assignment by adding python scripts for various management system programs.

GDSC BVP DET - Navi Mumbai 3 Mar 20, 2022
Library to generate random strings from regular expressions.

Xeger Library to generate random strings from regular expressions. To install, type: pip install xeger To use, type: from xeger import Xeger

Colm O'Connor 101 Nov 15, 2022
In this project, we'll be creating a virtual personal assistant for ourselves using our favorite programming language

In this project, we'll be creating a virtual personal assistant for ourselves using our favorite programming language, Python. We can perform several offline as well as online operations using the bo

Ashutosh Krishna 188 Jan 03, 2023
Python data loader for Solar Orbiter's (SolO) Energetic Particle Detector (EPD).

Data loader (and downloader) for Solar Orbiter/EPD energetic charged particle sensors EPT, HET, and STEP. Supports level 2 and low latency data provided by ESA's Solar Orbiter Archive.

Jan Gieseler 9 Dec 16, 2022
Data Science Course at Dept. of Computer Engineering, Chula 2022

2110446 Data Science Course at Chula 2022 Short links for exercises: Week1: Intro to Numpy, Pandas Numpy: https://colab.research.google.com/github/kao

Kao Panboonyuen 17 Nov 27, 2022
:fishing_pole_and_fish: List of `pre-commit` hooks to ensure the quality of your `dbt` projects.

pre-commit-dbt List of pre-commit hooks to ensure the quality of your dbt projects. BETA NOTICE: This tool is still BETA and may have some bugs, so pl

Offbi 262 Nov 25, 2022
Python Monopoly Simulator

Monopoly simulator Original creator: Games Computer Play YouTube: https://www.youtube.com/channel/UCTrp88f-QJ1SqKX8o5IDhWQ Config file (optional) conf

Games Computers Play 37 Jan 03, 2023
Developing and Comparing Vision-based Algorithms for Vision-based Agile Flight

DodgeDrone: Vision-based Agile Drone Flight (ICRA 2022 Competition) Would you like to push the boundaries of drone navigation? Then participate in the

Robotics and Perception Group 115 Dec 10, 2022
Holographic Declarative Memory for Python ACT-R

HDM This is the repository for the Holographic Declarative Memory (HDM) module for Python ACT-R. This repository contains: documentation: a paper, con

Carleton Cognitive Modeling Lab 1 Jan 17, 2022
Run Python code right in your Telegram messages

Run Python code right in your Telegram messages Made with Telethon library, TGPy is a tool for evaluating expressions and Telegram API scripts. Instal

29 Nov 22, 2022
:art: Diagram as Code for prototyping cloud system architectures

Diagrams Diagram as Code. Diagrams lets you draw the cloud system architecture in Python code. It was born for prototyping a new system architecture d

MinJae Kwon 27.5k Jan 04, 2023
Kunai Shitty Raider Leaked LMFAO

Kunai-Raider-Leaked Kunai Shitty Raider Leaked LMFA

5 Nov 24, 2021
Nuclei - Burp Extension allows to run nuclei scanner directly from burp and transforms json results into the issues

Nuclei - Burp Extension Simple extension that allows to run nuclei scanner directly from burp and transforms json results into the issues. Installatio

106 Dec 22, 2022
Cairo-math-64x61 - Fixed point 64.61 math library for Cairo / Starknet

Cairo Math 64x61 A fixed point 64.61 math library for Cairo & Starknet Signed 64

Influence 63 Dec 05, 2022
使用京东cookie一键生成所有退会链接

JDMemberCloseLinks 本项目旨在使用京东cookie一键生成所有退会链接

hyzaw 68 Jun 10, 2022
RestMapper takes the pain out of integrating with RESTful APIs.

python-restmapper RestMapper takes the pain out of integrating with RESTful APIs. It removes all of the complexity with writing API-specific code, and

Lionheart Software 8 Oct 31, 2020
Hopefully it'll become a very annoying desktop pet

AnnoyingPet Basic Tutorial: https://seebass22.github.io/python-desktop-pet-tutorial/ Handling Mouse Input: https://pythonhosted.org/pynput/mouse.html

1 Jun 08, 2022
Source-o-grapher is a tool built with the aim to investigate software resilience aspects of Open Source Software (OSS) projects.

Source-o-grapher is a tool built with the aim to investigate software resilience aspects of Open Source Software (OSS) projects.

Aristotle University 5 Jun 28, 2022