简体   繁体   English

使用 python 下载网格 CHIRPS 数据集

[英]Downloading Gridded CHIRPS data sets using python

I am working with Satellite Gridded dataset from CHIRPS, Here is the link to the dataset: https://data.chc.ucsb.edu/products/CHIRPS-2.0/ working specifically with the African Daily dataset: https://data.chc.ucsb.edu/products/CHIRPS-2.0/africa_daily/tifs/p25/ , The data spans from 1981 to 2020, The Idea is to download the data using the url and be able to work with it, I have not worked with image or Satellite data before, and would appreciate it if I can get any help on how to approach this.我正在使用来自 CHIRPS 的卫星网格数据集,这是数据集的链接: https://data.chc.ucsb.edu/products/CHIRPS-2.0/专门处理非洲日报数据集: https://data。 chc.ucsb.edu/products/CHIRPS-2.0/africa_daily/tifs/p25/ ,数据从 1981 年到 2020 年,想法是使用 url 下载数据并能够使用它,我没有使用过以前的图像或卫星数据,如果我能得到任何关于如何处理这个问题的帮助,我将不胜感激。 thanks谢谢

It would be better for you to work with CHIRPS.netcdf dataset.最好使用 CHIRPS.netcdf 数据集。

In this solution, I clipped the CHIRPS global dataset using the boundaries (xmin xmax ymin and ymax) of my study area ie Ghana.在此解决方案中,我使用我的研究区域(即加纳)的边界(xmin xmax ymin 和 ymax)裁剪了 CHIRPS 全球数据集。

#load modules
import numpy as np
import pandas as pd
import xarray as xr
# load chirps global monthly precipitation data
!wget https://data.chc.ucsb.edu/products/CHIRPS-2.0/global_monthly/netcdf/chirps-v2.0.monthly.nc
# load chirps precipitation data
chirps = xr.open_dataset('/content/chirps-v2.0.monthly.nc')
# select precipitation variable
pr = chirps['precip']

# select boundaries (xmin, xmax, ymin and ymax) and time period of interest
pr_ghana = pr.sel(longitude=slice(-3.3,1.2), latitude=slice(4.7,11.2),time=slice('1981','2020'))
# save clipped data
pr_ghana.to_netcdf('/content/chirps-v2.0.monthly_ghana.nc')

The nectcdf file should be easy to manipulate using xarray! nectcdf 文件应该很容易使用 xarray 进行操作!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM