[AstroPy] RA/Dec to Alt/Az
pslowater at gmail.com
Tue Mar 24 06:14:13 EDT 2020
I am using Stellarium to point a custom mount at the selected object which
at this time I am just testing rotation and using the sun & shadow.
Using the code below from samples it receives the dec/asc and calculates
The problem I have is that when the sun is northish the az is close to what
Stellarium shows but when east or west then the az is about 8 Deg or more
off in the calculation compared to Stellarium and the Shadow also is not
I assume it's the way I am doing the calc, does what I have look correct?
The RA/DEC from Stellarium is J2000 from what I can work out.
dec_in = float(vals)
M42 = SkyCoord(ra=float(vals)*u.degree,
home = EarthLocation(lat=-38.06395*u.deg, lon=145.28455*u.deg,
utcoffset = +11*u.hour # Eastern Daylight Time
time = Time(datetime.datetime.now())
time = Time(datetime.datetime.now())- utcoffset
print("Time UTC :",time)
m33altaz = M42.transform_to(AltAz(obstime=time,location=home))
print(dec_in," : ",asc_in)
move:",numpy.around((m33altaz.alt*u.deg).value,3)," : ",numpy.around((
rotation = numpy.around((m33altaz.az*u.deg).value,3)
angle = numpy.around((m33altaz.alt*u.deg).value,3)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the AstroPy