图解 gma 气候标准化指数运算过程的数组变化流程:以 SPI 为例

目标

【gma 计算 SPI 指数过程中的数据变化】

环境

系统: Window 10+ (X64)
Python 版本: 3.8.8 +
gma 版本: 1.1.0 +

  gma:地理与气象分析库。安装和详细功能帮助见:地理与气象分析库

数据与函数

import gma

在这里插入图片描述

gma 气象与气候模块(gma.climet)目前包含两个标准化指数:SPI 和 SPEI。以 SPI 为例,其参数帮助如下:

help(gma.climet.SPI)
Help on function SPI in module gma.climet:

SPI(PRE, Axis=None, Scale=1, Periodicity=12, Distribution='Gamma')
    Calculate the Standardized Precipitation Index.
    
    Parameters
    ----------
    PRE: array. 
        Precipitation (mm).
    
    **Optional
    ----------
    Axis = int. Default None. 
        Calculation axis. If not set (None), multidimensional data will be expanded to 1 dimension for calculation.
    
    Scale = int. Default 1.
        Time scale. For example: 1, 3 or others.
    
    Periodicity = int. Default 12. 
        Periodicity of data. For example: the monthly scale can have a period of 12.
        
    Distribution = str. Default 'Gamma'.
        Distribution type to be used for the internal fitting/transform computation.
        Supported distributions include: 
    
            'Gamma'(Maximum Likelihood Estimation), 
            
            'LogLogistic'(L-Moment Estimation(PWD)),
            
            'Pearson3'(L-Moment Estimation).
    
    *Note: Scale, Periodicity are based on calculated axis!
    
    Returns
    ----------
    Type: array.
    
    References
    ----------
    McKee T B, Doesken N J, Kleis J. The relationship of drought frequency and duration to time scales[R]. 
    Eighth Conf. on Applied Climatology, Anaheim, CA: American Meteor Society, 1993.

注意:Distribution 参数自 1.1.1 版本引入。SPI 默认 ‘Gamma’ 分布。

计算 SPI

import gma
# 以 Axis = 1 轴,周期为6,(时间尺度默认为 1),计算SPI
SPI = gma.climet.SPI(PRE, Axis = 1, Periodicity = 6)

数组变化过程

请添加图片描述

  • 5
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

洛的地理研学

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值