Comments (3)
Hi @Engel23,
Thank you for raising this issue.
Based on your description, it seems that the name of your DataArray's ("yourDataArray") time dimension is neither "time" or "index".
- You can check whether this is the case with:
yourDataArray.dims
It should return something like "({'time': 3672, 'y': 17, 'x': 20})" or "({'time': 3672, 'latitude': 17, 'longitude': 20})". If it does not return 'time', you can fix this by changing the current name of the time dimension (for example, let's call it "timeindex"):
newDataArray = yourDataArray.rename_dims({"timeindex":"time"})
You should now be able to check the time dimension of the "newDataArray" with:
newDataArray.time
It should return an array with a dtype = 'datetime64[ns]'
You should now be able to use "newDataArray" with PyEt.
I hope this answer solves your question. Please let me know!
Is the CMIP6 data publicly available? If so, I can create an example using a subset of the data.
Best, Matevz
Why did this probably happen?
In the FAO-56 method, the Day of the year (DOY) is needed to compute extraterrestrial radiation. In PyEt, DOY is obtained from the time dimension of the input Pandas.Series or xarray.DataArray. We have designed PyEt with an assumption that the xarray.DataArray time dimension is called "time" or "index". This is usually the case; however, there might be exceptions. That's why it's good to communicate on such issues. Thank you for that!
How to solve this in future versionsof PyEt?
Add a function that raises an error if the name of the time dimension in xarray.DataArray is not "time".
#43
from pyet.
Hi @mvremec,
Thank you for your quick response and for your help, the dimension name was indeed where it went wrong since my dimension had a different name due to prior calculations. The pm-fao56 method seems to work now for my data! The CMIP6 data is publicly available here (https://esgf-node.llnl.gov/search/cmip6/), note that the variables needed for the pyet package (tasmax, tasmin, etc) are distributed into different netcdf files.
Again thank you for your help!
Best, Engel
from pyet.
Hi @Engel23,
I am very glad to hear that.
I have added an example with CMIP6 data I downloaded from Copernicus (https://cds.climate.copernicus.eu/) and will probably extend it to the data from your link. Thank you for that!
Example 9: https://github.com/pyet-org/pyet/blob/dev/examples/09_CMIP6_data.ipynb
I wish you lots of fun and exciting work with PyEt!
Best,
Matevz
from pyet.
Related Issues (20)
- Built check for lat values HOT 1
- Remove Travis CI and stick to GitHub CI HOT 1
- fix ReadTheDocs issues HOT 3
- get_rn method undocumented and in strange place HOT 1
- methods don't work with Pandas DataFrame HOT 2
- Excluding areas above/below certain latitude HOT 3
- Speeding up calculations HOT 1
- Unrealistic negative/positive values for the Turch equation at sub-freezing temperatures HOT 1
- Hargreaves method is not calculating for some days in winter HOT 4
- pm_fao56 error HOT 2
- "Haude" method error in calculate_all HOT 1
- pyet.calc_rad_net attribute error with pandas.series HOT 4
- Start using pyproject.toml instead of setup.py HOT 1
- Start using Github Actions HOT 1
- Add recent publications using PyEt HOT 1
- Add Issue and PR templates HOT 1
- Remove 'shape' as argument from 'extraterrestrial_r' method in meter_utils.py HOT 1
- Specific humidity to relative humidity HOT 1
- The radiation input provided is greater than 100 MJ/m2d, which is not realistic. Please convert the radiation input to MJ/m2d HOT 8
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 pyet.