<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div dir="ltr"><meta http-equiv="content-type" content="text/html; charset=utf-8">Hi Peter,<div><br></div><div>You could try the get_sun function in astropy to be sure you’ve got accurate coordinates for the Sun, and go from there. </div><div><br></div><div>How are you judging true north / south?  If using a compass, be sure to correct for magnetic vs. true north. </div><div><br></div><div>Note that the apparent position of the Sun in the sky gets shifted by atmospheric refraction when it is low in the sky, but I think that effect is too small to explain what you’re seeing (and would be mostly in altitude). <br><br>Good luck,</div><div><br><div dir="ltr">Eric<div><br></div><div>P.S. The “Eastern Daylight Time” comment in your code confused me for a bit - might want to change that, as it looks like you’re in Melbourne...</div></div><div dir="ltr"><br><blockquote type="cite">On Mar 24, 2020, at 6:14 AM, Peter <pslowater@gmail.com> wrote:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr"><div dir="ltr"><div>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.</div><div>Using the code below from samples it receives the dec/asc and calculates the alt/az.</div><div>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 correct.</div><div>I assume it's the way I am doing the calc, does what I have look correct?</div><div>The RA/DEC from Stellarium is J2000 from what I can work out.</div><div><br></div><div>Peter..</div><div><br></div>           dec_in = float(vals[2])<br>           asc_in= float(vals[1])<br>           M42 = SkyCoord(ra=float(vals[1])*u.degree, dec=float(vals[2])*u.degree, frame='icrs') <br>           home = EarthLocation(lat=-38.06395*u.deg, lon=145.28455*u.deg, height=40*u.m)<br>           utcoffset = +11*u.hour  # Eastern Daylight Time<br>           time = Time(datetime.datetime.now())<br>           print("Time           :",time)<br>           time = Time(datetime.datetime.now())- utcoffset<br>           print("Time UTC       :",time)<br>           m33altaz = M42.transform_to(AltAz(obstime=time,location=home))<br>           print(dec_in," : ",asc_in)<br>           print("Postion to move:",numpy.around((m33altaz.alt*u.deg).value,3),"  : ",numpy.around((<a href="http://m33altaz.az">m33altaz.az</a>*u.deg).value,3))<br>           print("====")<br>           rotation = numpy.around((<a href="http://m33altaz.az">m33altaz.az</a>*u.deg).value,3)<br>           angle = numpy.around((m33altaz.alt*u.deg).value,3)<br></div>
<span>_______________________________________________</span><br><span>AstroPy mailing list</span><br><span>AstroPy@python.org</span><br><span>https://mail.python.org/mailman/listinfo/astropy</span><br></div></blockquote></div></div></body></html>