<div dir="ltr">Thanks for the suggestion! It worked,<div><br></div><div>Best</div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-03-13 15:02 GMT+01:00 Dennis Shea <span dir="ltr"><<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span class=""> v_obs = obs->tmax(:,::-1,:) ;reverse latitudes min-max</span><div> v_rac =racmo->tmax ; <=== has missing values<br><br></div><div>; make both grids have the same _FillValue structure<br></div><div> vobs = where(ismissing(v_rac), v_obs@_FillValue, vobs)<br><br><br>===<br></div><div>Hopefully, the following gives a 'global' (overall) area weighted bias<br></div><div><br></div><div>; overall (global) bias; w are the weights: cos(rad*lat); gau(lat), ...<br><br> v_obs_mean = wgt_areaave_Wrap(v_obs, w, 1.0, 0)<br></div><div> v_rac_mean = wgt_areaave_Wrap(v_rac, w, 1.0, 0)<br></div><div> print(v_obs_mean)<br> print(v_rac_mean)</div><div><br></div><div> bias_global = v_rac - v_obs <br></div><div> bias_global@long_name = "Area weighted Bias: v_rac - v_obs"<br></div><div> bias_global@units = v_obs@units<br></div><div> copy_VarCoords(v_obs_mean, bias_global)</div><div> print(bias_global)<br><br>===<br></div><div>An alternative is to interpolate (fill-in) all the _FillValue. However, you would have to proceed carefully.<br><br></div><div>Good Luck<br></div><div><br></div><div> <br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Mon, Mar 13, 2017 at 4:53 AM, Noelia otero <span dir="ltr"><<a href="mailto:noeli1680@gmail.com" target="_blank">noeli1680@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">Hi!<div><br></div><div>I am having some problems when plotting biases between two datasets in those grids where one of the dataset has missing values. Here, a piece of my code:</div><div><br></div><div> ;Get seasonal values for observ and mod.</div><div><div> v_obs = obs->tmax(:,::-1,:) ;reverse latitudes min-max</div><div> v_rac =racmo->tmax</div></div><div><div> ; Seasonal average</div><div> ;obs</div><div> avgobs_seas=dim_avg_n(v_obs,0)</div><div> avgobs_seas!0 = "lat"</div><div> avgobs_seas!1 = "lon"</div><div> avgobs_seas&lat = lat</div><div> avgobs_seas&lon = lon</div></div><div> ; model</div><div><div> avgrac_seas =dim_avg_n(v_rac,0)</div><div> copy_VarAtts(avgobs_seas,avgra<wbr>c_seas)</div><div> copy_VarCoords(avgobs_seas,avg<wbr>rac_seas)</div></div><div><br></div><div><div> ;Bias models</div><div> brac=avgrac_seas -avgobs_seas ; bias between seasonal averages</div><div> copy_VarAtts(avgobs_seas,brac)</div><div> copy_VarCoords(avgobs_seas, brac)</div></div><div><br></div><div>The variable avgrac_seas contains missing values in the last latitude, but not avgobs_seas.</div><div>So, when I compute the bias (brac), I am seeing that brac has weird values for the last coordinate :</div><div><br></div><div><div>print(brac(36,:))</div><div><br></div><div>Variable: brac (subsection)</div><div>Type: double</div><div>Total Size: 384 bytes</div><div> 48 values</div><div>Number of Dimensions: 1</div><div>Dimensions and sizes: [48]</div><div>Coordinates:</div><div>Number Of Attributes: 1</div><div> _FillValue : -32767</div><div>(0) -10271.61482711738</div><div>(1) -10271.85755532229</div><div>(2) -10272.11799386223</div><div>(3) -10272.37392089582</div></div><div>..............................<wbr>.........................</div><div><br></div><div>and finally , my plot looks wrong ...</div><div>Any suggestion to solve this? Should I filter the missing values before?</div><div><br></div><div>Many thanks in advance,</div><div><br></div><div>Noelia</div><div><br></div><div><br></div><div><br></div><div><br></div></div>
<br></div></div>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>