[ncl-talk] assigning IDs to states in NCF file

Dave Allured - NOAA Affiliate dave.allured at noaa.gov
Tue Jul 21 14:14:04 MDT 2020


This can be done fairly easily with NCL and a medium or high resolution
shapefile of U.S. or northeastern states.  There are several examples on
the shapefile examples page that demonstrate masking of gridded data with
individual region outlines from a shapefile.

    https://www.ncl.ucar.edu/Applications/shapefiles.shtml

The function shapefile_mask_data will probably be the easiest for this,
because it is already set up to select regions by name, and to work with
data grids.  Look for any of several examples that use this function, then
modify to assign the state ID's that you want.  You can omit the plotting
code if your objective is data processing.


On Tue, Jul 21, 2020 at 1:45 PM Maryam Golbazi via ncl-talk <
ncl-talk at mailman.ucar.edu> wrote:

> Hi everyone,
>
> I have a gridded emission file with 300 * 315 horizontal resolution. It
> covers the northeastern states of the US. I need to assign a state ID to
> every grid cell. Let's say to set all grid cells falling in Maryland to 1,
> in Delaware to 2, and so on.
>
> Does anybody know where I should start? And if NCL is the easiest way to
> do this?
>
> Thank you,
> Maryam
>
> --
> *=======================*
> Maryam Golbazi
> *PhD Candidate, Ocean Engineering*
> *Atmosphere and Energy Research Group (AERG)*
> *Interdisciplinary Science and Engineering (ISE) **Laboratory*
> *University of Delaware*
> *mgolbazi at udel.edu <mgolbazi at udel.edu>*
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200721/d956cecb/attachment.html>


More information about the ncl-talk mailing list