Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sample OEMs do not work with oacmpy #39

Closed
khoohuibo opened this issue Nov 1, 2020 · 2 comments
Closed

Sample OEMs do not work with oacmpy #39

khoohuibo opened this issue Nov 1, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@khoohuibo
Copy link

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]

@khoohuibo khoohuibo added the bug Something isn't working label Nov 1, 2020
@bradsease
Copy link
Owner

Interesting. I'm not familiar with oacmpy but I generated those sample ephemerides with STK, so they should be valid.

Just speculating here, but maybe they don't properly support arbitrary precision for fractional seconds? That's the only difference I see between my example and the one you provided.

@khoohuibo
Copy link
Author

I found out that the oacmpy library created their own Date class out of python.datetime, and they didnt have an function of looping a million microseconds back to a second, so that caused an error(aka mircosecond went above 999999).

So this is a problem with their library, not yours. I'm sorry to bother you. The OEM i generated were also from STK so i was very confused when using theirs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants