Solar ephemeris search engine?
February 6, 2022 12:40 PM Subscribe
It's easy enough to find sites online that tell you, for a given latitude and longitude on Earth, the azimuth and elevation of the sun at any particular date and time, or the times and compass bearings of sunrise and sunset throughout the year.
But is there any tool that will let you enter a latitude and longitude, plus a min/max azimuth and min/max elevation, and will return a list of date and time ranges within a given time window (if there are any) when the sun falls inside that sector of sky at that location?
Example use case: I own a house where the front windows point approximately southwest, compass bearing 230°. Outside the front windows there is a covered porch that blocks the upper part of the sky. I would like to figure out during what parts of what days throughout the year the sun crosses between 229° and 231° azimuth and 0° to 45° elevation at this location — i.e. when there will be sun coming more or less straight through the front windows of the house, unblocked by the porch roof.
A web app for obtaining this data would obviously be great, but if need be, I have some programming skill and can make use of a suitable library in Python, Ruby, JavaScript, or a few other languages if one exists for answering these sorts of questions.
Example use case: I own a house where the front windows point approximately southwest, compass bearing 230°. Outside the front windows there is a covered porch that blocks the upper part of the sky. I would like to figure out during what parts of what days throughout the year the sun crosses between 229° and 231° azimuth and 0° to 45° elevation at this location — i.e. when there will be sun coming more or less straight through the front windows of the house, unblocked by the porch roof.
A web app for obtaining this data would obviously be great, but if need be, I have some programming skill and can make use of a suitable library in Python, Ruby, JavaScript, or a few other languages if one exists for answering these sorts of questions.
Time and Date I marked this website at the sun calculations drop down. If you scroll down, there are all sorts of tools on this website for calculating longitude, azimuth, noon, where the other planets are, et cetera. I hope it is helpful.
posted by effluvia at 5:29 PM on February 6, 2022 [1 favorite]
posted by effluvia at 5:29 PM on February 6, 2022 [1 favorite]
Best answer: A long time ago I found some C code that did this, given position and time. This was 10+ years ago, but I believe it was NREL's Solar Position Algorithm. Might be something different than what I was using back then, but it looks like this would do the trick. There's a Python implementation documented at pvlib but I've not used it.
posted by Alterscape at 6:35 PM on February 6, 2022
posted by Alterscape at 6:35 PM on February 6, 2022
Best answer: You may be able to work this out using the tools in the astropy package in python. This tutorial seems relevant, especially at the end when the get the Sun's position. I'm not a python or astropy expert, but happy to do what I can to help if you DM me.
posted by kms at 1:11 AM on February 7, 2022
posted by kms at 1:11 AM on February 7, 2022
Response by poster: Thanks, all — looks like the best route may be to pick up one of these libraries and find the solutions myself. I figured my specific use case of "what time ranges is the sun going to be in such-and-such portion of sky" was probably unlikely to be solved by an off-the-rack tool, but it never hurts to ask.
posted by letourneau at 9:44 AM on February 11, 2022
posted by letourneau at 9:44 AM on February 11, 2022
This thread is closed to new comments.
posted by migurski at 12:49 PM on February 6, 2022 [1 favorite]