[ncl-talk] bias when there are missing values in one of the dataset

Noelia otero noeli1680 at gmail.com
Mon Mar 13 04:53:15 MDT 2017


Hi!

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:

   ;Get seasonal values for observ and mod.
    v_obs = obs->tmax(:,::-1,:) ;reverse latitudes min-max
    v_rac =racmo->tmax
  ; Seasonal average
    ;obs
    avgobs_seas=dim_avg_n(v_obs,0)
    avgobs_seas!0 = "lat"
    avgobs_seas!1 = "lon"
    avgobs_seas&lat = lat
    avgobs_seas&lon = lon
   ; model
    avgrac_seas =dim_avg_n(v_rac,0)
    copy_VarAtts(avgobs_seas,avgrac_seas)
    copy_VarCoords(avgobs_seas,avgrac_seas)

   ;Bias models
    brac=avgrac_seas -avgobs_seas ; bias between seasonal averages
    copy_VarAtts(avgobs_seas,brac)
    copy_VarCoords(avgobs_seas, brac)

The variable avgrac_seas contains missing values in the last latitude, but
not avgobs_seas.
So, when I compute the bias (brac), I am seeing that brac has weird values
for the last coordinate :

print(brac(36,:))

Variable: brac (subsection)
Type: double
Total Size: 384 bytes
            48 values
Number of Dimensions: 1
Dimensions and sizes:   [48]
Coordinates:
Number Of Attributes: 1
  _FillValue :  -32767
(0)     -10271.61482711738
(1)     -10271.85755532229
(2)     -10272.11799386223
(3)     -10272.37392089582
.......................................................

and finally , my plot looks wrong ...
Any suggestion to solve this? Should I filter the missing values before?

Many thanks in advance,

Noelia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170313/6af90d64/attachment.html 


More information about the ncl-talk mailing list