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

[netCDF #COA-518203]: Help with CDL files



Hi Misha,

As Dennis has pointed out, your current CDL declares two 4-dimensional
arrays

        float salinity(time, pressure, latitude, longitude) ;
                salinity:long_name = "salinity" ;
                salinity:units = "pss (practial salinity scale)" ;
        float oxygen(time, pressure, latitude, longitude) ;
                oxygen:long_name = "oxygen" ;
                oxygen:units = "umol/kg" ;

which says that there is a salinity and oxygen value for each
possible combination of (time, pressure, latitude, and longitude), but
that is not the intended structure of the data.

Instead, you really have 1- or 2-dimensional arrays of data, depending
on whether you want to model them as

 - rectangular arrays (same number of depths in each location, wasting
   some space)

 - "ragged arrays" (different number of depths at each location, no
   space is wasted)

 - linked lists (allows extending profiles with new data without
   knowing the maximum number of depths)

These three alternatives for representing this kind of data (often
described as "profile" or "sounding" data) are described under the
netcdf-java documentation, using an informal CDL:

  
http://www.unidata.ucar.edu/software/netcdf-java/formats/UnidataObsConvention.html

and in the section on "Using Records for Sounding Data" here:

  
http://www.unidata.ucar.edu/software/netcdf-java/formats/RecordsInNetcdf3.html#Sounding

There is a current discussion on standardizing the conventions for
representing this kind of data under the CF Metadata Conventions site
at

  https://cf-pcmdi.llnl.gov/trac/ticket/37

As an example of one of these apporaches, to model your data as
rectangular arrays using the maximum number of depths at any location
as the row length, then the CDL might be something like this:

  dimensions:
    time = unlimited ; // 12 currently
    soundings = 59;
    depth = 36;        // max number of depths for any sounding
  variables:
    float latitude(sounding);
    float longitude(sounding);
    int time(sounding);
    int woce_date(sounding);
    float pressure(sounding, depth);
    float salinity(sounding, depth);
    float oxygen(sounding, depth);
  data:
   ...
    pressure =
     // 1st sounding (for rectangular array, with fill values)
        3.4,    46.9,    87.4,   130.9,   182.6,   232.5,
      306.3,   382.7,   458.2,   558.3,   657.5,   756.2,
      854.6,   955.9,  1055.6,  1208.6,  1361.2,  1513.5,
     1716.2,  1919.4,  2121.8,  2324.7,  2528.2,  2731.6,
     2933.8,  3136.4,  3218.4,       _,       _,       _,
          _,       _,       _,       _,       _,       _,
     // 2nd sounding
        3.9,    25.6,    44.8,    65.5,   105.4,   155.9,
      206.6,   255.1,   255.2,   306.2,   406.4,   507.6,
      608.3,   708.5,   809.2,   909.7,  1010.5,  1111.1,
     1211.6,  1312.4,  1413,    1513.4,  1714.6,  1916.4,
     2021.4,       _,       _,       _,       _,       _,
          _,       _,       _,       _,       _,       _,
   ...
     // last (59th?) sounding (happens to have max 36 depths)
        3.7,    33.9,    88.7,   138.8,   209.2,   289.7,
      369.5,   449.9,   530.2,   610.2,   710.9,   810.8,
      911,    1010.5,  1110.9,  1211.6,  1312.4,  1388.8,
     1464,    1616.6,  1818.1,  2120.7,  2422.5,  2727.8,
     3034,    3340.9,  3647.2,  3953.1,  4259.3,  4566,
     4873.3,  5181.9,  5489.3,  5490.4,  5798.4,  6108.9 ;
    salinity =
     // 1st sounding, fill values match those for pressure
       35.6592, 35.6608, 35.8249, 35.9082, 35.8473, 35.7761,
       35.3217, 35.0448, 34.8399, 34.6722, 34.5441, 34.4838,
       34.4639, 34.5371, 34.5688, 34.6205, 34.6233, 34.65,
       34.6937, 34.7136, 34.7221, 34.7274, 34.7271, 34.7249,
       34.7246, 34.7242, 34.719,        _,       _,       _,
             _,       _,       _,       _,       _,       _,
     // 2nd sounding
       35.3861, 35.4953, 35.6961, 35.7309, 35.881,  35.9754,
       35.9273, 35.7119, 35.7114, 35.4633, 35.0481, 34.7424,
       34.6212, 34.501,  34.525 , 34.5193, 34.6017, 34.6046,
       34.6256, 34.6298, 34.6426, 34.642,  34.6754, 34.7031,
       34.7161,       _,       _,       _,       _,       _,
             _,       _,       _,       _,       _,       _,
   ...
     // last sounding
       33.9206, 34.0878, 34.5011, 34.5774, 34.5264, 34.6923,
       34.761,  34.8045, 34.7596, 34.7355, 34.7086, 34.6802,
       34.648,  34.6239, 34.6354, 34.645,  34.6812, 34.7136,
       34.6987, 34.7136, 34.7394, 34.7378, 34.7361, 34.7296,
       34.7262, 34.7213, 34.7179, 34.714,  34.7142, 34.713,
       34.7126, 34.712,  34.7116, 34.7116, 34.7114, 34.7104 ;
   oxygen =
   ...
}

However, it's not clear to me how to associate the 12 times in your
example CDL with the 59 (lat, lon) locations or what looks like 60
profiles.  Since there are 59 locations and 60 profiles in your CDL,
two of the profiles must have been taken at the same location, and
many of the profiles must have been taken at the same time.

You should probably be using a representation similar to one of the
existing standards or conventions for this kind of data, such as the
"Southeast Atlantic Coastal Ocean Observing System NetCDF Standard:
SEACOOS CDL v2.0" at

  
http://seacoos.org/Research%20and%20Technology/Folder.Information%20Management/documentation

or a WOCE data standard such as

  
http://www.bodc.ac.uk/data/online_delivery/international_sea_level/woce_netcdf.html

Hope this helps ...

--Russ


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



Ticket Details
===================
Ticket ID: COA-518203
Department: Support netCDF
Priority: Normal
Status: Closed