数据介绍

GPM数据分为两类

  1. 观测后4小时与十四小时的逐半小时0.1x0.1资料
  2. 观测后3.5月后的逐月0.1x0.1资料

数据处理

  1. 将观测资料进行质量控制,筛除缺测,通过时间对缺测全天的数据索引进行标记,之后将GPM资料做相同处理,进行相关系数等的计算
  2. 论文中讲述顺序要由大到小,由总体到局部

脚本留档

import numpy as np
import matplotlib.pyplot as plt
from matplotlib.pyplot import MultipleLocator
from matplotlib.ticker import FuncFormatter
import os
import cartopy.crs as ccrs
from cartopy.io.shapereader import Reader
import cartopy.feature as cfeat
import xarray as xr
import matplotlib as mpl
import h5py
from scipy import interpolate as ip
import shapefile
from matplotlib.path import Path
from matplotlib.patches import PathPatch
mpl.rcParams['font.family'] = 'sans-serif'
mpl.rcParams['font.sans-serif'] = ['Times New Roman']
mpl.rcParams['axes.unicode_minus'] = False
def to_latitude(temp, position):
    return '%1.0f'%(temp) + '°N'
def to_longtitude(temp,position):
    return '%1.0f'%(temp)+ '°E'
def to_time(temp,position):
    if temp < 10:
        return '0'+'%1.0f'%(temp)+':00'
    return '%1.0f'%(temp)+':00'         ##转换坐标轴
def countLine(file_path): 
    count = -1
    for count,line in enumerate(open(file_path,'r')):
        pass
        count += 1
    return count


def shp2clip(originfig, ax, shpfile, regionlist):  #白化函数 将contour在shp区域外转为白色
    sf = shapefile.Reader(shpfile)
    vertices = []
    codes = []
    for shape_rec in sf.shapeRecords():
        region_name = shape_rec.record[0] #是否是[0]得自行分析自己的shp文件
        if region_name in regionlist: 
            pts = shape_rec.shape.points
            prt = list(shape_rec.shape.parts) + [len(pts)]
            for i in range(len(prt) - 1):
                for j in range(prt[i], prt[i+1]):
                    vertices.append((pts[j][0], pts[j][1]))
                codes += [Path.MOVETO]
                codes += [Path.LINETO] * (prt[i+1] - prt[i] -2)
                codes += [Path.CLOSEPOLY]
            clip = Path(vertices, codes)
            clip = PathPatch(clip, transform=ax.transData)
    for contour in originfig.collections:
        contour.set_clip_path(clip)

    return clip
##shp2clip(tt,ax,sy,['辽宁省'])