CDL文件基本上是一个从netcdf文件文本输出。如果你想知道一个netcdf文件的内容但是没有时间(或能力)用来读/写netcdf使用程序,您可以使用简单的文本输出“ncdump”然后读/写一个基本的文本编辑器。您还可以使用“ncgen”再生netcdf文件基于新的CDL文件。我使用这个过程做简单的改变netcdf文件,和它的工作原理非常迅速而使用编程方法生成netcdf文件。见http://www.atmos.washington.edu/ive/ive_help/writing_netCDF_files.html,引用如下:> CDL(网络常见的数据形式描述语言)文件是一个ASCII descripton netCDF中的二进制数据文件的设计是很容易被人类阅读。CDL文件可以从netCDF生成文件通过“ncdump”命令。例如,> 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 of `ncdump'; 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 file `sample.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