当前位置:网站首页>Matlab / ArcGIS 处理GPM全球月均降水数据
Matlab / ArcGIS 处理GPM全球月均降水数据
2022-07-31 23:53:00 【PeanutbutterBoh】
GPM降水数据网站:https://disc.gsfc.nasa.gov/datasets/GPM_3IMERGM_06/summary?keywords=GPM
这个降水数据的空间分辨率是0.1°(大约10km),全球范围包括海洋。
1 数据下载
进入网站后一般选择Subset,因为并不是需要全球区域的降水,可以根据自己的需要来裁剪。不过下载数据之前需要注册,点击网站右上角login会引导到注册界面,进行注册即可。注意一定要记住用户名和密码,后续批量下载的时候需要用到。
注册完成之后,使用subset对数据进行日期选择、区域裁剪等处理,注意如果选择区域裁剪要把Use ‘Refine Region’ for geo-spatial subsetting 给勾选上要不然等于没裁剪得到的数据还是全球区域
2 批量下载数据
我这里获取了南海区域2001年1月到2021年12月的降水数据,点击Get Data。
稍等片刻会出现242个文件下载链接,这么多不可能一个一个点击下载。点击Download links list,会下载一个txt文本文件,这个文件里包含了所有数据的下载链接。
这个时候就需要用IDM来创建任务进行批量下载,如何使用IDM可以自行百度一下。
首先要在IDM选项——站点管理里添加一个授权:站点地址为https://urs.earthdata.nasa.gov,用户名和密码就是刚才注册网站的那个
添加完授权之后,复制txt文件中的所有链接,在IDM里点击任务,选择从剪切板中添加批量下载,会自动识别所有的文件下载链接。
出现error先不用管(如果刚才添加授权没问题的情况下),然后全部选择、改保存路径,直接点确定就可以下载了。下载的时候会自动识别降水数据。
下载完毕后可以进行下一步处理。
3 matlab数据单位转换
首先得用arcgis读取一个nc文件,然后将其转换为tif格式
arcgis中使用创建NetCDF栅格文件工具,然后再将数据导出(以下均使用arcgis pro操作其实都是一样的)
导出tif的时候还要注意数据的维度大小,这个要和后面读取在matlab中的数据大小一致要不然没法用这个地理坐标系来保存数据。
随后就可以在matlab里批量转换单位了,因为我要的是年均降水量,所以直接把一年的12个月进行了合成,不过思路都一样改个代码就行。
clear all; clc
[ncname,ncpath] = uigetfile('.nc4','请选择nc文件可多选','MultiSelect','on');
% ncdisp([ncpath,ncname])
[tifname,tifpath] = uigetfile('.tif','选择tif数据'); % 选择刚才导出的tif文件
[A,GeoRef] = geotiffread([tifpath,tifname]);
k = 1;
for i = 1:numel(ncname)
scs_pr = ncread([ncpath,ncname{
i}],'precipitation');
% 这个数据需要上下翻转一下才是真实的地理分布
scs_pr_true = flipud(scs_pr);
year = str2num(ncname{
i}(21:24));
mon = str2num(ncname{
i}(25:26));
monthd = [31,28,31,30,31,30,31,31,30,31,30,31];
if ((mod(year,4)==0 && mod(year,100)~=0) || mod(year,400)==0)
monthd(2) = 29; % 判断是否闰年
end
mon_days = monthd(mon);
scs_pr_mon(:,:,mon) = scs_pr_true .* 24 .* mon_days; % 得到月均降水数据,单位mm
if mod(mon,12) == 0
scs_pr_year = sum(scs_pr_mon,3); % 求该年降水量
scs_pr_year_k(:,:,k) = scs_pr_year;
exp = ['geotiffwrite(''SCS_Pr_year_',num2str(year),'.tif'',scs_pr_year,GeoRef)'];
eval(exp);
clear scs_pr_mon scs_pr_year;
k = k+1;
end
end
scs_pr_year_mean = mean(scs_pr_year_k,3);
geotiffwrite('SCS_Pr_2001to2020_mean.tif',scs_pr_year_mean,GeoRef); % 得到近20年年平均降水量
最后就可以得到近20年南海年平均降水量啦!!!
4 关于数据的准确性
之前我先试着下载了一下2021年7月和8月的降水数据,并且提取出河南省的范围,计算了一下这个GPM的河南省2021年7月和8月的月降水量,发现还算比较吻合,有些偏高了。
边栏推荐
- vim的基本使用概念
- NIO programming
- The difference between adding or not adding the ref keyword when a variable of reference type is used as a parameter in a method call in C#
- Xinao Learning Plan The Road to Informatics Competition (2022.07.31)
- 编写方法将一个数组扁平化并且去重和递增排序
- Program processes and threads (concurrency and parallelism of threads) and basic creation and use of threads
- 【FPGA教程案例43】图像案例3——通过verilog实现图像sobel边缘提取,通过MATLAB进行辅助验证
- [QNX Hypervisor 2.2 User Manual]9.16 system
- IPD process terminology
- NgRx 里 first 和 take(1) 操作符的区别
猜你喜欢
[Reading Notes -> Data Analysis] 02 Data Analysis Preparation
NIO编程
【云驻共创】【HCSD大咖直播】亲授大厂面试秘诀
Flink 1.13(八)CDC
Google Earth Engine——Error: Image.clipToBoundsAndScale, argument ‘input‘: Invalid type的错误解决
SVN服务器搭建+SVN客户端+TeamCity集成环境搭建+VS2019开发
SVN server construction + SVN client + TeamCity integrated environment construction + VS2019 development
cobaltstrike
NIO programming
基于simulink的Active anti-islanding-AFD主动反孤岛模型仿真
随机推荐
信奥学习规划 信息学竞赛之路(2022.07.31)
thymeleaf iterates the map collection
程序进程和线程(线程的并发与并行)以及线程的基本创建和使用
Flutter教程之 01配置环境并运行demo程序 (教程含源码)
内核对设备树的处理
基于mysql的消息队列设计
SQL注入 Less54(限制次数的SQL注入+union注入)
2022年CSP-J1 CSP-S1 第1轮初赛 报名指南
C# Rectangle基本用法和图片切割
数据分析(一)——matplotlib
One line of code to solve CoreData managed object properties change in SwiftUI problem of animation effects
Design of Fire and Anti-theft System Based on Single Chip GSM
SQL注入 Less46(order by后的注入+rand()布尔盲注)
The difference between adding or not adding the ref keyword when a variable of reference type is used as a parameter in a method call in C#
The uniapp applet checks and prompts for updates
Interview assault 69: TCP reliable?Why is that?
thymeleaf迭代map集合
leetcode:126. 单词接龙 II
mysql having的用法
IPD流程专业术语