Giter Site home page Giter Site logo

bennyistanto / spi Goto Github PK

View Code? Open in Web Editor NEW
5.0 5.0 0.0 388.83 MB

Satellite-based monitoring of dry and wet condition using Standardized Precipitation Index (SPI)

Home Page: https://bennyistanto.github.io/spi/

License: GNU General Public License v3.0

Shell 56.87% Jupyter Notebook 40.01% Python 3.12%
chirps climate-indices imerg nasa-arset spi standardized-precipitation-index

spi's People

Contributors

bennyistanto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

spi's Issues

IMERG monthly unit conversion

Hi,

I am following your tutorials on various climate processes. Thank you for the very helpful documentations and detailed steps.

I have been trying to calculate SPI for IMERG and somehow, I get errors in the ncap2 when converting the precipitation unit from mm/hr to mm/month. I have copied this in my terminal and this created a sh file.

while read -r _file; do file=$(basename -- "$_file") yearmonth=$(echo "$file" | sed -E 's/.*\.3IMERG\.([0-9]{6})[0-9]{2}-.*/\1/') mult=$(python - "$yearmonth" <<EOF import sys, calendar ym = sys.argv[1] print(calendar.monthrange(int(ym[:4]), int(ym[4:]))[1] * 24) EOF ); echo ncap2 -s 'precipitation='"$mult"'*precipitation' "$file" ../IMERG_mmmonth/"$file"; done < <(find . -maxdepth 1 -type f -name "*.nc4") > script.sh

However, when I ran the code, I got this error.

ERROR: nco__create() unable to create file "../IMERG_mmmonth/3B-MO.MS.MRG.3IMERG.20200701-S000000-E235959.07.V06B.HDF5.SUB.nc4.pid28460.ncap2.tmp" nco_err_exit(): ERROR Short NCO-generated message (usually name of function that triggered error): nco__create() nco_err_exit(): ERROR Error code is 13. Translation into English with nc_strerror(13) is "Permission denied"

What have I done wrong and any help in solving this will be very much appreciated.

Thanks!

Calculating SPI.

I used your same input file (java_cli_chirps_1months_1981_2020.nc) for calculating SPI. for installing anaconda and other libraries , I followed all your steps. but in this spi calculating step I am getting this error, I don't know why., could you help me to solve this ?

spi --periodicity monthly --scales 1 2 --calibration_start_year 1981 --calibration_end_year 2020 --netcdf_precip java_cli_chirps_1months_1981_2020.nc --var_name_precip precip --output_file
_base /output_nc --multiprocessing all --save_params /fitting/java_CHIRPS_fitting.nc --overwrite

2023-04-15 23:18:44 INFO Start time: 2023-04-15 23:18:44.999332
2023-04-15 23:18:45 INFO Computing monthly SPI
2023-04-15 23:18:45 INFO Computing 1-month SPI (Gamma)
2023-04-15 23:18:59 ERROR Failed to complete
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "/home/sakthivelait/anaconda3/envs/climate_indices/lib/python3.7/multiprocessing/pool.py", line 121, in worker
result = (True, func(*args, **kwds))
File "/home/sakthivelait/anaconda3/envs/climate_indices/lib/python3.7/multiprocessing/pool.py", line 44, in mapstar
return list(map(*args))
File "/home/sakthivelait/anaconda3/envs/climate_indices/lib/python3.7/site-packages/climate_indices/spi.py", line 1212, in _apply_to_subarray_gamma
periodicity=args["periodicity"],
IndexError: index 9 is out of bounds for axis 0 with size 9

index_error

About conda install -c conda-forge gdal nco cdo wget

Dear Benny, please would you help me to solve this issue, once I tried to install gdal nco and cdo in gis environment, I got an error in solving environment process as failed with initial frozen solve. I use windows 11 machine and followed all steps until this one doesn't work; Thank you in advance

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.