This repository contains instructions for downloading climate data in NetCDF format, clipping to region of interest and conversion of the data to CSV format.
- Data download in NetCDF format (ex.CHIRPS for precipitation): https://data.chc.ucsb.edu/products/CHIRPS-2.0/
- Clip the NetCDF file to region of interest using the CDO (Climate Data Operator) command line tool
- For Linux/Mac users, CDO download is straightforward (https://www.isimip.org/protocol/preparing-simulation-files/cdo-help/).
- For Windows users, CDO can be installed from cygwin
After clicking the cygwin install option the following screen should appear
Go through all the the default options till you come to the window for selecting packages
Type 'cdo' in the searchbar and choose: 'cdo' and 'libcdo0'
Choose version number for 'cdo' and 'libcdo0' and click 'Next' to finish installation
From the cygwin terminal, give the following commands for clipping the Netcdf file
(for ex. clipping to region between 72 and 98 E and 20 and 32 N)
cd /cygdrive/file location
cdo -sellonlatbox,72,98,20,32 <input file.nc> <output file.nc>
- Using the clipped files from above, run the example R script (based on this script) to convert to csv format