[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: quick mystery to sleuth



> From: address@hidden (Steve Hankin)
> Date: Mon, 6 Oct 1997 14:51:55 -0700
> To: address@hidden
> Subject: quick mystery to sleuth

Hi Steve,

> Sorry to bother you but only a very quick question here ...

No bother.  By the way, I think I saw you here in the Unidata hallway a
couple or three weeks ago, but didn't figure out who that familiar face
I saw was until later, after you were gone ...

> Below is some output that was sent to me by a Ferret user. It is
> reputed to be the output of
> 
>       ncdump b.cdf
> 
> Do you recognize the format of this ncdump output? Is this potentially
> the HDF version of ncdump? Or maybe a NASA-CDF version? Or is my
> Unidata ncdump version so far out of date?

It could have been produced by the current ncdump in netCDF 3.3.1, but
the file must have been produced by netCDF 2.4.3 or earlier.  That's
because the netCDF file has dimensions, variables, and attributes whose
names contain blanks and other characters not acceptable in names for
netCDF components produced by netCDF 3.3.1 and later.  For example, the
first dimension has the name "Dimension of scalar" and the first
variable is named "Bin size in minutes".  One of the changes in netCDF
version 3 was to have the library enforce restrictions on names so that
ncdump would always produce valid CDL.

Something else in the ncdump that looks strange is the data type for the
units attribute.  Evidently the type of the units attribute was
specified as NC_BYTE rather than NC_CHAR when it was defined, because if
it was type NC_CHAR, ncdump would display it as a character string:

    Relative longitude from SE corner of bin:units = "1/65535 of 20 degrees 
relative to south-west corner of bin" ;

instead of using the syntax for attributes of type NC_BYTE:

>   Relative longitude from SE corner of bin:units = '1/', '6',
> '5', '5', '3', '5', ' ', 'o', 'f', ' ', '2', '0', ' ', 'd', 'e', 'g', 'r', 
> 'e',
> 'e', 's', ' ', 'r', 'e', 'l', 'a', 't', 'i', 'v', 'e', ' ', 't', 'o', ' ', 
> 's',
> 'o', 'u', 't', 'h', '-', 'w', 'e', 's', 't', ' ', 'c', 'o', 'r', 'n', 'e', 
> 'r',
> ' ', 'o', 'f', ' ', 'b', 'i', 'n', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
> '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
> '\0', '\0' ;

So, although the netCDF file is legal and will dump out OK with ncdump,
the result is not valid CDL because of the component names, and the type
of the units attribute violates all common conventions.

> ======================================================================
> 
> netcdf b {
> dimensions:
>       Dimension of scalar = 1 ;
>       Dimension of bin arrays = 162 ;
>       Dimension of segment arrays = 1231 ;
>       Dimension of point arrays = 4534 ;
> variables:
>       int Bin size in minutes(Dimension of scalar) ;
>       int N bins in 0-360 longitude range(Dimension of scalar) ;
>       int N bins in -90 +90 latitude range(Dimension of scalar) ;
>       int N bins in file(Dimension of scalar) ;
>       int N segments in file(Dimension of scalar) ;
>       int N points in file(Dimension of scalar) ;
>       int Id of first segment in a bin(Dimension of bin arrays) ;
>       short N segments in a bin(Dimension of bin arrays) ;
>       short N points for a segment(Dimension of segment arrays) ;
>       short Hierarchial level of a segment(Dimension of segment arrays) ;
>       int Id of first point in a segment(Dimension of segment arrays) ;
>       short Relative longitude from SE corner of bin(Dimension of point
> arrays) ;
>               Relative longitude from SE corner of bin:units = '1/', '6',
> '5', '5', '3', '5', ' ', 'o', 'f', ' ', '2', '0', ' ', 'd', 'e', 'g', 'r', 
> 'e',
> 'e', 's', ' ', 'r', 'e', 'l', 'a', 't', 'i', 'v', 'e', ' ', 't', 'o', ' ', 
> 's',
> 'o', 'u', 't', 'h', '-', 'w', 'e', 's', 't', ' ', 'c', 'o', 'r', 'n', 'e', 
> 'r',
> ' ', 'o', 'f', ' ', 'b', 'i', 'n', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
> '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
> '\0', '\0' ;
>       short Relative latitude from SE corner of bin(Dimension of point
> arrays) ;
>               Relative latitude from SE corner of bin:units = '1', '/', '6',
> '5', '5', '3', '5', ' ', 'o', 'f', ' ', '2', '0', ' ', 'd', 'e', 'g', 'r', 
> 'e',
> 'e', 's', ' ', 'r', 'e', 'l', 'a', 't', 'i', 'v', 'e', ' ', 't', 'o', ' ', 
> 's',
> 'o', 'u', 't', 'h', '-', 'w', 'e', 's', 't', ' ', 'c', 'o', 'r', 'n', 'e', 
> 'r',
> ' ', 'o', 'f', ' ', 'b', 'i', 'n', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
> '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
> '\0', '\0' ;
> 
> // global attributes:
>               :title = 'P', 'o', 'l', 'i', 't', 'i', 'c', 'a', 'l', ' ', 'b',
> 'o', 'u', 'n', 'd', 'a', 'r', 'i', 'e', 's', ' ', 'd', 'e', 'r', 'i', 'v', 
> 'e',
> 'd', ' ', 'f', 'r', 'o', 'm', ' ', 'C', 'I', 'A', ' ', 'W', 'D', 'B', '-', 
> 'I',
> 'I', ' ', 'd', 'a', 't', 'a', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
> '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
> '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0' ;
>               :source = 'P', 'r', 'o', 'c', 'e', 's', 's', 'e', 'd', ' ',
> 'b', 'y', ' ', 'P', 'a', 'u', 'l', ' ', 'W', 'e', 's', 's', 'e', 'l', ' ', 
> 'a',
> 'n', 'd', ' ', 'W', 'a', 'l', 't', 'e', 'r', ' ', 'H', '.', ' ', 'F', '.', ' 
> ',
> 'S', 'm', 'i', 't', 'h', ',', ' ', '1', '9', '9', '4', '\0', '\0', '\0', '\0',
> '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
> '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0' ;
> data:
> 
>  Bin size in minutes = 1200 ;
> 
>  N bins in 0-360 longitude range = 18 ;
> 
>  N bins in -90 +90 latitude range = 9 ;
> 
>  N bins in file = 162 ;
> 
>  N segments in file = 1231 ;
> 
>  N points in file = 4534 ;
> 
>  Id of first segment in a bin = 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3,
>     3, 3, 3, 3, 14, 21, 21, 21, 23, 26, 28, 28, 29, 30, 31, 38, 46, 50, 60,
>     62, 62, 63, 92, 127, 138, 147, 153, 158, 171, 171, 171, 171, 171, 178,
>     229, 362, 419, 419, 419, 425, 443, 453, 478, 482, 492, 514, 514, 517,
>     519, 519, 519, 519, 540, 655, 689, 689, 689, 716, 737, 755, 758, 758,
>     760, 766, 767, 771, 776, 783, 793, 794, 794, 815, 931, 970, 976, 987,
>     992, 1022, 1023, 1023, 1023, 1023, 1023, 1027, 1034, 1044, 1048, 1051,
>     1051, 1051, 1106, 1159, 1163, 1163, 1163, 1166, 1166, 1166, 1166, 1166,
>     1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1204, 1226, 1226, 1226,
>     1226, 1226, 1226, 1226, 1226, 1226, 1226, 1226, 1226, 1226, 1226, 1226,
>     1226, 1226, 1231, 1231, 1231, 12
> .
> .
> .

--Russ

_____________________________________________________________________

Russ Rew                                         UCAR Unidata Program
address@hidden                     http://www.unidata.ucar.edu