Coder Social home page Coder Social logo

ut-astria / orbdetpy Goto Github PK

View Code? Open in Web Editor NEW
109.0 13.0 37.0 114.72 MB

Orbit Determination with Python

Home Page: https://ut-astria.github.io/orbdetpy

License: GNU General Public License v3.0

Java 66.63% Python 32.42% Shell 0.69% Dockerfile 0.25%
orbit-determination orbital-mechanics celestial-mechanics astrodynamics kalman-filter kalman-estimator estimation satellite-tracking satellite-prediction orekit

orbdetpy's Introduction

orbdetpy is a Python orbit determination library.

Features

Dynamics in orbdetpy can be configured with:

  1. EGM96 gravity field up to degree and order 360.
  2. Earth solid tides due to the influence of the Sun and Moon.
  3. FES 2004 ocean tide model up to degree and order 100.
  4. NRL MSISE-00 and exponential atmospheric drag models.
  5. Solar radiation pressure.
  6. Third body perturbations from the Sun and Moon.
  7. Satellite box-wing models and maneuvers.

Range, range-rate, angles, and inertial state measurements are supported. Filtering can be done with an EKF, UKF, or Batch Least Squares. Dynamic Model Compensation (DMC) can be used to estimate unmodeled accelerations.

Installation

If you have docker installed and wish to use a pre-built environment refer to the Docker section in this README.

  1. Install Java SE 11 (11.0.10) from https://www.oracle.com/javadownload. Set the JAVA_HOME environment variable to the Java installation folder. The java executable must be added to the system path.

  2. Install Python 3.8.0 or higher and run pip install orbdetpy to install orbdetpy and other package dependencies.

  3. Update astrodynamics data under orbdetpy/orekit-data periodically by running the following. You will need root privileges on some systems.

    python -c "from orbdetpy.astro_data import update_data; update_data();"

    You can instead provide a fully qualified path in the ORBDETPY_DATA_DIR environment variable to use a different folder for data files and to avoid issues with folder write permissions.

Development

  1. Download and extract https://github.com/ut-astria/orbdetpy/releases/download/2.1.0/orekit-data.tar.gz under the orbdetpy/ sub-folder.

  2. Developers will need Apache Maven 3+ to build the Java library. Build using the following from the orbdetpy/ sub-folder, where os_cpu_type is linux-x86_64, linux-x86_32, windows-x86_64, windows-x86_32, osx-x86_64, or osx-x86_32 depending on your CPU and OS:

    mvn -e -Dos.detected.classifier=os_cpu_type package

    The command-line is simpler on Intel/AMD 64-bit Linux:

    mvn -e package

  3. Run pip install -e ./ from the top-level folder containing setup.py.

Docker

  1. Build the docker image on a machine that has docker installed. Go to the root folder of this repository where the Dockerfile is and run, docker build --build-arg ORBDETPY_VERSION=2.1.0 -t orbdetpy:2.1.0 .

  2. Run the orbdetpy:2.1.0 image in a daemon state: docker run -it --rm orbdetpy:2.1.0 bash

  3. Activate the python environment and run a test to determine a successful docker image build:

cd && . env_orbdetpy/bin/activate && python orbdetpy/examples/test_estimation.py
  1. From here, you can either develop in orbdetpy or script and test in this pre-built environment.

Examples

  1. fit_radec.py : Run OD with real angles measurements. Also demonstrates the Laplace IOD method for estimating an initial state vector.

  2. interpolate_oem.py : Command-line tool for interpolating state vectors from CCSDS OEM ephemeris files. OEM files are available for download at http://astria.tacc.utexas.edu/AstriaGraph.

  3. predict_passes.py : Predict satellite passes for ground stations or geographic regions using TLEs. Current elements may be obtained from sites such as http://www.celestrak.com.

  4. propagate_tle.py : Propagate TLEs given by command-line arguments.

  5. test_conversion.py : Test reference frame and other conversion functions.

  6. test_estimation.py : Demonstrates measurement simulation and orbit determination functions.

  7. test_interpolation.py : Interpolate state vectors.

