前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >在线处理ERA-5数据(提取时序数据)

在线处理ERA-5数据(提取时序数据)

作者头像
GIS与遥感开发平台
发布2022-12-03 09:57:18
2.2K1
发布2022-12-03 09:57:18
举报

在线处理ERA-5数据(提取时序数据)

ERA-5数据是由ECMWF推出的一套再分析数据,其空间分辨率能达到0.25度,ERA5-Land可以达到0.1度。这个数据对做遥感、气象都很有用处。 不过由于是逐小时的数据导致数据量巨大,庞大的数据量使得我们下载、存储以及处理都成为很大的问题。 最近ECMWF推出了Climate Data Store(CDS) Toolbox ,可在线处理ERA-5, ERA5-Land、CMIP等数据,并将处理结果下载到本地。Climate Data Store(CDS)。网址为:https://cds.climate.copernicus.eu/#!/home

CDS Toolbox

如上图所示,Toolbox最左边类似于GEE包括写好的代码、文档以及CDS包含的数据集,中间为代码编写的区域,最左边为输出结果的区域。

提取ERA-5某地的时序数据

下面我们来举个例子,利用CDS Toolbox提取某个经纬度的时序数据。

代码语言:javascript
复制
import cdstoolbox as ct

@ct.application(title='Extract point')
@ct.output.download()
@ct.input.text('lon', label='Longitude', type=float, default=75., description='Decimal degrees')
@ct.input.text('lat', label='Latitude', type=float, default=43., description='Decimal degrees')
 
def extract_time_series(lon, lat):
    """
    Application main steps:

    - set the application layout with 3 columns for the input and output at the bottom
    - retrieve a variable over a defined time range
    - select a location, defined by longitude and latitude coordinates

    """
    data = ct.catalogue.retrieve(
        'reanalysis-era5-single-levels',
        {
            'variable': '2m_temperature',
            'product_type': 'reanalysis',
            'year': [
                '2008', '2009', '2010',
                '2011', '2012', '2013',
                '2014', '2015', '2016',
                '2017'
            ],
            'month': [
                '01', '02', '03', '04', '05', '06',
                '07', '08', '09', '10', '11', '12'
            ],
            'day': [
                '01', '02', '03', '04', '05', '06',
                '07', '08', '09', '10', '11', '12',
                '13', '14', '15', '16', '17', '18',
                '19', '20', '21', '22', '23', '24',
                '25', '26', '27', '28', '29', '30',
                '31'
            ],
            'time': ['00:00', '06:00', '12:00', '18:00'],
        }
    )

    # Location selection

    # Extract the closest point to selected lon/lat (no interpolation).
    # If wrong number is set for latitude, the closest available one is chosen:
    # e.g. if lat = 4000 -> lat = 90.
    # If wrong number is set for longitude, first a wrap in [-180, 180] is made,
    # then the closest one present is chosen:
    # e.g. if lon = 200 -> lat = -160.
    data_sel = ct.geo.extract_point(data, lon=lon, lat=lat)
    csv_data=ct.cdm.to_csv(data_sel)

    return csv_data

输出结果

运行代码以后右图就会出现数据的下载链接,我们把数据下载以后截个图吧!

ERA-5气温数据

这样我们就避免了下载海量的ERA-5栅格数据。

如果我们使用传统的方法,把数据下载之后再进行提取就会是一个非常痛苦的过程。数据下载过程会非常慢,同时硬盘资源也会非常吃紧。ERA-5这些数据在GEE上面不全,有时候很难用GEE获取自己想要的数据。因此CDS也算是弥补了一部分空缺。 现在遥感以及气象数据在线处理也算是一种趋势,自己在本地机上处理如此海量的数据也会变得越来越困难。

如果你也想用CDS实现一些有趣的功能,也可以随时留言探讨呀!

本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2022-07-29,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 GIS与遥感开发平台 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 在线处理ERA-5数据(提取时序数据)
    • 提取ERA-5某地的时序数据
    领券
    问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档