NetCDF简介

NetCDF,即网络通用数据格式,是一种专为科学数据设计的文件格式标准,由美国大学大气研究协会开发。该格式适用于网络共享的大规模数组数据,广泛应用于大气科学、水文、海洋学等领域。NetCDF文件通过定义维、变量和属性来组织数据,可使用ncdump命令进行读取。

一、概述

NetCDF全称为network Common Data Format,中文译法为“网络通用数据格式”,它是由美国大学大气研究协会的Unidata项目科学家针对科学数据的特点开发的,是一种面向数组型并适于网络共享的数据描述和编码标准。

NetCDF和zip、jpeg、bmp文件格式类似,都是一种文件格式的标准。NetCDF文件开始时目的是用于存储气象科学中的数据,现在已经成为许多数据采集软件生成文件的格式。利用NetCDF可以对网络数据进行高效地存储、管理、获取和分发等操作。由于其灵活性,能够传输海量的面向阵列(array-oriented)数据,目前广泛应用于大气科学、水文、海洋学、环境模拟、地球物理等诸多领域。

从数学上来说,netcdf存储的数据就是一个多自变量的单值函数。用公式来说就是f(x,y,z,…)=value,函数的自变量x,y,z等在netcdf中叫做维(dimension)或坐标轴(axis),函数值value在netcdf中叫做变量(Variables)。而自变量和函数值在物理学上的一些性质,比如计量单位(量纲)、物理学名称等等在netcdf中就叫属性(Attributes)。

二、文件格式

NetCDF文件后缀为.nc,文件中的数据结构包含维(dimensions)、变量(variables)和属性(attributes)三种描述类型。

可以使用ncdump 命令读取并输出nc文件里的内容。
例如:


netcdf simple_xy {
dimensions:
	x = 2 ;
	y = 3 ;
variables:
	int simple_data(x, y);
	simple_data: description = "Simple XY"
data:
	simple_data =
		11, 12, 13,
		21, 22, 23;
}

三、ncdump命令

参数说明
[-c]Coordinate variable data and header information
[-h]Header information only, no data
[-v var1[,…]]Data for variable(s) ,… only
[-b [c|f]]Brief annotations for C or Fortran indices in data
[-f [c|f]]Full annotations for C or Fortran indices in data
[-l len]Line length maximum in data section (default 80)
[-n name]Name for netCDF (default derived from file name)
[-p n[,n]]Display floating-point values with less precision
[-k]Output kind of netCDF file
[-s]Output special (virtual) attributes
[-t]Output time data as date-time strings
[-i]Output time data as date-time strings with ISO-8601 ‘T’ separator
[-g grp1[,…]]Data and metadata for group(s) ,… only
[-w]With client-side caching of variables for DAP URLs
[-x]Output XML (NcML) instead of CDL
[-Xp]Unconditionally suppress output of the properties attribute
[-Ln]Set log level to n (>= 0); ignore if logging not enabled.
fileName of netCDF file (or URL if DAP access enabled)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值