Git Product home page Git Product logo

Comments (4)

AndrewAnnex avatar AndrewAnnex commented on June 19, 2024

you are not passing in the correct path to the meta kernel. Try passing in the absolute path to the meta kernel to spice.furnsh or be sure to start the python interpreter or script within that directory as you are only giving a relative path. Also as you are on windows, you may need to use windows paths ie C:\\blah\to\thing.txt not *nix style paths ie /blah/to/thing.txt. Also the paths within the meta kernel may also need to be absolute, if that still doesn't work try loading each kernel separately with furnsh without using the meta kernel.

from spiceypy.

rgoalcast avatar rgoalcast commented on June 19, 2024

Thank you, Sir, I am getting the results for Cassini Position example http://spiceypy.readthedocs.io/en/master/exampleone.html,
but when I am plotting data, I am not getting the plot, and also there is not any error.

### ```
threeDPlot = Scatter3d(
    x=positions[:, 0], # X coordinates
    y=positions[:, 1], # Y coordinates
    z=positions[:, 2], # Z coordinates
    name='Cassini',
    mode='lines',
    line=Line(width=3)
)
barycenter = Scatter3d(
    x=[0],
    y=[0],
    z=[0],
    name='bc',
    mode='marker',
    marker=dict(
        size=10,
        color='orange'
    )
)
data = Data([threeDPlot, barycenter])
layout = Layout(title="SpiceyPy Cassini Position Example")
fig = dict(data=data, layout=layout)
iplot(fig)


In[]: data
Out[]:
[{'line': {'width': 3},
'mode': 'lines',
'name': 'Cassini',
'type': 'scatter3d',
'x': array([-5461446.61080924, -5405334.74422541, -5349146.94705376, ...,
-1707474.84294684, -1746356.96542149, -1783710.34586425]),
'y': array([-4434793.40785864, -4394389.30467674, -4353923.53971293, ...,
-274607.5065943 , -310089.45261548, -345300.0914401 ]),
'z': array([-1200385.93315424, -1188170.51939463, -1175938.44080957, ...,
169001.94299463, 174816.22627009, 180477.49434824])},
{'marker': {'color': 'orange', 'size': 10},
'mode': 'marker',
'name': 'bc',
'type': 'scatter3d',
'x': [0],
'y': [0],
'z': [0]}]

How can I see the plot? Thank you.

from spiceypy.

AndrewAnnex avatar AndrewAnnex commented on June 19, 2024

The example I provided in the docs uses a library called plotly which hasn't been updated so it doesn't work, so don't use that code verbatim. Yes I do need to update that. You can plot the data using matplotlib instead, see https://matplotlib.org/examples/mplot3d/lines3d_demo.html for a simple example that should be easy to adapt to use the position data returned from spkpos.

from spiceypy.

rgoalcast avatar rgoalcast commented on June 19, 2024

Thank you, getting the plot.

from spiceypy.

Related Issues (20)

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.