当前位置:网站首页>Matlab/Arcgis processing nc data
Matlab/Arcgis processing nc data
2022-08-01 00:02:00 【PeanutbutterBoh】
nc files are more common now, and there are many ways to process them, such as python, matlab, arcgis, and R.This blog mainly writes about the joint processing of nc with arcgis and matlab. It may be a bit complicated but it is a relatively basic operation, and it can also understand some of the principles inside the nc file.
The following are some examples of my operations, you can refer to the processing ideas of different data
Matlab/ArcGIS processing GPM global monthly precipitation data
Arcpy / Matlab / Arcgis processing CMIP6 data
matlab synthesizes multiple nc files into TIF
Directory
Different types of 1 nc files
There are only two types I have seen and processed. One is the nc file of the raster class (Raster), which is very easy to handle because its data points are all equally spaced.Projection; one is the nc file of the feature class (Feature), which is more troublesome because the spacing between its data points is not equal (such as the CMIP6 data blog above).How to distinguish these two kinds of data?You can use matlab to read their latitude and longitude data,
clear all; clc[ncname,ncpath] = uigetfile('*.*','Please select nc file');ncdisp([ncpath,ncname])lat = ncread([ncpath,ncname],'latitude');lon = ncread([ncpath,ncname],'longitude');If the latitude and longitude data of the data is a one-dimensional matrix, then it is a raster;
If the latitude and longitude data is a two-dimensional matrix, it is a feature class.
2 arcgis read nc file
After knowing what type of nc is, find the Multidimension Tool - NetCDF in arcgis (I use arcgis pro to show that both are the same), you can see two tools: Create NetCDF Raster (Make NetCDF Raster Layer) and Create NetCDF Feature (Make NetCDF Feature Layer).Which one to choose depends on the type of your nc data: Raster for raster, and Feature for feature.
What if I don't know what type it is?Then select Raster Raster directly, and the result is a raster. If the result cannot be obtained, an error will be reported, indicating that it is a feature, and it is replaced by a feature class tool.
3 raster class nc processing
3.1 arcgis processing raster class nc
The raster class is easier to handle, directly open the Make NetCDF Raster Layer (Make NetCDF Raster Layer), and then select the nc file, the variable, x, y will generally be automatically selected, you can also switch your own variable, the dimension value is generallySelect the time time, and then run to appear a raster layer.Then export this raster layer.
Export result:
But this method can only export raster data of one time point, and nc is generally multi-dimensional time, so how to export it in batches?
3.2 matlab processing raster nc
It is relatively simple for matlab to process this kind of raster nc. Directly ncread reads the variable in, and then thinks how to deal with it (average, do EOF, etc.).
Some functions mainly used in matlab: ncread: mainly read the data in the nc file, ncdisp: display some information of the nc file
But there are several points to pay attention to when processing matlab:
The first is the spatial distribution of the data after reading in: (the original text is here The realization of matlab empirical orthogonal decomposition function EOF-based on Climate Data Toolbox operation)
At that time, my research area was the South China Sea. It can be seen that after I read in the sea temperature data, it was reversed, becomingIf you have a horizontal state (you can find a special location in your research area, for example, I can see that Hainan Island is in a horizontal state), then you need to perform a process on the data you read in, which can be transposition orUse flipud to flip up and down, etc.
The second is about data export, for example, I have anc file, it is the 20-year monthly average SST data in the South China Sea. I have read it in matlab now, and I want to get the average 20-year annual average SST data in the South China Sea. What if I want to export this data as tif?
The idea is this: you first read this nc in arcgis and export a tif file as a reference tif (what we want is the geographic coordinate system of this tif), and then use geotiffread to read this in matlabRefer to tif, and finally use geotiffwrite to save the 20-year annual average SST of the South China Sea.
Some people use the georasterref that comes with matlab to create the geographic coordinate system of tif. I have not tried it. I am worried that there will be offsets and the like, so the above method is a little troublesome.
4 Feature Class nc Processing
This kind of nc cannot be processed by matlab, only arcgis can be used. If you want to batch process, you need to use python.
For detailed operations, you can see this blog, which is an example. You can refer to the idea:
Arcpy/Matlab/Arcgis processing CMIP6 data
边栏推荐
- SQL注入 Less38(堆叠注入)
- [MATLAB project combat] LDPC-BP channel coding
- 开源好用的 流程图绘制工具 drawio
- 简单的vim配置
- 信奥学习规划 信息学竞赛之路(2022.07.31)
- UOS统信系统 - WindTerm使用
- (26) About menu of the top menu of Blender source code analysis
- Carefully organize 16 MySQL usage specifications to reduce problems by 80% and recommend sharing with the team
- TypeScript 的组件
- [Reading Notes -> Data Analysis] 02 Data Analysis Preparation
猜你喜欢
随机推荐
Keil nRF52832 download failed
面试突击69:TCP 可靠吗?为什么?
(26) About menu of the top menu of Blender source code analysis
新产品如何进行网络推广?
cobaltstrike
Program processes and threads (concurrency and parallelism of threads) and basic creation and use of threads
C# Rectangle基本用法和图片切割
【1161. 最大层内元素和】
SQL注入 Less46(order by后的注入+rand()布尔盲注)
硬件设备计算存储及数据交互杂谈
Usage of mysql having
How to Design High Availability and High Performance Middleware - Homework
编译型语言和解释型语言的区别
Keil nRF52832下载失败
博弈论(Depu)与孙子兵法(42/100)
To help the construction of digital government, the three parties of China Science and Technology build a domain name security system
如何撰写出一篇优质的数码类好物推荐文
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#
IPD流程专业术语
一行代码解决CoreData托管对象属性变更在SwiftUI中无动画效果的问题









