当前位置:网站首页>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
边栏推荐
猜你喜欢

C# Rectangle基本用法和图片切割

2022年最新重庆建筑八大员(电气施工员)模拟题库及答案

【云驻共创】【HCSD大咖直播】亲授大厂面试秘诀

pycaret源码分析:下载数据集\Lib\site-packages\pycaret\datasets.py

Recommendation system: Summary of common evaluation indicators [accuracy rate, precision rate, recall rate, hit rate, (normalized depreciation cumulative gain) NDCG, mean reciprocal ranking (MRR), ROC

MLP神经网络,GRNN神经网络,SVM神经网络以及深度学习神经网络对比识别人体健康非健康数据
Mysql environment installation under Linux (centos)

自动化机器学习pycaret: PyCaret Basic Auto Classification LightGBM

浏览器下载快捷方式到桌面(PWA)

Shell common script: Nexus batch upload local warehouse script
随机推荐
Thinking and Implementation of Object Cache Service
浏览器下载快捷方式到桌面(PWA)
thymeleaf iterates the map collection
面试题:实现死锁
【MATLAB项目实战】LDPC-BP信道编码
How to Design High Availability and High Performance Middleware - Homework
精心总结十三条建议,帮你创建更合适的MySQL索引
编程语言是什么
命名实体识别-模型:BERT-MRC
@JsonFormat(pattern="yyyy-MM-dd") time difference problem
Flutter教程之 01配置环境并运行demo程序 (教程含源码)
继承和友元,静态成员的关系
[1161. The maximum sum of elements in the layer]
IPD流程专业术语
信奥学习规划 信息学竞赛之路(2022.07.31)
一体化步进电机在无人机自动机场的应用
SQL injection Less47 (error injection) and Less49 (time blind injection)
Input and output optimization
UOS统信系统 - WindTerm使用
Daily--Kali opens SSH (detailed tutorial)