astroufsc / chimera

Chimera - Observatory Automation System
http://chimera.sf.net/
GNU General Public License v2.0
36 stars 19 forks source link

Problem with sun position on site #109

Closed tribeiro closed 9 years ago

tribeiro commented 9 years ago

There is a strange problem with calculating the position of the sun in the site package.

https://github.com/astroufsc/chimera/blob/4c49c6741d59e35ebdcc2a465c51a633d5a819b6/src/chimera/core/site.py#L198

Apparently all is well and it is supposed to be working but, upon request, the position of the sun is wrong by far. I've been able to overcome the problem using the package own internal conversions.

Replacing the original function by this form

    def sunpos(self, date=None):
        date = date or self.localtime()
        self._sun.compute(self._getEphem(date))

        return self.raDecToAltAz(Position.fromRaDec('%s'%self._sun.ra,
                                                    '%s'%self._sun.dec),
                                 self.LST_inRads(date))

Fixes the issue.

wschoenell commented 9 years ago

@tribeiro,

I could fix this only by changing date = date or self.localtime() by date = date or self.ut() on the line after the one you mentioned on your first comment. Can you check if this works and update #110?

wschoenell commented 9 years ago

Fixed by #110