Python PyEphem calculation of Azimuth and Altitude

情到浓时终转凉″ 提交于 2019-12-05 15:22:37

The C library underlying PyEphem does not have any way to turn off deflection, aberration, or nutation — maybe because Nature does not let us turn those effects off either, but I am not sure! It does not, I will note, do those calculations for an earth-orbiting satellite, but I can't think of an easy way for you to put a satellite at an exact RA and dec above your position so that you can ask PyEphem about its location.

I am actually spending this week at DjangoCon going to talks about APIs, and thinking about how PyEphem might someday make its inner workings easier to access from Python, instead of leaving all of these interesting steps locked inside of the C code. But, until I have an alternative ready, the only way to accomplish what you want would be to open the source file circum.c and comment out these lines:

/* allow for relativistic light bending near the sun */
deflect (mjed, lam, bet, lsn, rsn, 1e10, &ra, &dec);

/* TODO: correction for annual parallax would go here */

/* correct EOD equatoreal for nutation/aberation to form apparent 
 * geocentric
 */
nut_eq(mjed, &ra, &dec);
ab_eq(mjed, lsn, &ra, &dec);

If those three calls — deflect(), nut_eq(), and ab_eq() starting at line 263 — are commented out, then you might get an answer much closer to the one produced in this article. You would apply these changes by:

  • Downloading the .tar.gz for PyEphem.
  • Extract the archive to produce files.
  • Make the edit that I suggest above.
  • Run python setup.py install to install your custom version of the software.
  • Try it out!

There might be another obstacle, if precession is somehow coming into play — you might need to set the epoch of your star object to exactly '1998/8/10 23:10:00' in that case — but try turning off the three light-effect calls first and see if that gets you closer!

The fact that observer includes "temp=15.0C pressure=1010.0mBar" implies that the calculation will include refraction. You want to turn off refraction

as described in the help:

These apparent positions include an adjustment to simulate atmospheric refraction for the observer’s temp and presure; set the observer’s pressure to zero to ignore refraction.

You wanted to enter : RA = 16 h 41.7 min

but you entered: star._ra = '16:41.42.0'

instead of star._ra = '16:41:42.0'

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!