Known Issues

  1. Give orbdetpy network access permissions if you get warnings from the Microsoft Windows Firewall.

  2. If you use orbdetpy with Python's multiprocessing package, call the function multiprocessing.set_start_method("spawn") before other multiprocessing calls.

orbdetpy's People

Contributors

apoorvatejaswik avatar engineero avatar shiva-iyer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

orbdetpy's Issues

Make method for orbit determination more user-friendly

Currently there is an example of doing orbit determination in the examples folder (testodet.py) showing how this is done with the current setup. Basically the method provided by the package takes config file and data file contents as a string and passes that data to Java classes. This is kind of an awkward implementation from a Python standpoint. I suggest modifying the API to accept config/data/output file paths and then handling the file loading and passing to Java all in one place. It will make calls to the method simpler and more transparent to the user.

I also recommend making the output file path optional so that the user can choose whether to write the output to a file or just used the returned result in a script.

Finally, return the dictionary representation of the result, not the raw JSON string. Easy enough with json.loads(result). Calls will look something like:

from orbdetpy import do_orbdet

results = do_orbdet(config_path, data_path, output_path=output_path)
# results is a Python dictionary

with appropriately defined config_path, etc.

I suggest we merge my pull request #3 first and then make this a new major release on top of that since it will change the way the API calls are done (passing file paths instead of contents).

org.astria:orbdetpy-server:jar:2.0.7

Hello,
I am attempting to build the project and I am getting error messages related to this jar. org.astria:orbdetpy-server:jar:2.0.7
I'm looking on the maven repository and I cannot find it. I get this far but then find no astria.

https://repo.maven.apache.org/maven2/org/

If the artifacts location has moved or there is a way to obtain a copy of it to do a manual install it would be appreciated. I see where to modify the code to point it at the correct location.
Thank you error listed below:

INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.718 s
[INFO] Finished at: 2021-11-04T11:09:10-06:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.xolstice.maven.plugins:protobuf-maven-plugin:0.6.1:compile (default) on project orbdetpy-server: Unable to resolve artifact: Missing:
[ERROR] ----------
[ERROR] 1) com.google.protobuf:protoc:exe:os_cpu_type:3.11.4
[ERROR]
[ERROR] Try downloading the file manually from the project website.
[ERROR]
[ERROR] Then, install it using the command:
[ERROR] mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=3.11.4 -Dclassifier=os_cpu_type -Dpackaging=exe -Dfile=/path/to/file
[ERROR]
[ERROR] Alternatively, if you host your own repository you can deploy the file there:
[ERROR] mvn deploy:deploy-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=3.11.4 -Dclassifier=os_cpu_type -Dpackaging=exe -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
[ERROR]
[ERROR] Path to dependency:
[ERROR] 1) org.astria:orbdetpy-server:jar:2.0.7
[ERROR] 2) com.google.protobuf:protoc:exe:os_cpu_type:3.11.4
[ERROR]
[ERROR] ----------
[ERROR] 1 required artifact is missing.
[ERROR]
[ERROR] for artifact:
[ERROR] org.astria:orbdetpy-server:jar:2.0.7
[ERROR]
[ERROR] from the specified remote repositories:
[ERROR] unidata-all (https://artifacts.unidata.ucar.edu/repository/unidata-all/, releases=true, snapshots=true),
[ERROR] central (https://repo.maven.apache.org/maven2, releases=true, snapshots=false)
[ERROR]
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.xolstice.maven.plugins:protobuf-maven-plugin:0.6.1:compile (default) on project orbdetpy-server: Unable to resolve artifact: Missing:

  1. com.google.protobuf:protoc:exe:os_cpu_type:3.11.4

Try downloading the file manually from the project website.

Then, install it using the command:
mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=3.11.4 -Dclassifier=os_cpu_type -Dpackaging=exe -Dfile=/path/to/file

Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=3.11.4 -Dclassifier=os_cpu_type -Dpackaging=exe -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

Path to dependency:
1) org.astria:orbdetpy-server:jar:2.0.7
2) com.google.protobuf:protoc:exe:os_cpu_type:3.11.4


1 required artifact is missing.

for artifact:
org.astria:orbdetpy-server:jar:2.0.7

from the specified remote repositories:
unidata-all (https://artifacts.unidata.ucar.edu/repository/unidata-all/, releases=true, snapshots=true),
central (https://repo.maven.apache.org/maven2, releases=true, snapshots=false)

at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)

Caused by: org.apache.maven.plugin.MojoExecutionException: Unable to resolve artifact: Missing:

  1. com.google.protobuf:protoc:exe:os_cpu_type:3.11.4

Try downloading the file manually from the project website.

Then, install it using the command:
mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=3.11.4 -Dclassifier=os_cpu_type -Dpackaging=exe -Dfile=/path/to/file

Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=3.11.4 -Dclassifier=os_cpu_type -Dpackaging=exe -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

Path to dependency:
1) org.astria:orbdetpy-server:jar:2.0.7
2) com.google.protobuf:protoc:exe:os_cpu_type:3.11.4


1 required artifact is missing.

for artifact:
org.astria:orbdetpy-server:jar:2.0.7

from the specified remote repositories:
unidata-all (https://artifacts.unidata.ucar.edu/repository/unidata-all/, releases=true, snapshots=true),
central (https://repo.maven.apache.org/maven2, releases=true, snapshots=false)

at org.xolstice.maven.plugin.protobuf.AbstractProtocMojo.execute (AbstractProtocMojo.java:589)
at org.xolstice.maven.plugin.protobuf.AbstractProtocCompileMojo.execute (AbstractProtocCompileMojo.java:32)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)

Caused by: org.xolstice.maven.plugin.protobuf.MojoInitializationException: Unable to resolve artifact: Missing:

  1. com.google.protobuf:protoc:exe:os_cpu_type:3.11.4

Try downloading the file manually from the project website.

Then, install it using the command:
mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=3.11.4 -Dclassifier=os_cpu_type -Dpackaging=exe -Dfile=/path/to/file

Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=3.11.4 -Dclassifier=os_cpu_type -Dpackaging=exe -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

Path to dependency:
1) org.astria:orbdetpy-server:jar:2.0.7
2) com.google.protobuf:protoc:exe:os_cpu_type:3.11.4


1 required artifact is missing.

for artifact:
org.astria:orbdetpy-server:jar:2.0.7

from the specified remote repositories:
unidata-all (https://artifacts.unidata.ucar.edu/repository/unidata-all/, releases=true, snapshots=true),
central (https://repo.maven.apache.org/maven2, releases=true, snapshots=false)

at org.xolstice.maven.plugin.protobuf.AbstractProtocMojo.resolveBinaryArtifact (AbstractProtocMojo.java:1071)
at org.xolstice.maven.plugin.protobuf.AbstractProtocMojo.execute (AbstractProtocMojo.java:529)
at org.xolstice.maven.plugin.protobuf.AbstractProtocCompileMojo.execute (AbstractProtocCompileMojo.java:32)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)

Caused by: org.apache.maven.artifact.resolver.MultipleArtifactsNotFoundException: Missing:

  1. com.google.protobuf:protoc:exe:os_cpu_type:3.11.4

Try downloading the file manually from the project website.

Then, install it using the command:
mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=3.11.4 -Dclassifier=os_cpu_type -Dpackaging=exe -Dfile=/path/to/file

Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=3.11.4 -Dclassifier=os_cpu_type -Dpackaging=exe -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

Path to dependency:
1) org.astria:orbdetpy-server:jar:2.0.7
2) com.google.protobuf:protoc:exe:os_cpu_type:3.11.4


1 required artifact is missing.

for artifact:
org.astria:orbdetpy-server:jar:2.0.7

from the specified remote repositories:
unidata-all (https://artifacts.unidata.ucar.edu/repository/unidata-all/, releases=true, snapshots=true),
central (https://repo.maven.apache.org/maven2, releases=true, snapshots=false)

at org.apache.maven.artifact.resolver.DefaultResolutionErrorHandler.throwErrors (DefaultResolutionErrorHandler.java:73)
at org.xolstice.maven.plugin.protobuf.AbstractProtocMojo.resolveBinaryArtifact (AbstractProtocMojo.java:1069)
at org.xolstice.maven.plugin.protobuf.AbstractProtocMojo.execute (AbstractProtocMojo.java:529)
at org.xolstice.maven.plugin.protobuf.AbstractProtocCompileMojo.execute (AbstractProtocCompileMojo.java:32)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)

[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Allow configuring data file paths

We are trying to run Orbdetpy in an environment that does not allow us to write data to the library file path. Would it be possible to make the data directories configurable via environment variables?

if (__name__ != "__main__"):
    _root_dir = path.dirname(path.abspath(path.realpath(__file__)))
    _libs_dir = path.join(_root_dir, "target")
    _jar_file = path.join(_libs_dir, "orbdetpy-server-{}.jar".format(__version__))
    _data_dir = path.join(_root_dir, "orekit-data")

Possible bugs in MSISEInputs

I think there's a couple of bugs in the MSISEInputs java class.

  • Lines 86 and 96 should contain integer division by 3, not modulo 3 (i.e. just Integer.parseInt(p.substring(11, 13)) / 3)
  • Line 95 adds to apvals[i] without initialising it. It should be set to zero before the loop starting at line 90.

Propagation between measurement steps in Sequential Filter

In the interest of generating an ephemeris from solution state results, it would be nice to have propagation between the measurement steps reported out into the OD output. Or perhaps a method to generate an ephemeris from the results of a run.

While on the topic, it would also be nice to have a backwards-running smoothing function for said filter output. Filtered ephems are often jagged and unrealistic in their steps.

Thanks!

maia.usno.navy.mil gone?

When running

python -c "from orbdetpy.astro_data import update_data; update_data();"

I get

HTTPConnectionPool(host='maia.usno.navy.mil', port=80): Max retries exceeded with url: /ser7/tai-utc.dat (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fe02c06e6a0>: Failed to establish a new connection: [Errno -2] Name or service not known'))

Add ability to pip install orbdetpy

I have a fork that's working on this (see my email, dev contact listed in the readme!). Just putting an issue on the tracker so that we can track where we are and have a place to host our discussion of any problems that crop up.

testsim.py TypeError: unexpected keyword argument

After successfully pip installing orbdetpy and its dependencies, running the example sim data generation command:

python ../testsim.py radar_sim_cfg.json sim_data.json throws the following error:

TypeError: simulateMeasurements() got an unexpected keyword argument 'output_file'

"java.lang.IllegalArgumentException: Illegal Capacity: -2147483647

Whenever I call simulate_measurements() function with a config as a dict, I get the following error message from the java server:

In [31]: print(si.simulate_measurements(config, output_file="output.json"))                                                                                                                                        
Traceback (most recent call last):
  File "/home/henry/SATELLOGIC_REPOS/AOCS/gps/orbitfit/venv/lib/python3.7/site-packages/orbdetpy/simulation.py", line 51, in simulate_measurements
    sim_data = convert_measurements(req.result().array)
  File "/home/henry/SATELLOGIC_REPOS/AOCS/gps/orbitfit/venv/lib/python3.7/site-packages/grpc/_channel.py", line 625, in result
    raise self
grpc._channel._MultiThreadedRendezvous: <_MultiThreadedRendezvous of RPC that terminated with:
        status = StatusCode.INTERNAL
        details = "java.lang.IllegalArgumentException: Illegal Capacity: -2147483647
        at java.util.ArrayList.<init>(ArrayList.java:157)
        at org.astria.Simulation.simulateMeasurements(Simulation.java:93)
        at org.astria.rpc.SimulationService.simulateMeasurements(SimulationService.java:36)
        at org.astria.rpc.SimulationGrpc$MethodHandlers.invoke(SimulationGrpc.java:217)
        at io.grpc.stub.ServerCalls$UnaryServerCallHandler$UnaryServerCallListener.onHalfClose(ServerCalls.java:172)
        at io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.halfClosed(ServerCallImpl.java:331)
        at io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1HalfClosed.runInContext(ServerImpl.java:817)
        at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
        at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
"
        debug_error_string = "{"created":"@1589680671.517410712","description":"Error received from peer ipv4:127.0.0.1:50051","file":"src/core/lib/surface/call.cc","file_line":1056,"grpc_message":"java.lang.IllegalArgumentException: Illegal Capacity: -2147483647\n\tat java.util.ArrayList.<init>(ArrayList.java:157)\n\tat org.astria.Simulation.simulateMeasurements(Simulation.java:93)\n\tat org.astria.rpc.SimulationService.simulateMeasurements(SimulationService.java:36)\n\tat org.astria.rpc.SimulationGrpc$MethodHandlers.invoke(SimulationGrpc.java:217)\n\tat io.grpc.stub.ServerCalls$UnaryServerCallHandler$UnaryServerCallListener.onHalfClose(ServerCalls.java:172)\n\tat io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.halfClosed(ServerCallImpl.java:331)\n\tat io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1HalfClosed.runInContext(ServerImpl.java:817)\n\tat io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)\n\tat io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\n","grpc_status":13}"
>

I get this error even when I use the config files in example/data directory.

This does not happens when config is a file path.
I'm working from a virtualenv with python 3.7.2, from a debian9 machine with the following java version:

$ java -version
openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-8u252-b09-1~deb9u1-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)

JSON Decode Error being raised testing orbdetpy

I have orbdetpy installed on a Mac Pro (2019) running Mac OS X ver. 10.15.3 (Catalina) under the Anaconda distribution (Python 3.7.6). In running the example posted on https://github.com/ut-astria/orbdetpy, and as listed below.

(base) user@Samuels-Mac-Pro examples % python run_tests.py
run_tests start : 2020-03-05 00:21:11
Simulating azel_sim_cfg.json
Simulating radec_sim_cfg.json
Simulating tle_sim_cfg.json
Simulating radar_sim_cfg.json
Simulating radec_sim_cfg.json
Simulating plate_sim_cfg.json
Fitting radec_od_cfg.json
Fitting radar_od_cfg.json
Fitting tle_od_cfg.json
Fitting azel_od_cfg.json
Fitting radec_od_cfg.json
Fitting plate_od_cfg.json
Fitting posvel_od_cfg.json
run_tests end : 2020-03-05 00:21:59

(base) user@Samuels-Mac-Pro examples % python
Python 3.7.6 (default, Jan 8 2020, 13:42:34)
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.

from orbdetpy.simulation import simulate_measurements
simulate_measurements("radar_sim_cfg.json", output_file = "sim_data.json")
Traceback (most recent call last):
File "", line 1, in
File "/Users/user/opt/anaconda3/lib/python3.7/site-packages/orbdetpy/simulation.py", line 62, in simulate_measurements
resp = stub.simulateMeasurements.future(build_settings(config))
File "/Users/user/opt/anaconda3/lib/python3.7/site-packages/orbdetpy/rpc/tools.py", line 102, in build_settings
inp = read_param(param)
File "/Users/user/opt/anaconda3/lib/python3.7/site-packages/orbdetpy/init.py", line 29, in read_param
data = json.loads(param)
File "/Users/user/opt/anaconda3/lib/python3.7/json/init.py", line 348, in loads
return _default_decoder.decode(s)
File "/Users/user/opt/anaconda3/lib/python3.7/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/Users/user/opt/anaconda3/lib/python3.7/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

A JSON decode error occurred when I executed the command simulate_measurements("radar_sim_cfg.json", output_file = "sim_data.json").

Any thoughts on how to fix this problem?

Sam Dupree.

Setup unit testing

Related to #7, it would be helpful to have some unit tests to demonstrate functionality and ensure breaking changes are found quickly.

If this would be useful I can start the process.

definition of output vector from testsim example

Please define the reference frame for the output for simulated measurements. Here is the excerpt from the json file:
"TrueState": {
"Cartesian": [
3.57960207669903E7,
-2.2267515537321E7,
-87938.3477596335,
1625.07170292693,
2610.77460296534,
-2.09170251623871,
-0.1904435227596349,
0.1184685898367488,
4.678533639820142E-4
]
},
"Time": "2018-01-01T00:02:54.000Z",
"Station": "Station1",
"RightAscension": -0.6282273730787877,
"Declination": -0.09126966588071994
},

Simulation

First of all congratulations for this piece of code.
I would like to evaluate performance of a radar with a simulation over one month. Can I get a one month recording database (or a complete catalogue) in order to verify how many debris I will be able to identify?
P.s.: I love data representation at http://astria.tacc.utexas.edu/AstriaGraph/

Edit: I read that you store data as EME2000 state vectors. Is it there a way I can get that data to perform my simulation?

Refactor Python API to conform with PEP 8

I propose that refactor the Python API to conform with Python naming and style conventions, specifically PEP 8. This will likely constitute a major version release as it will require changing names and possibly call signatures for the Python API. That's why we have versions though!

This might be a good one to combine with #4 as that will also have pretty significant API impact.

Note I'm adding this as an issue to make sure it is tracked. I can make these changes pretty quickly. @Shiva-Iyer, let's discuss!

Failing to interpolate known GPS data

Hi,

First off, thanks for a really good package! I hope I could contribute something to the project.
However, there's currently an issue I'm having: for only few lines of data from given file I'm able to get nice interpolated data, but this fails with nans as values, based on sample test_ephemeris.py that is included in the distribution, but instead of propagating an orbit I use existing GPS data:

import csv
import sys
from typing import Union

try:
    import pendulum
    from loguru import logger
except ImportError:
    sys.exit("Please run 'pip install -U pendulum loguru' to run this")

from orbdetpy import Frame
from orbdetpy.conversion import get_J2000_epoch_offset
from orbdetpy.utilities import interpolate_ephemeris

STEP_SIZE = 60.0

Numeric = Union[int, float]

def main(fname):
    epoch = pendulum.parse("31 Dec 1999 23:59:28", strict=False).timestamp()
    logger.debug("(Unix) epoch set to {}, using file {}", epoch, fname)
    svs = list(parse_file(epoch, fname))  # state vectors; time, pos<3d>, vel<3d>

    times = [j2k_epoch_offset(sv[0]) for sv in svs]
    start_t, end_t = times[0], times[-1]
    assert start_t < end_t

    states = [e[1:] for e in svs]  # extract only position and velocity data

    logger.debug(
        "Interpolating {:d} values using step size {:.3f}s between {} .. {}",
        len(times),
        STEP_SIZE,
        start_t,
        end_t,
    )

    for row in interpolate_ephemeris(
        source_frame=Frame.GCRF,
        times=times,
        states=states,
        num_points=len(times),
        dest_frame=Frame.GCRF,
        interp_start=start_t,
        interp_end=end_t,
        step_size=STEP_SIZE,
    ):
        print(row.time, row.true_state)


def j2k_epoch_offset(stk_epoch: Numeric):
    time_str = pendulum.from_timestamp(stk_epoch).isoformat()
    return get_J2000_epoch_offset(time_str)


def parse_file(epoch, fpath):
    with open(fpath) as fh:
        reader = csv.reader(fh, delimiter=";")
        for row in reader:
            offset, *rest = [float(e) for e in row]
            yield [offset + epoch, *rest]  # we want first entry as time, which is epoch + offset from that


if __name__ == "__main__":
    import sys

    main(sys.argv[1])

Data file (ephemerides) attached, can be run with

pip install -U loguru pendulum  # needed only if missing those packages
python interpolate.py raw.txt

So the output I get is

orbdetpy-server version 2.0.2
2020-09-02 12:43:03.585 | DEBUG    | __main__:main:22 - (Unix) epoch set to 946684768.0, using file raw.csv
2020-09-02 12:43:03.752 | DEBUG    | __main__:main:40 - Interpolating 48 values using step size 60.000s between 631108873.184 .. 631109286.184
...
631109233.184 [1.5458659847874403e+47, -8.419914678062475e+46, 3.36869557803364e+47, 1.2458308352515215e+47, 8.523956895271134e+46, 1.7033524692088471e+47]
631109286.184 [nan, nan, nan, nan, nan, nan]
Shutting down server...

I'm pretty certain that the coordinate system is wrong (likely source is ECEF(?)), but shoudn't interpolation still work? I'm assuming it's
simply using Hermite or Lagrange algorithm to interpolate points, which means that it just treats those points as
plain numbers?

I'm assuming I'm doing something very silly here, so any help is appreciated.

raw.txt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.