python处理era5_ERA5数据python批量下载程序

入门教程见链接:

ERA5数据python下载教程(Windows用户)

https://www.jianshu.com/writer#/notebooks/41463838/notes/57922523

例子为批量下载ERA5数据2007-2015年总降雨量的日数据,根据日历动态调整每月天数

import cdsapi

import calendar

c = cdsapi.Client()

for year in range(2007, 2016):

for j in range(1,13):

monthRange = calendar.monthrange(year,j)

for k in range(1, monthRange[1]+1):

c.retrieve(

'reanalysis-era5-single-levels',

{

'product_type': 'reanalysis',

'variable': 'total_precipitation',

'year':str(year),

'month':("%02d" % j),

'day':[

("%02d" % k)

],

'time': [

'00:00', '01:00', '02:00',

'03:00', '04:00', '05:00',

'06:00', '07:00', '08:00',

'09:00', '10:00', '11:00',

'12:00', '13:00', '14:00',

'15:00', '16:00', '17:00',

'18:00', '19:00', '20:00',

'21:00', '22:00', '23:00',

],

'format': 'netcdf',

},

'rain'+str(year)+("%02d" % j)+("%02d" % k)+'.nc')

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值