[ncl-talk] How to "trim" a netcdf file

Walter Kolczynski walter.kolczynski at noaa.gov
Mon Feb 9 11:23:29 MST 2015


If you just want to make files that are a subset, you are better off 
using the NetCDF Operators (nco): 
http://nco.sourceforge.net/nco.html#Hyperslabs

You can also specify the indexes or coordinates you want to read when 
you read the variable in NCL:

smaller_T = file->T(:,{-20:20}, {80:160})
smaller_T = file->T(:,15:40,20:40)

- Walter

On 09-Feb-15 13:12, HAVENER, KEVIN F GS-12 USAF AFWA 14 WS/WXED wrote:
> I have a 4 by 721 by 1440 netcdf (lev/lat/lon) that I am performing some classification calculations on.  To develop and check my logic, I'd like to work with just a small portion of the grid until I get the details worked out.  So how do I select a lat/lon box from a netcdf and write it to a test file?  It seems like it should be obvious, but I can't find the relevant example from the examples page or the function page.  Can someone point me in the right direction, please?  I know when someone points it out to me, I will smack myself in the head.  But darned if I can find it.
>
> Kevin Havener
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
Walter Kolczynski, Jr.
Global Ensemble Team
NOAA/NWS/NCEP/EMC (via I.M. Systems Group)
(301) 683-3781



More information about the ncl-talk mailing list