插值

作者: 榴莲气象 | 来源:发表于2019-06-03 14:13 被阅读0次

If you regrid your data to a coarser lat/lon grid using e.g. bilinear interpolation, this will result in a smoother field.

The NCAR ClimateData guide has a nice introduction to regridding (general, not Python-specific).

The most powerful implementation of regridding routines available for Python is, to my knowledge, the Earth System Modeling Framework (ESMF) Python interface (ESMPy). If this is a bit too involved for your application, you should look into

  1. EarthPy tutorials on regridding (e.g. using Pyresample, cKDTree, or Basemap).
  2. Turning your data into an Iris cube and using Iris' regridding functions.

Perhaps start by looking at the EarthPy regridding tutorial using Basemap, since you are using it already.

The way to do this in your example would be

from mpl_toolkits import basemap
from netCDF4 import Dataset

filename = '/Users/Nick/Desktop/SST/SST.nc'
with Dataset(filename, mode='r') as fh:
   lons = fh.variables['LON'][:]
   lats = fh.variables['LAT'][:]
   sst = fh.variables['SST'][:].squeeze()

lons_sub, lats_sub = np.meshgrid(lons[::4], lats[::4])

sst_coarse = basemap.interp(sst, lons, lats, lons_sub, lats_sub, order=1)

This performs bilinear interpolation (order=1) on your SST data onto a sub-sampled grid (every fourth point). Your plot will look more coarse-grained afterwards. If you do not like that, interpolate back onto the original grid with e.g.

sst_smooth = basemap.interp(sst_coarse, lons_sub[0,:], lats_sub[:,0], *np.meshgrid(lons, lats), order=1)


Cube interpolation and regridding

cressman 第三章插值方法比较
参考
胡金义. 基于ArcGIS的Cressman插值算法研究[A]. 中国水利学会.中国水利学会2010学术年会论文集(上册)[C].中国水利学会:中国水利学会,2010:8.

相关文章

  • 缺失值处理-拉格朗日插值

    常用的插值法有:一维插值法:拉格朗日插值、牛顿插值、分段低次插值、埃尔米特插值、样条插值。二维插值法:双线性插值、...

  • 28. 图像缩放

    插值方法 四种插值,最近邻域插值 双线性插值 像素关系重采样 立方插值其中最近邻域插值、双线性插值原理如下: 1)...

  • 数值分析之插值

    插值 一.基本概念 1.1插值需要研究的问题 插值函数是否存在? 如何构造插值函数? 如何评估误差? 1.2插值法...

  • Less_变量插值

    选择器名插值 属性名插值 URL插值 import插值 媒体查询插值 less的作用域,就近原则,如果自己有这个变...

  • vue.js权威指南第2章——数据绑定

    一: 插值(Mustache标签)1: {{}},插值为数据;变体{{*text}},2: {{{}}} , 插值...

  • 【图像缩放算法】双立方(三次)插值

    当我们进行图像缩放的时候,我们就需要用到插值算法。常见的插值有: 最邻近插值 双线性插值 双立方(三次)插值在这三...

  • AngularJS学习之路——表达式(2)

    插值字符串 插值字符串就是拥有插值标记的字符串 举个栗子 这里的 {{ expr }} 就是插值标记,str 就是...

  • Android动画中篇(插值器、估值器)

    插值器(Interpolator)&估值器(TypeEvaluator) 插值器(Interpolator) 定义...

  • 插值

    格点插值到站点 R = linint2_points_Wrap (precip&lon,precip&lat,pr...

  • 插值#{}

    使用 CSS 预处理器语言的一个主要原因是想使用 Sass 获得一个更好的结构体系。比如说你想写更干净的、高效的和...

网友评论

      本文标题:插值

      本文链接:https://www.haomeiwen.com/subject/adyehqtx.html