Comments (11)
Many thanks for your timely reply.
- Yes, it will work when using 'azimuth[lat.values <= 0] = 0', instead of 'azimuth[azimuth <= 0] = 0'
- I am afraid (e.g.) 'slope[below_25] = 0.87 * lat.values[below_25]' will still return negative values/slopes. The equation for calculating optimal panel slope only works correctly when positive value is fed according to the reference.
'lat.values = np.abs(lat.values)' before 'below_25 = np.abs(lat.values) <= np.deg2rad(25)' should be added, right?
from atlite.
Many thanks. Yes, it will work correctly now.
from atlite.
You are referring to these lines, right?
atlite/atlite/pv/orientation.py
Lines 41 to 54 in 64a7443
Changed to
below_25 = np.abs(lat.values) <= np.deg2rad(25)
below_50 = np.abs(lat.values) <= np.deg2rad(50)
should work, the simple approach applied there does in its original form not distinguish between northern and southern hemisphere.
But that's also exactly what makes me wary and a bit reluctant to change it:
Maybe there is some good reason for this limitation (but maybe the assert is obsolete).
@coroa Did you write that part of the code and remember why the limitation was put into place?
from atlite.
Exactly, but I am not sure whether 'azimuth=180.' should be changed to 'azimuth=0.' . because it is explained that 'azimuth = 180 faces exactly South' at the beginning in 'orientation.py'.
from atlite.
Yep, that has to be addressed as well.
Can you checkout the branch optimal-orientation-globally
and see whether this works for you and produces expected results?
from atlite.
Thanks, it's difficult to check out whether the result is correct.
But I am not sure 'azimuth = np.empty_like(lat.values)' will create expected array according to the sign of value (it creates random value, eg create -5 for latitude 20 instead of 5)
Also, it seems 'abs' is not applied to negative latitude, in which case, the equation produce incorrect panel slopes.
I replace 'azimuth = np.empty_like(lat.values) with 'lat_copy = np.copy(lat.values),
azimuth = (lat_copy>0)-0.5',
and add 'lat = abs(lat)' before 'below_25 … '
Does it make sense please?
from atlite.
I think I get what you mean. ;-)
Doing multiple things simultaneously I forgot to incoporate the np.abs(...)
.
The initial values in the azimuth
variable are just placeholders and we need it as an empty shell. Masking is done with the original latitude values.
It should work now with the changes in the new branch. I tested it locally with reasonable results.
It would be great if you can test it for yourself and see if the results are reasonable!
Afterwards we can incorporate it into the productive code.
If you do not know how, then one method is to download the repository and checkout the new branch.
Using the console:
git clone https://github.com/PyPSA/atlite
git checkout remotes/origin/optimal-orientation-globally
Create a new environment for the test with the required packages, e.g.:
conda create --name atlite-test
conda activate atlite-test
conda env update -f atlite/atlite/environment.yaml
and install the branch as a package
pip install -e atlite/
Finally you need to edit the atlite/atlite/config.py
file to point to the correct folder for your existing cutouts.
(as you originally did after the installation)
You should then be able to run your script as you are used to.
from atlite.
Thanks attentive!
The slope calculation is now always positive (as you correctly pointed out it should be):
atlite/atlite/pv/orientation.py
Lines 49 to 51 in 1a9338c
Changing lat.values = np.abs(lat.values)
would change the original lat
object (call-by-reference/function call with a mutuable argument). So that's not an option.
from atlite.
Can you test the branch locally (as I described above)? It would be helpful to have a positive test before incoporating it into the main code.
from atlite.
Yes, no problem. I will check out whether it produces the same results with my current codes.
from atlite.
Hi, sorry for the delay. In order to test, I created a new enviroment and installed 'git', 'pip', then I follow the steps as you provied.
It seems I cannot clone using 'git clone https://github.com/PyPSA/atlite', always shown 'RPC failed; curl 18 transfer closed with outstanding read data remaining' or 'fatal: destination path atlite already existes and is not an empty diretory'. I'm afraid it is the problem of my laptop's configuration or sth else, not the code. Btw, it was a tough work as well when I installed the existing current 'atlite', so it is the least option for me to re-install or update it honestly.
Fortunately, waht we wanna do mostly is to check part of the code in 'orientation.py' for converting at sites with negative latitude. I have applied the code for dozens of sites in the southern hemisphere, and the code can always produce reasonable results.
from atlite.
Related Issues (20)
- Add heuristic for ERA5 download chunk sizes HOT 3
- Incorrect unit conversion in hydro inflow shift
- ERA5 Solar Position Time Shift Broken for Certain Time Spans HOT 5
- Cutout AttributeError: "EntryPoints" object has no attribute get in Colab HOT 2
- Question about runoff conversion HOT 3
- Include xarray-spatial
- pad_extent leads to rasterio error for global scape
- Licence description on PyPI incorrect HOT 1
- Error cannot convert float nan to int HOT 10
- Issue with build_cutout using alite HOT 5
- reanalysis-era5-single-levels HOT 3
- Atlite errors with ESRI:540060 reprojections and Fiji HOT 4
- Read from url for `excluder.add_raster` and `excluder.add_geometry` HOT 2
- PV conversion: New model based on Bloomfield et al. (2019)
- Wind Conversion: potential bug when power curve does not end with zero after cutout speed HOT 1
- Weather/climate data variable descriptions (for alternate model data use) HOT 2
- Problems with `convert_and_aggregate` for long timespans? HOT 12
- Data type error when building cutout with SARAH v3 HOT 3
- Merging cutouts / Integrate downloaded SARAH data into existing ERA-5 cutout HOT 1
- Setting the "capacity_factor_timeseries = True" the results seem not to change HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from atlite.