bradsease / oem Goto Github PK
View Code? Open in Web Editor NEWPython tools for working with Orbit Ephemeris Messages (OEMs)
License: MIT License
Python tools for working with Orbit Ephemeris Messages (OEMs)
License: MIT License
Per the specification, an OEM may only contain one object, even though each metadata field has its own OBJECT_NAME and OBJECT_ID entry. Constrain these fields to be consistent across all segments.
From section 5.1.3 of the specification:
The OEM shall be a plain text file consisting of orbit data for a single object.
Dates can be represented in two ways in an OEM (spec):
YYYY-MM-DDThh:mm:ss[.dād][Z]
or
YYYY-DDDThh:mm:ss[.dād][Z]
The oem
package currently only supports the first format. Add support for this epoch format.
Describe the bug
Using an existing OEM file the string (header key) "USABLE_START_TIME" was found to be invalid: an error on that string was raised. Apparently all corresponding keys found in the metadata.py module to contain a typo ("USEABLE_...") need to be corrected to "USABLE_..."; a performed test (changing key in metadata.py) was resulting in the code to successfully accept the corrected key.
Steps to Reproduce
# Insert reproducing code snippet here
#
# not needed, please see description of the proposed reproduction steps
#
**Python/Package Version Information**
Python: v3.9.5
oem: v0.3.3
Set up Gitlab testing for multiple versions of Python. Current testing is limited to Python 3.8.
Implement a tool to facilitate OEM generation from a TLE.
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.
Implement an interface to build and write an XML OEM to a file.
This warning appears when interpolating OEMs:
__main__:1: FutureWarning: arrays to stack must be passed as a "sequence" type such as list or tuple. Support for non-sequence iterables such as generators is deprecated as of NumPy 1.16 and will raise an error in the future.
The sources are np.vstack
calls with generators on lines 103 and 122 of oem.interp
.
The OrbitalEphemerisMessage
object should constrain its segments to all use the same TIME_SYSTEM
.
From the OEM specification:
The TIME_SYSTEM value must remain fixed within an OEM.
The oem
module should be capable of parsing both KVN and XML ephemerides.
Describe the bug
In the parse_kvn_oem
method, if the CCSDS_OEM_VERS keyword is missing as the first line, the err
method is called but is missing the line_number
parameter value. This results in a TypeError being thrown.
https://github.com/bradsease/oem/blob/main/oem/parsers.py#L53
PR for fix: #81
Steps to Reproduce
Provide any OEM file that does not have the CCSDS_OEM_VERS
keyword as the first line
Python/Package Version Information
Python: [e.g. 3.5.1] 3.11.6
oem: [e.g. 1.0.0] 0.4.0
Document the use of OrbitEphemerisMessage.save_as
for both KVN and XML formats.
Reference documents have moved.
KVN ephemeris parsing is still fairly inefficient. Streamline the parser to reduce processing time and memory used.
The OrbitalEphemerisMessage
object should provide a method that samples the ephemeris at a particular time.
Add function to compare two OEM objects that use the same frame and central body.
EphemerisSegment
do not currently check if a particular epoch is contained within before calling the interpolator.
Implement a simple interface for accessing segments in an OEM without iterating. The current architecture requires something like:
segments = [entry for entry in ephemeris]
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
Currently all epochs are represented by basic DateTime objects. Instead, epochs should be astropy Time
objects with the correct timescale.
The current implementation assumes version 2.0. Adapt the code to handle 1.0 and possible future versions.
Implement an interface to build and write an ASCII OEM to a file.
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
python -m example.single.simple_oem
python -m oacmpy -i sample_object.oem -o one_sat.czml -v
# Insert reproducing code snippet here
Python/Package Version Information
Python: [e.g. 3.5.1]
oem: [e.g. 1.0.0]
Current implementation uses xml.etree and could be vulnerable to maliciously constructed XML files.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ššš
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ā¤ļø Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.