SpiceyPy | SpiceyPy : a Pythonic Wrapper for the SPICE Toolkit | Map library
kandi X-RAY | SpiceyPy Summary
kandi X-RAY | SpiceyPy Summary
SpiceyPy: a Pythonic Wrapper for the SPICE Toolkit.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Determine the coordinates of an observer to a target observer .
- Evaluate a double precision value .
- Calculate term - point interpolation .
- Determine time intervals for an observer .
- Write a type 2 DSK file .
- Find the limb points for a given target position .
- Determine the rays of a target ray on an observer .
- Determine time intervals for a specified target position .
- Determine the separation between two coordinate vectors .
- Determine incidence angle and incidence angle .
SpiceyPy Key Features
SpiceyPy Examples and Code Snippets
Documents/
startup.py
PythonFunctions/
FirstFunc.py
SecondFunc.py
__all__ = ['FirstFunc', 'SecondFunc']
Documents/
startup.py
PythonFunctions/
__init__.py
FirstFunc.
n = UTC.iloc[:,0]
ets = []
for i, txt in enumerate(n):
et = spice.str2et(n[i]) #calculates ephermis time for utc,
ets.append(et)
n = UTC.iloc[:,0]
newList = [spice.str2et(txt) for txt in n]
from astropy.time import Time
from spiceypy import spiceypy as spice
# create a time
t = Time('2010-03-19 11:09:00', format='iso')
# put in spice format - this may require a leap seconds kernel to be
# downloaded, e.g. download https://n
language: go
go:
- 1.7
addons:
apt:
sources:
- deadsnakes # source required so it finds the package definition below
packages:
- python3.4
- python3.4-dev
before_install:
- go get github.com/axw/gocov/gocov
Community Discussions
Trending Discussions on SpiceyPy
QUESTION
Excuse me for the length of the title please but this is a pretty specific question. I'm currently simulating a launch of a rocket to mars in the 2022 launch window and I noticed that my rocket is a far distance away from Mars, even though it's traveling in the right direction. After simplifying my code to narrow down the problem, I simply plotted the orbits of the Earth and Mars (Using data from NASA's SPICE library) and propagated the position and velocity given to me by the lambert solver I implemented (Universal variables) to plot the final orbit of the rocket.
I'm only letting the Sun's gravity effect the rocket, not the Earth or Mars, to minimize my problem space. Yet even though I've simplified my problem so far, the intersection between Mars' and my rocket's orbits happens well before the time of flight has been simulated all the way, and the minimum distance between the two bodies is more than a million kilometers at all times.
That being said, something must be wrong but I cannot find the problem. I've made sure the lambert solver code I copied is correct by comparing it to Dario Izzo's method and both gave the same results. Furthermore, I've also checked that my orbit propagator works by propagating Mars' and the Earth's orbits and comparing those ellipses to the data from SPICE.
In conclusion, I assume this must be a stupid little mistake I made somewhere, but cannot find because I lack experience in this field. Thank you for any help! :)
This is the JupyterLab notebook I used:
...ANSWER
Answered 2021-Apr-28 at 14:29So, I managed to figure out what the problem was after much head-scratching. I was simply not taking into account that the Sun is not located at (0,0,0) in my coordinate system. I thought this was negligible, but that is what made the difference. In the end, I simply passed the difference between the Earth and Mars's and the Sun's position vectors and passed those into the Lambert solver. This finally gave me the desired results.
The reason that the error ended up being so "small" (It didn't seem like an obvious bug at first) was because my coordinates are centered at the solar system barycenter which is a few million kilometers away from the Sun, as one would expect.
Thanks for the comments!
QUESTION
I think my problem might have something to do with the multi-threaded-ness of Django, but let me know what your thoughts are.
I have a Django web project which will eventually be accessed by multiple users. Through the interface the users will be able to kick off calculations using a module called spiceypy. This is a module which allows you to compute relative position and velocity of planetary objects, spacecraft, etc.
Spiceypy requires loading a 'kernel set' (aka 'kernel library') before performing the computations. The kernel set includes information about a spacecraft trajectory, among other things.
In my project, different users might choose to use different kernel sets. I have a Django Form which allows you to select the kernel set, then perform the calculations.
The calculations are done inside my Class Based View's post() method.
So, the post method looks something like this.
...ANSWER
Answered 2020-Feb-18 at 03:29I think the issue is with the spicepy library that you are using - spicepy is mixing up calls sent from different Django threads. Looks from this issue like it doesn't support multithreading.
The way to verify this would be to disable threading in Django, and see whether that resolves the issue. How you do that depends on which wsgi server you are using in production. With uwsgi for example, you'd add this to your configuration:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install SpiceyPy
You can use SpiceyPy like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page