Re:Show HN: I made a website to find best bus seat to avoid ...
by Amithv on Wednesday January 17, 2024 @07:18AM
(#39026706)
The hard part was obtaining information such as solar azimuth, altitude, declination, hour angle, etc without using external APIs. Spent around 5 days implementing backend.
[ Parent
| on HN ]
Re:Show HN: I made a website to find best bus seat to avoid ...
by antgiant on Wednesday January 17, 2024 @11:00AM
(#39029494)
Way too late now, but to help others this fancy Excel sheet provided by NOAA is awesome! It implements all of these equations in Excel and is pretty easily portable to your programming language of choice. https://gml.noaa.gov/grad/solcalc/calcdetails.html
P.S. Using this has made it clear to me how bad most sunrise/sunset calculators actually are.
Re:Show HN: I made a website to find best bus seat to avoid ...
by grecy on Wednesday January 17, 2024 @01:33PM
(#39031553)
> P.S. Using this has made it clear to me how bad most sunrise/sunset calculators actually are.
That may just be a function of how you define "sunrise" and "sunset". It is never as simple as "when the sun hits the horizon", but something about some number of arc minutes from something something.
Re:Show HN: I made a website to find best bus seat to avoid ...
by wizzwizz4 on Wednesday January 17, 2024 @01:52PM
(#39031787)
Dependent on the refractive index, which depends on air density and temperature and humidity too; and we have to integrate over the region between the horizon and the upper atmosphere (diagonally, of course)…
Re:Show HN: I made a website to find best bus seat to avoid ...
by grecy on Wednesday January 17, 2024 @06:21PM
(#39035049)
Haha, thanks ,yep. I learned all this when I lived in the Yukon and sunset takes about 2 hours...
Re:Show HN: I made a website to find best bus seat to avoid ...
by antgiant on Friday January 19, 2024 @03:14PM
(#39060472)
To be clear I was complaining that basically everyone calculates “sunrise” and “sunset” differently. If you check half a dozen different “sunset” calculators you will get a surprisingly wide variation in the times they provide. At least where I live the error seems to average 5-10 minutes.
Re:Show HN: I made a website to find best bus seat to avoid ...
by grecy on Friday January 19, 2024 @08:19PM
(#39063647)
> At least where I live the error seems to average 5-10 minutes
And what I meant was you are not seeing "error", it's just a difference in definition.
Re:Show HN: I made a website to find best bus seat to avoid ...
by Gorgor on Wednesday January 17, 2024 @01:29PM
(#39031495)
Calculating the solar position is also pretty important when simulating power production of photovoltaics plants. So, the Python library pvlib has nice functions for working with this: https://pvlib-python.readthedocs.io/en/stable/reference/sola...
Re:Show HN: I made a website to find best bus seat to avoid ...
by manchego on Wednesday January 17, 2024 @03:57PM
(#39033340)
For anyone wanting to do this calculation yourself, this site is really good: https://www.aa.quae.nl/en/reken/zonpositie.html
I've previously used the formulas on this site to calculate the altitude/azimuth of the Sun and all the planets from a given lat/long/time on Earth.
Re:Show HN: I made a website to find best bus seat to avoid ...
by tppiotrowski on Wednesday January 17, 2024 @06:38PM
(#39035219)
I'm not sure what you mean by external APIs but is there a reason you're not using SunCalc[1] on the client to process the route after it's returned from the routing engine?