Re: Slices with addfile

From: Sylvia Murphy (murphys AT XXXXXX)
Date: Thu Jan 15 2004 - 13:34:23 MST

  • Next message: Dennis Shea: "Re: Slices with addfile"

    Hi Christian,

    here is an example

    1) reading in the entire chunk:

       x = in->T

    2) reading in just a slice. assume T is 4D

      x = in->T(0,0,:,:) ; here we read in the first time step, the first
    level, and all lat,lons using array indexes.

    sm

    On Thu, 15 Jan 2004, Marquardt, Christian wrote:

    > Hello,
    >
    > I'm more or less new to ncl, so I apologise in advance if I have missed
    > the obvious...
    >
    > I'm reading data from a large grib file which contains several variables
    > on multiple levels and for a number of valid times. The usual approach
    >
    > gribfile = addfile(<filename>)
    > data = gribfile-><varname>
    >
    > works fine, but seems to slurp in the full 4d block of data at once (or
    > am I wrong here?). However, I usually only a slice of the full data set
    > (say, all times, but a single level only, or a vertical slice, or only
    > part of the entire time series, or...). So reading the entire data block
    > at once seems to be unnecessary slow; it also requires huge amounts of
    > memory.
    >
    > Is there a way to read only slices of the data? For example, when using
    > data in a netCDF from a fortran (or so) program, I could specify the
    > start indices in each dimension, etc.
    >
    > Thanks a lot,
    >
    > Christian.
    >
    >
    >

    -- 
    

    ****************************************************** Sylvia Murphy EML: murphys@ucar.edu NCAR CGD/CSEG PHN: 303-497-1720 1850 Table Mesa Drive FAX: 303-497-1333 Boulder CO 80305

    WEB: http://www.cgd.ucar.edu/csm/support/ http://www.cgd.ucar.edu/csm/support/CSM_Graphics/ ******************************************************

    _______________________________________________ ncl-talk mailing list ncl-talk@ucar.edu http://mailman.ucar.edu/mailman/listinfo/ncl-talk



    This archive was generated by hypermail 2b29 : Thu Jan 15 2004 - 14:05:28 MST