ladybug-tools / ladybug-legacy

:beetle: Ladybug is an environmental plugin for Grasshopper.
http://ladybug.tools
Other
192 stars 82 forks source link

SunPath error with solar time and a 60min time step on 21March #488

Closed SonnyWeaver closed 4 years ago

SonnyWeaver commented 4 years ago

Dear @mostaphaRoudsari, dear @chriswmackey ,

as recommended in this post https://discourse.ladybug.tools/t/sunpath-error-with-solar-time-and-a-time-step-of-every-min/9627, I report the error that I found in the SunPath component.

I noticed when the SolarTime option is active, I cannot analyze on 21 March, with a 60 minute time step (sun for every minute). This error come out: math domain Error

Kindly, Antonello DiNunzio and Abraham Yezioro have found the error.

The error is happenning in the LB_LB component at line 1565. It looks like this: self.solAz = ((math.acos(((math.sin(self.solLat)math.cos(self.zenith)) If you change it to this (like Antonello suggested) it works fine: self.solAz = ((math.acos(((math.sin( round(self.solLat, 5)) math.cos(round(self.zenith,

5)))

Greetings

mostaphaRoudsari commented 4 years ago

Thank you @SonnyWeaver for reporting the issue. Any chance you can send a PR for this fix?

SonnyWeaver commented 4 years ago

Sorry dear @mostaphaRoudsari , I don't understand what I should do.

mostaphaRoudsari commented 4 years ago

No worries @SonnyWeaver and thanks again for reporting the issue.

chriswmackey commented 4 years ago

Thank you for reporting the issue, @SonnyWeaver . I just merged in the fix that @ayezioro posted to the forum: https://github.com/ladybug-tools/ladybug-legacy/commit/4da089e237d9afad882b91350c05400d58118b69