CDL文件问题——地球科学堆栈交换江南电子竞技平台江南体育网页版 最近30从www.hoelymoley.com 2023 - 07 - 10 - t06:00:22z //www.hoelymoley.com/feeds/question/4648 https://creativecommons.org/licenses/by-sa/4.0/rdf //www.hoelymoley.com/q/4648 8 CDL文件问题 user4624937 //www.hoelymoley.com/users/2645 2015 - 04 - 03 - t15:47:17z 2017 - 08 - 23 - t11:17:25z < p >我很困惑到底CDL文件和它的目的是什么。< a href = " http://www.unidata.ucar.edu/software/netcdf/netcdf/CDL-Syntax.html " rel = " nofollow noreferrer " > Unidata < / >指定的语法CDL文件在< a href = " http://www.unidata.ucar.edu/software/netcdf/netcdf/CDL-Syntax.html " rel = " nofollow noreferrer " > < / > netCDF文档。< / p > < p >问题:< br > CDL文件用来打开一个简单的文本编辑器,比如Notepad或中?或者我应该使用其他工具来打开它吗?< / p > < p >什么是它的目的和如何使用? < / p > //www.hoelymoley.com/questions/4648/-/4649 # 4649 10 答案由f。索普CDL文件的问题 f.thorpe //www.hoelymoley.com/users/543 2015 - 04 - 03 - t16:02:41z 2015 - 04 - 03 - t19:02:20z < p > CDL文件基本上是一个从netcdf文件文本输出。如果你想知道一个netcdf文件的内容但是没有时间(或能力)用来读/写netcdf使用程序,您可以使用简单的文本输出“ncdump”然后读/写一个基本的文本编辑器。您还可以使用“ncgen”再生netcdf文件基于新的CDL文件。我使用这个过程做简单的改变netcdf文件,和它的工作原理非常迅速而使用编程方法生成netcdf文件。< / p > < p >看到< a href = " http://www.atmos.washington.edu/ive/ive_help/writing_netCDF_files.html " rel = " noreferrer " > http://www.atmos.washington.edu/ive/ive_help/writing_netCDF_files.html < / >,引用如下:< / p > < blockquote > < p > CDL(网络常见的数据形式描述语言)文件是一个ASCII descripton netCDF中的二进制数据文件的设计是很容易被人类阅读。CDL文件可以从netCDF生成文件通过“ncdump”命令。例如,< / p > < p > ncdump - c样品。数控生成文件的示例。cdl的包含文件名称,尺寸,变量的规范,任何属性和数据“坐标变量。”A CDL file of this type is shown below. Note that the double slash indicates a comment in the CDL file.

netcdf implicit_grid{

dimensions: lon = 101; lat = 101; level = 5; time = UNLIMITED ; //(7 currently) variables:

float A(time,level,lat,lon); A:units = "meters/second"; float level(level);

level:units = "millibars"; float time(time);

time:units = "hours"; //global attributes:

:x_min = -180.f; :x_max = 180.f; :x_units = "degrees_east"; :x_label = "longitude"; :y_min = -90.f; :y_max = 90.f; :y_units = "degrees_north"; :y_label = "latitude";

:z_label = "level"; :t_label = "time";

data: level = 1000, 850, 700, 500, 300 ; time = 0, 2, 4, 6, 8, 10, 12 ;

The command ncgen' is the inverse ofncdump'; it converts an ASCII CDL file to a binary netCDF file. For example

ncgen -o sample.nc sample.cdl converts the CDL file sample.cdl' to the netCDF filesample.nc'. The easiest way to create a netCDF file is to (1) write all the header data (the name, dimensions, variable and attribute specifications, and the values of any coordinate variables) to a CDL file, (2) convert the CDL file to a netCDF file using ncgen, and (3) continue writing the main data arrays to this netCDF file.

Baidu
map