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.

vector calculations for apparent().altaz()

See original GitHub issue

Hi Brandon, recently I heavily used the new panda approach for hipparchus catalogue. As I run through your examples they worked fine. Is used the same filter approach like in your documentation.

For getting an AltAz picture of the selected stars I would replace

ra, dec, distance = astrometric.radec()

straight forward with

alt, az, d = astrometric.apparent().altaz()

but this approach throws some errors:

File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/skyfield/positionlib.py", line 413, in apparent
    position_au, gcrs_position)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/skyfield/earthlib.py", line 115, in compute_limb_angle
    coszd = dots(position_au, observer_au) / (disobj * disobs)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/skyfield/functions.py", line 15, in dots
    return (v * u).sum(axis=0)
ValueError: operands could not be broadcast together with shapes (3,93) (3,)

From my point of view that might be related to absence of vector capabilities in apparent and altaz module. If you could confirm that, I would change my code to get a list of Stars out of the datagram like:

bright_stars = list()
for index, row in df.iterrows():
    bright_stars.append(Star.from_dataframe(row)

to get a list, which is appropriate. Any thoughts about my doing ? Many thanks in advance and merry christmas !

Michel

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
mworioncommented, Nov 5, 2019

@brandon-rhodes,

Sorry for the late answer, I’m on a business trip, but got a quick test and with 1.14 is works nicely. Thanks for fixing !

Michel

0reactions
brandon-rhodescommented, Oct 14, 2019

Great! I’ll see about getting a release out this week, if things don’t get too busy.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Positions — Skyfield documentation - Rhodes Mill
Skyfield stores the locations of celestial bodies as (x,y,z) vectors that ... An Apparent position is computed by calling the Astrometric.apparent() method.
Read more >
Horizontal coordinates - PyAstronomy
Convert hour angle and declination into horizon (alt/az) coordinates. Parameters. hafloat or array. Local apparent hour angle in DEGREES. decfloat or array.
Read more >
HOR2EQ - L3HarrisGeospatial.com
This is a nice code to calculate equatorial (ra,dec) coordinates from horizon (alt,az) coords. It is typically accurate to about 1 arcsecond
Read more >
eq2hor.pro
... and uses vector arithmetic in every calculation except ; when calculating ... N_params() LT 4 then begin print,'Syntax - EQ2HOR, ra, dec,...
Read more >
Convert from Alt/Az coordinates w.r.t. point on surface to (x,y,z ...
In order to calculate a new point from an origin, you will also need a distance from the origin to the point in...
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