<div dir="ltr"><div dir="ltr"><div dir="ltr"><div>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.</div><div><br></div><div> <a href="https://www.ncl.ucar.edu/Applications/shapefiles.shtml">https://www.ncl.ucar.edu/Applications/shapefiles.shtml</a><br></div><div><br></div>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.</div><div dir="ltr"><br></div><div dir="ltr"><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jul 21, 2020 at 1:45 PM Maryam Golbazi via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu">ncl-talk@mailman.ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div style="font-family:"trebuchet ms",sans-serif;font-size:small;color:rgb(7,55,99)">Hi everyone,</div><div style="font-family:"trebuchet ms",sans-serif;font-size:small;color:rgb(7,55,99)"><br></div><div style="font-family:"trebuchet ms",sans-serif;font-size:small;color:rgb(7,55,99)">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. </div><div style="font-family:"trebuchet ms",sans-serif;font-size:small;color:rgb(7,55,99)"><br></div><div style="font-family:"trebuchet ms",sans-serif;font-size:small;color:rgb(7,55,99)">Does anybody know where I should start? And if NCL is the easiest way to do this?</div><div style="font-family:"trebuchet ms",sans-serif;font-size:small;color:rgb(7,55,99)"><br></div><div style="font-family:"trebuchet ms",sans-serif;font-size:small;color:rgb(7,55,99)">Thank you,</div><div style="font-family:"trebuchet ms",sans-serif;font-size:small;color:rgb(7,55,99)">Maryam</div><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><i style="font-family:Vivaldi,serif,EmojiFont;font-size:18.6667px"><font color="#674ea7">=======================</font></i><div><div><span style="font-family:Vivaldi;font-size:18pt;text-align:right;background-color:rgb(255,255,255)"><font color="#20124d">Maryam
Golbazi</font></span></div><div><font size="2" face="tahoma, sans-serif" color="#0b5394"><i>PhD Candidate, Ocean Engineering</i></font></div></div><div><font size="2" face="tahoma, sans-serif" color="#0b5394"><i>Atmosphere and Energy Research Group (AERG)</i></font></div><div><font color="#0b5394" face="tahoma, sans-serif"><i>Interdisciplinary Science and Engineering (ISE) </i></font><font size="2" face="tahoma, sans-serif" color="#0b5394"><i>Laboratory</i></font></div><div><font size="2" face="tahoma, sans-serif" color="#0b5394"><i>University of Delaware</i></font></div><div><font size="2" face="tahoma, sans-serif" color="#0b5394"><i><a href="mailto:mgolbazi@udel.edu" target="_blank">mgolbazi@udel.edu</a></i></font></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></blockquote></div></div></div></div>