-
Notifications
You must be signed in to change notification settings - Fork 167
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
SPEI notebook #494
Comments
Thanks for the impetus for this, @GvdDool In a nutshell, there are core index functions in the Bear in mind that the package is not specific to any geographic region and can be used on any time series of precipitation/temperature data. I have created an example notebook for SPI which leverages xarray for parallelization but it doesn't include the multiprocessing features included in our processing script. So we can do something similar for SPEI. I'd like to improve the processing script in favor of a more elegant approach in which tools such as xarray or ray are used for the parallelization and multiprocessing, but I've not yet worked out how to do that so we're still using our own Rube Goldberg machine that leans on shared data arrays. If you have the time and inclination I'd suggest using the SPI notebook referenced above as a template for an SPEI notebook. If you can work out how to use xarray for multiprocessing in a better way then please let me know as I have wanted to crack that nut for years and it never quite worked (for example see this discussion from the last time I tried). |
Thanks James (monocongo), Parallelization and multiprocessing would help, for sure, but I think that I can use a simple loop for now, going over the X: 26 Y: 30 low-resolution area working on 14K Uber H3-res10 cells; I know, this is not elegant either, using a loop over 14K elements, but I will need to correct for the temperature difference over the 0.11 degree grid, and I don't know how to do this in a vectorised structure (this is above my skill level) I will keep you posted on my progress, and when possible, I will share a notebook with my solution. |
I caution you to not use the PDSI code herein. It is not yet fully vetted and is only included as the "first draft" for someone to use as a start of a proper implementation of the Palmer indices. The results using this code will match those of the code used by NOAA but not in every case, and without further understanding of why this or that or any other PDSI implementation is valid then I don't recommend using this one. It was derived from the NOAA PDSI Fortran plus a few other implementations I managed to find (for example there is no self-calibration in the NOAA version). I am not a climate scientist myself and leaned heavily on the scientific staff at NOAA to vet the results and methodology, and the resident expert on Palmers there, Richard Heim, just didn't have the bandwidth to hammer out the last details on this, and so here we are with what's essentially an unfinished project. The SPI, SPEI, PET, and others in this package are solid, but the Palmers are only included for completeness and hopefully as a launching point for others to continue/finish the work. |
Thanks for the heads-up - the underlying functions in the notebook looked very complete (not being an expert in the drought myself, and only having a basic understanding of the soil properties, coming from my groundwater background). Like I said in my previous post, I have to deal with the downscaling first, and PSDI was a nice extra, as I selected the KBDI as the main index, supported with SPI/SPEI. |
Hi,
I might be missing a resource, but I can't seem to locate a notebook where the SPEI is calculated, as an example. Having a notebook going through the calculation steps would be very useful, especially when the data is coming from another domain/source and will have to be pre-processed to fit the structure of the algorithm.
The read.me leads to a publication: https://www.researchgate.net/publication/252361460_The_Standardized_Precipitation-Evapotranspiration_Index_SPEI_a_multiscalar_drought_index, which is not publicly available, so checking the function would be extremely difficult without a notebook going through the calculation steps.
I checked the Palmer_Drought_Index notebook, and this notebook is well documented, and I understand the effort that goes into producing these notebooks, but having examples makes the library much more user-friendly.
I look forward to your comments, and I am more than happy to contribute to a notebook that handles data outside the Continental USA.
The text was updated successfully, but these errors were encountered: