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

[netCDF #BNN-485622]: 2d netcdf to 3d (adding depth)



Hi Jose,

> I am working with SST from Reynold's NetCDF where I have sea surface
> temperature for the world.
> 
> As I am showing this nc using your IDV program
> 
> Now I have the requirement of adding temperature for depth 100, 200 and 300
> at specific area.
> 
> Do you know how I can convert his 2D grid to 3d grid netcdf file and add
> this nee temperature reads?
> Is there a program to do a bulk import of this information or I have to
> write a program using your API?

I know of three possibilities that might work.

  1.  Store your 2D grid files on a THREDDS server and use the NcML (netCDF 
Markup
      Language) to represent the collection of files as if it is a single file,
      using aggregation (or joining), probably "JoinNew" type aggregation:

       http://www.unidata.ucar.edu/software/netcdf/ncml/v2.2/Aggregation.html

      This would require that you have a TDS server running somewhere you can
      add files, and that the joined data would be accessed from that TDS 
      server through the NcML wrapper.  It's kind of a heavyweight solution
      unless you already have TDS configured and installed, and have lots of
      data to serve this way to lots of users.  But it's a flexible solution
      that's very efficient, becasue the 2D files are left in their original
      form, but appear as if they are joined into a 3D file when accessed from
      TDS.  It also provides other services, such as the NetCDF Subset Service
      that can subset netCDF data by bounding box in time or space and by
      variable.

  2.  Use the "cfa" utility for creating aggregated CF datasets from David
      Hassell's Python interface to the CF data model software.  This utility
      assumes your input files follow the CF metadata conventions, and
      creates (on local disk, without a server) an aggregated file.  This
      software is available here:

         http://cfpython.bitbucket.org/

      I found it well-documented and easy to build.  The cfa utlity worked
      well on the examples I tried.

  3.  Use The NCO (NetCDF Operators) software, specifically utilites ncpdq (to
      create a record dimension corresponding to depth) and ncecat (to join
      the resulting files along the record dimension).  The NCO software is
      available here:

         http://nco.sourceforge.net

There may be other ways to do what you want.  If you find something that works
well, please let us know what worked.

--Russ




--Russ

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



Ticket Details
===================
Ticket ID: BNN-485622
Department: Support netCDF
Priority: Normal
Status: Closed