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
通过简单的卷积神经网络直接预测出验证码图片中滑块的位置

使用说明 1. 在本地测试 运行python3 prdict_one.py即可,默认需要预测的图片路径位于testImg文件夹下的test1.png 运行python3 predict_folder.py预测testImg下的所有图片 2. 部署到服务器 运行python3 run_a_server

12 Mar 08, 2022
Implementation of the MDMC method to search for magnetic ground state using VASP

Implementation of MDMC method ( by Olga Vekilova ) to search for magnetic ground state using VASP

Utkarsh Singh 1 Nov 27, 2021
Um pequeno painel de consulta grátis.

[PAINEL-DE-CONSULTA 3.8(BETA)] · Confira meu canal do YouTube. Clique aqui! Nota: Próxima Atualização será a última com coisas novas, o resto será par

276 Jan 05, 2023
Test for using pyIIIFpres for rara magnetica project

raramagnetica_pyIIIFpres Test for using pyIIIFpres for rara magnetica project. This test show how to use pyIIIFpres for creating mannifest compliant t

Giacomo Marchioro 1 Dec 03, 2021
Python NZ COVID Pass Verifier/Generator

Python NZ COVID Pass Verifier/Generator This is quick proof of concept verifier I coded up in a few hours using various libraries to parse and generat

NZ COVID Pass Community 12 Jan 03, 2023
Simple Python Gemini browser with nice formatting

gg I wasn't satisfied with any of the other available Gemini clients, so I wrote my own. Requires Python 3.9 (maybe older, I haven't checked) and opti

Sarah Taube 2 Nov 21, 2021
A variant caller for the GBA gene using WGS data

Gauchian: WGS-based GBA variant caller Gauchian is a targeted variant caller for the GBA gene based on a whole-genome sequencing (WGS) BAM file. Gauch

Illumina 16 Oct 13, 2022
B-Pkg is a simple tool in python for installing all basic package in termux

Basic-Pkg 👉🏻 Basic-Pkg 👈🏻 B-Pkg is a simple tool in python for installing all basic package in termux This is my first tool, I hope you will like

Macgaiver 3 Oct 21, 2021
Basit bir cc generator'ü.

Basit bir cc generator'ü. Setup What To Do; Python Installation We install python from CLICK Generator Board After installing the file and python, we

Lâving 7 Jan 09, 2022
Always fill your package requirements without the user having to do anything! Simple and easy!

WSL Should now work always-fill-reqs-python3 Always fill your package requirements without the user having to do anything! Simple and easy! Supported

Hashm 7 Jan 19, 2022
DD监控室第一版

DD监控室 运行指南

执明神君 1.2k Dec 31, 2022
Bazel rules to install Python dependencies with Poetry

rules_python_poetry Bazel rules to install Python dependencies from a Poetry project. Works with native Python rules for Bazel. Getting started Add th

Martin Liu 7 Dec 15, 2021
Discover and load entry points from installed packages

Entry points are a way for Python packages to advertise objects with some common interface. The most common examples are console_scripts entry points,

Thomas Kluyver 69 Jul 05, 2022
Safely pass trusted data to untrusted environments and back.

ItsDangerous ... so better sign this Various helpers to pass data to untrusted environments and to get it back safe and sound. Data is cryptographical

The Pallets Projects 2.6k Jan 01, 2023
Graphsignal Logger

Graphsignal Logger Overview Graphsignal is an observability platform for monitoring and troubleshooting production machine learning applications. It h

Graphsignal 143 Dec 05, 2022
Object-oriented programming exercise session held in Petnica.

OOP vežba ⚠️ The code in this repo is used for a OOP practice session held in Petnica. All instructions in the README file are written in Serbian. Ops

Pavle Ćirić 1 Jan 30, 2022
For my Philips Airpurifier AC3259/10

Philips-Airpurifier For my Philips Airpurifier AC3259/10 I will try to keep this code

AcidSleeper 7 Feb 26, 2022
Estimate the Market Size for Electic and Plug-In Hybrid Vehicles In Africa

Estimate the Market Size for Electic and Plug-In Hybrid Vehicles In Africa The goal of this repository is to use open data repositories to answer the

Leonce Nshuti 0 Feb 21, 2022
Python Example Project Structure

Python Example Project Structure Example of statuses that can be in readme: Visit my docs for the full documentation, examples and guides. With this p

1 Oct 31, 2021
A clipboard where a user can add and retrieve multiple items to and from (resp) from the clipboard cache.

A clipboard where a user can add and retrieve multiple items to and from (resp) from the clipboard cache.

Gaurav Bhattacharjee 2 Feb 07, 2022