-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Altitude lookup table #1516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Is there an api we can use instead? |
Cool idea. I can't really comment on the cost (if any) of distributing another relatively large data file. Some thoughts: the technical improvement to modeling would be minor: the only use of 'altitude' is to estimate air pressure for a clear-sky model or for adjusting geometric solar position to apparent position. But there's an intangible benefit from not having to look up a value, or having to explain why the default 0m is good enough. To me the intangible benefit is likely greater than the improvement in model results. As alternatives, several of the weather data sources (PSM3, others), but not all, return altitude. |
Could file size be reduced by omitting the ocean bathymetry data? I'm not really familiar with h5 files. If accuracy is not so important, maybe cutting the values down to 8 bits would be acceptable.
Yes! Makes me wonder if there are other such datasets we should consider. |
Good point. Altitude rounded to 100m increments is probably good enough. |
I'm unsure about packaging an elevation map with pvlib. But a higher resolution data set could be useful for shading. I thought there were some PR discussions along those lines. |
I think getting altitude is probably something we can outsource to an API like the Google Maps maybe, ESRI, or MapQuest? Seems a lot easier than adding 10 mb to the package maybe? |
Found these:
And more… I googled “elevation api lookup” |
I tried the suggestions to reduce the size of the altitude lookup map. I agree that an API would be good for high-resolution use cases like shading. |
Also, where I got the original data can be helpful in high-resolution use-cases. It is hosted for free by aws in their open data initiative. |
I'm -1 to having I'm also open to |
This discussion suggests there are two, perhaps complementary, enhancements:
Access to an API for detailed elevation data will not relieve those who want a simple alternative to the current default. Similarly, a low-resolution file included with pvlib will not satisfy those looking for high accuracy elevation. I'm not opposed to having all three (current default, low-resolution internal lookup, high resolution via API) in pvlib. |
I think it'd be great to have the option of something like this:
and then have the location object call an API (using a function from iotools) that retrieved the elevation. |
It looks like the 1.2 mb version might be acceptable. I will make a pull request early next week and you can make the final decision then. I also will play with the encoding a bit, there might be ways to increase accuracy while staying ~1 mb. |
I wonder if folks will start to cannibalize pvlib for elevation data, and then send issues complaining that it's only accurate to 35m 🤣 |
Assuredly, yes. |
I think this is a nice addition. There are probably a variety of technical variations possible, for example using netcdf, but it's also fine the way it is. |
Currently, altitude for
pvlib.location
based algorithms defaults to zero, but if we include a low-resolution altitude lookup, we can provide better results when altitude is not specified.We can make this altitude lookup the same format as LinkeTurbidities.h5, so it wouldn't require that much new code or any new dependencies.
I was able to build an altitude map using open data aggregated by tilezen. My test H5 file is currently
13 mb
using4320x2160
resolution,uint16
altitude, andgzip
compression. We are free to distribute this data, but we do need to do is add this attribution somewhere in the documentation.Would you guys be interested in this feature? Should I make a pull request?
Here is a plot of my sample

:
The text was updated successfully, but these errors were encountered: