[NARCCAP-discuss] Clipping a sub-domain from NARCCAP data based on lat/lon
Shem, Willis O.
shemwo at ornl.gov
Fri Apr 27 08:17:20 MDT 2012
Hi Darrin
Did you find a solution to the issue of using ncap2 to clip a sub-domain from the NARCCAP data and would you mind sharing?.
I have been using the NCL getind_latlon2d function but it's not so accurate. Thanks
Willis
-----Original Message-----
From: narccap-discuss-bounces at mailman.ucar.edu [mailto:narccap-discuss-bounces at mailman.ucar.edu] On Behalf Of Darrin Sharp
Sent: Thursday, March 22, 2012 7:56 PM
To: Discussion of NARCCAP data - uses and questions
Subject: [NARCCAP-discuss] Clipping a sub-domain from NARCCAP data based on lat/lon
Is there an easy way using netcdf operators (nco) to clip a subdomain
from the NARCCAP North American coverage?
For example, I want to look at the subdomain defined by
(41.5N<=lat<=49.5N) and (236E<=lon<=249E). This is the Pacific
Northwest (i.e. OR, WA, part of ID).
I'm familiar with using nco to clip based on dimensions, where in a
case like this lat and lon would be dimensions. In that case I'd do
something like:
ncks -h -O -d lat,41.5,49.5 -d lon,236,249
tas_CRCM_cgcm3_1968010103.nc out.nc
But since the dimensions in NARCCAP are xc and yc (in meters) and not
lat/lon (in degrees) that doesn't work.
I've been trying to use ncap2 with a script to mask the lat and lon
variables, but am not having much luck. For example:
ncap2 -s 'mask_var=(lat>=41.5 && lat <= 49.5) && (lon>=236 &&
lon<=249);' tas_CRCM_cgcm3_1968010103.nc out.nc
This ncap2 command works (i.e. produces a valid out.nc file), but I'm
not sure what to do with it then.
Am I making this too hard? Is there an easier way?
-Darrin
======================================
Darrin Sharp
Faculty Research Assistant
Oregon Climate Change Research Inst. (OCCRI)
dsharp at coas.oregonstate.edu
970-219-6713
_______________________________________________
narccap-discuss mailing list
narccap-discuss at mailman.ucar.edu
http://mailman.ucar.edu/mailman/listinfo/narccap-discuss
More information about the narccap-discuss
mailing list