当前位置: 首页 > news >正文

【matlab程序】matlab利用工具包nctool读取grib2、nc、opendaf、hdf5、hdf4等格式数据

【matlab程序】matlab利用工具包nctool读取grib2、nc、opendaf、hdf5、hdf4等格式数据
引用:
B. Schlining, R. Signell, A. Crosby, nctoolbox (2009), Github repository, https://github.com/nctoolbox/nctoolbox

Brief summary:
nctoolbox is a Matlab toolbox that provides read-only access to common data model datasets. Under the hood, nctoolbox uses NetCDF-Java as the data access layer. This allows nctoolbox to access NetCDF, OPeNDAP, HDF5, GRIB, GRIB2, HDF4 and many (15+) other file formats and services using the same API. It works with Matlab 2008a and later.
更多内容请点击阅读原文!
工具包下载地址:https://github.com/nctoolbox/nctoolbox

工具包介绍:NCTOOLBOX Tools for read-only access to Common Data Model dataset.

版本: Version 1.1.1-13-g8582810++ 12-03-2015

文件或函数的功能:

01: setup_nctoolbox - sets your path and classpath to access the nctoolbox functions

02:cfdataset - Provide access to CF/COARDS convention datasets accessable by the

03: ncdataset - Provide access to datasets accessable by the NetCDF 4 API

04: ncgeodataset - NCGEODATASET

05:ncgeovariable - Provide advanced access to variables and their related

06: nctoolbox_info - nctoolbox_info Provide information on the NCTOOLBOX version and dependencies

07: ncugrid - Extention of dataset object class for unstructured grid datasets.

08: ncuvariable - Extention of variable object class for unstructured grid/mesh variables.

09 ncvariable - Provide advanced access to variables and their related

简单例子:

本次数据来源于:fnl.
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

clc;clear;close all
cd nctoolbox-master/
setup_nctoolbox
cd ..
data=ncgeodataset('fnl_20090601_00_00.grib2');
data.variables
% Extract the Temperature_surface
param='Temperature_surface';
air_temperature=data{param}(1,:,:);
lat=data{'lat'}(:);
lon=data{'lon'}(:);
% From this point on the code is identical to the previous example:
air_temperature=double(squeeze(air_temperature));
lat=double(lat);
lon=double(lon)-180;
%% figure
close all
figure
m_proj('Equidistant Cylindrical','lon',[-180 180],'lat',[-90 90]);
m_contourf(lon,lat,air_temperature-273.15,1000,'linestyle','none');
m_coast('patch',[0.1 .85 .7],'edgecolor',[0 0 0],'linewidth',1);
m_grid('ytick',[-90:30:90],'xtick',[-180:60:180],'tickdir','out','linest','none','fontname','Times','fontsize',12,'linewidth',1.5);
% 调用ncl色带
rainbow_r=textread('D:\matlab_work\函数名为colormore的颜色索引表制作\ncl_color_txt\BlueWhiteOrangeRed.txt');
colormap(rainbow_r(:,1:3));
hold on
c=colorbar('eastoutside','ticklength',0);
clim([-60,40])
% 调整colorbar
ax = gca;
axpos = ax.Position;
c.Position(3) = 0.5*c.Position(3);
ax.Position = axpos;
cbarrow;
title('nctoolbox read grib2');
xlabel({'time:20231125','海洋与大气科学'})
export_fig('12nctoolbox read grib2.png','-r300')
http://www.lryc.cn/news/249357.html

相关文章:

  • pytorch训练模板
  • 代码随想录二刷 |字符串 |反转字符串
  • Rust语言入门教程(九) - 结构体
  • 如何使用Qchan搭建更好保护个人隐私的本地图床并在公网可访问
  • AI伪原创软件-AI伪原创工具下载
  • 【python脚本】获取OneNET数据写入本地文件
  • 5 存储器映射和寄存器
  • 决策树学习
  • 如何在Ubuntu系统上安装Git
  • Leetcode.974 和可被 K 整除的子数组
  • Vue打包错误UnhandledPromiseRejectionWarning: CssSyntaxError
  • 鸿蒙系统扫盲(三):鸿蒙开发用什么语言?
  • linux 中vmalloc实现简述
  • homeassistant 随笔
  • 带大家做一个,易上手的家常炒鸡蛋
  • 芒格传奇落幕!生前最后一次谈论比特币,说了什么?
  • Springboot如何快速生成分页展示以及统计条数
  • 数据结构:图文详解顺序表的各种操作(新增元素,查找元素,删除元素,给指定位置元素赋值)
  • 2023 年 IntelliJ IDEA下载、安装教程,附详细图文
  • C++——解锁string常用接口
  • Stable Video Diffusion(SVD)参数使用教程
  • 【传智杯】排排队、小卡与质数 2、1024 程序员节发橙子题解
  • Oracle
  • 2023年c语言程序设计大赛
  • 9.vue3项目(九):spu管理页面的新增和修改
  • 人工智能:让生活更便捷、更智能——探讨人工智能在生活中的作用与挑战
  • 【C++】类和对象——const修饰成员函数和取地址操作符重载
  • express+mySql实现用户注册、登录和身份认证
  • 【PyTorch】(二)加载数据集
  • 如何提高3D建模技能?