<div dir="ltr"><div><div>I think I know why it is happening... The data I'm trying to mask has the longitude from 0 to 357.5, while the shapefile has the longitude from -179.1 to 179.8...<br><br></div>Does anyone has suggestion how I can fix that? Thanks!<br><br></div>Ming<br><div><div><br><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jul 4, 2015 at 10:19 PM, Ming Chen <span dir="ltr"><<a href="mailto:chen1718@umn.edu" target="_blank">chen1718@umn.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hi all,<br><br></div>I was trying to mask the contiguous United States using a shape file and the script "shapefile_mask_data.ncl", but got all missing values.<br><br></div>I used ncl 6.2.1. The script I used is here:<br><br>;Begins to calculate US averaged NEE<br> shp_filename = "coastl_usa.shp"<br> opt = True<br> opt@minlat = 20<br> opt@maxlat = 50<br> opt@minlon = 230<br> opt@maxlon = 295<br> opt@debug = True<br> opt@keep = True<br> opt@loop_check = True<br> data_mask = shapefile_mask_data(NEE_AVG,shp_filename,opt)<br> NEE_scalar = wgt_areaave(data_mask,1.,1.,0) ;averaged NEE over the United States<br><br><br></div>And here is the message I got:<br>(0) ==================================================<br>(0) Shapefile: coastl_usa.shp<br>(0) Areas of interest: the whole shapefile<br>(0) min_lat_chk: 20<br>(0) max_lat_chk: 50<br>(0) min_lon_chk: 230<br>(0) max_lon_chk: 295<br>(0) min_lat_data: -90<br>(0) max_lat_data: 90<br>(0) min_lon_data: 0<br>(0) max_lon_data: 357.5<br>(0) 13824 data values originally<br>(0) Will keep data values inside given shapefile areas<br>(0) ==================================================<br>(0) 0 data values kept<br>(0) shapefile_mask_data: elapsed time: 0.930859 CPU seconds.<br>(0) ==================================================<br><div><br></div><div>I can see there are 13824 data points in my NEE_AVG data. And I have plot that without problem. Why there was no data masked?<br><br></div><div>Thanks,<br></div><div>Ming<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888"><div><br clear="all"><div><div><div><div><br>-- <br><div>Department of Soil, Water and Climate<br>439 Borlaug Hall 1991 Upper Buford Cir.<br>St. Paul 55108<br>MN USA<div>Office: <a href="tel:612-624-1645" value="+16126241645" target="_blank">612-624-1645</a><br><div><a href="http://www.biometeorology.umn.edu/people_ming.php" target="_blank">http://www.biometeorology.umn.edu/people_ming.php</a>
</div></div></div>
</div></div></div></div></div></font></span></div>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">Department of Soil, Water and Climate<br>439 Borlaug Hall 1991 Upper Buford Cir.<br>St. Paul 55108<br>MN USA<div>Office: 612-624-1645<br><div><a href="http://www.biometeorology.umn.edu/people_ming.php" target="_blank">http://www.biometeorology.umn.edu/people_ming.php</a>
</div></div></div>
</div>