-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
climpact and climdex.pcic.ncdf do not compute SPI and SPEI #91
Comments
You'll probably find there is data in those files, unfortunately they are not CF compliant so CDO might report an error.
Do an ncdump -h on them to confirm. This happens because the 3 SPI time scales are stored along an additional dimension, so the data is stored something like scale x time x lat x lon.
You can use NCO to extract the scale to its own file, from there it should be CDO friendly.
E.g. ncks -d scale,0 -v spi climpact_spi_file.nc out.nc
The above line will extract SPI3, using "scale,1" should extract SPI6, and "scale,2" should extract SPI12. Haven't tested any of this and YMMV. Let me know if that doesn't work though.
… On 17/11/2021 20:35 user241276 ***@***.***> wrote:
hello @heroldn https://github.com/heroldn @jmccomb https://github.com/jmccomb @lisavalexander https://github.com/lisavalexander ,
I am using both climpact and climdex.pcic.ncdf for computing indices for CMIP6 data. My input files are netcdfs with tasmax, tasmin and pr variables from 1950 to 2100.
The computation of the indices works fine but not for the SPI and SPEI indices.
Please see below an example if I do cdo info on one SPEI output (same applies for SPI):
***@***.*** test]$ cdo info spei_MON_cmip6_ssp126_ACCESS-CM2_1950-2100.nc
Warning (cdfScanVarAttr): Time must be the first dimension! Unsupported array structure, skipped variable spei!
Warning (cdf_set_var): Inconsistent variable definition for spei!
Warning (cdfInqContents): No data arrays found!
cdo info: Open failed on >spei_MON_cmip6_ssp126_ACCESS-CM2_1950-2100.nc<
Unsupported file structure
Looks like the aren't any data in the netcdf file.
What am I missing?
Thanks
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub #91 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ACW3FAMZQCV64ZMUEABJ5STUMN45BANCNFSM5IGQJK3A .
Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub .
|
Go forward in time past the first 2 time steps for SPI3. Past the first 5 steps for SPI6, and 11 time steps for SPI12. These first time steps don't have any data since the SPI represents an accumulation of precipitation over the past 3/6/12 months.
… On 19/11/2021 20:24 user241276 ***@***.***> wrote:
hello, thanks a lot for the support.
I tried with NCO but I still get an empty output.
see attached a ncview screenshot of SPI3
[Screenshot 2021-11-19 at 10 50 54] https://user-images.githubusercontent.com/31700697/142602536-e09abf62-52e0-4f61-b351-98b85d3a78b8.png
a cdo info on the same file:
***@***.*** dir]$ cdo info test.nc
Warning (cdfScanVarAttr): Time must be the first dimension! Unsupported array structure, skipped variable spi!
Warning (cdf_set_var): Inconsistent variable definition for spi!
Warning (cdfInqContents): No data arrays found!
cdo info: Open failed on >test.nc<
Unsupported file structure
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub #91 (comment) , or unsubscribe https://github.com/notifications/unsubscribe-auth/ACW3FAPIQIED2RPOK44W743UMYNG7ANCNFSM5IGQJK3A .
Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub .
|
thanks. It makes sense :) I tried an example with SPI3 and cdo and it does not work:
Then tried the same with NCO but when plotting with ncview I only have one SPI3 value:
Is it 'normal' that ncview cannot plot the SPI? Thanks |
great. it works :) thank you |
p.s. to make the file "test.nc" work with CDO, the dimension "scale" needs to be removed from SPI3, SPI6 or/and SPI12. This can be done with NCO: ncwa -a scale test.nc out.nc best |
Yes true. Good to hear you can access the data. |
I need help calculating SPEI/SPI. When I use the Climpact function to add 1-month and 24-month scales, it doesn't work as expected. Has anyone encountered this problem before, or would you have a solution for integrating these scales into the index calculation? |
hello @heroldn @jmccomb @lisavalexander,
I am using both
climpact
andclimdex.pcic.ncdf
for computing indices for CMIP6 data. My input files are netcdfs withtasmax
,tasmin
andpr
variables from 1950 to 2100.The computation of the indices works fine but not for the SPI and SPEI indices.
Please see below an example if I do
cdo info
on one SPEI output (same applies for SPI):Looks like the aren't any data in the netcdf file.
What am I missing?
Thanks
The text was updated successfully, but these errors were encountered: