question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow an array (instead of singular) of obstimes for a SkyCoord object

See original GitHub issue

Currently SkyCoord only allows a single obstime to be specified per object. Whilst I understand this from an observing point of view, I would like to represent the trajectory of a spacecraft as a function of time using the astropy coordinate framework. This requires that each individual coordinate within the object should have an individual obstime associated with it.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
dstansbycommented, Sep 18, 2019

It turns out there was never a problem, but pytest was erroring when a warning was thrown (so I should have done more checks before opening the issue!). I’ve made a small PR to improve the docs.

1reaction
dstansbycommented, Sep 17, 2019

Ach, seems like this is a sunpy issue that I thought was an astropy one - the following works fine:

from astropy.coordinates import SkyCoord  # High-level coordinates
from astropy.coordinates import ICRS, Galactic, FK4, FK5  # Low-level frames
from astropy.coordinates import Angle, Latitude, Longitude  # Angles
import astropy.units as u

coords = ["1:12:43.2 +1:12:43", "1 12 43.2 +1 12 43"]
obstimes = ['J1992.21', 'J1993.21']
c = SkyCoord(coords, frame=FK4, unit=(u.deg, u.hourangle), obstime=obstimes)
print(c.obstime)

I think at least the docs should be updated to imply that multiple obstimes are in theory possible: http://docs.astropy.org/en/stable/api/astropy.coordinates.SkyCoord.html I’m happy to give this a go.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SkyCoord — Astropy v5.2
This is intended for use on SkyCoord objects with coordinate arrays, rather than a scalar coordinate. For a scalar coordinate, it is better...
Read more >
SkyCoord — Astropy v1.2.dev14793
High-level object providing a flexible interface for celestial coordinate representation, manipulation, and transformation between systems. The SkyCoord class ...
Read more >
Astropy Documentation - Read the Docs
For most users the major change is that the recommended user interface to coordinate functionality is the SkyCoord class instead of classes ...
Read more >
Numpy Value Error: setting an array element with a sequence
But you get a different result for SkyCoord since SkyCoord can be a container for an array of many coordinates, and Numpy sees...
Read more >
Generating a map from data array - SunPy
A simple demonstration of creating a map from a numpy array of data. Let's ... import SkyCoord import sunpy.map from sunpy.coordinates import frames....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found