Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

Re: how to read data in reverse order

Ed Hartnett wrote:
Jeff Whitaker <jswhit@xxxxxxxxxxx> writes:

Hi all:

I'm trying to read the data from a variable in reverse order.  Say I
have a 1-D variable of length ten, so start=0, count=10, stride=1 in
nc_get_vars gives me all the data.  I though perhaps start=9,count=10
and stride=-1 would give me the data in reverse order, but I get a
'Illegal stride' error.  Am I missing something simple, or is this not
a supported operation?

-Jeff

--
Jeffrey S. Whitaker         Phone  : (303)497-6313
Meteorologist               FAX    : (303)497-6449
NOAA/OAR/PSD  R/PSD1        Email  : Jeffrey.S.Whitaker@xxxxxxxx
325 Broadway                Office : Skaggs Research Cntr 1D-124
Boulder, CO, USA 80303-3328 Web    : http://tinyurl.com/5telg

==============================================================================
To unsubscribe netcdfgroup, visit:
http://www.unidata.ucar.edu/mailing-list-delete-form.html
==============================================================================



Jeff,

I think you may want to try the varm functions
(i.e. nc_get_varm_<TYPE>).

What you are trying is not a supported operation, as I understand it.


Ed
Ed: Wow, 5 minutes at looking the nc_get_varm docs and I feel a migraine coming on ... I think I'll just flip the order after it's read in.

-Jeff

--
Jeffrey S. Whitaker         Phone : (303)497-6313
NOAA/OAR/CDC  R/PSD1        FAX   : (303)497-6449
325 Broadway                Boulder, CO, USA 80305-3328

==============================================================================
To unsubscribe netcdfgroup, visit:
http://www.unidata.ucar.edu/mailing-list-delete-form.html
==============================================================================


 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690