[ncl-talk] areal_avg for masked data

Dennis Shea shea at ucar.edu
Fri May 13 08:39:13 MDT 2016


I have not tried your script. However. I scanned it

[snip]
     plot       = gsn_csm_contour_map(xwks,LH(0,nLH,:,:),res_LH)
     area_avg   = wgt_areaave(LH(:,nLH,{19.5:23.5},{84.5:89.5}),1.0,1.0,1)
     area_avg at _FillValue  = -9999.9
[snip]

Note that the last argument of wgt_areaave has two settings. You specified
one (1). Please read the following description of the opt argument.
===
*opt*

If *opt* = 0, the area average is calculated using available non-missing
data. If *opt* = 1, then if *any* point in *q* is missing, the area average
is not computed. In this case, it will be set to the missing value, which
is indicated by *q*@_FillValue
<http://www.ncl.ucar.edu/Document/Language/fillval.shtml>, or the default
missing value if *q*@_FillValue is not set
===

I think you should set opt=0

===
Further ... given the (likely) different number of non-missing values for
different time steps, I suggest you view the areal averages with caution.

===
Also ... explore the data you are plotting

x = LH(:,nLH,{19.5:23.5},{84.5:89.5}
printVarSummary(x)

opt = True
opt at PrintStat = True
statb = *stat_dispersion*(x, opt )




On Fri, May 13, 2016 at 4:50 AM, Geeta Geeta <geetag54 at yahoo.com> wrote:

> Hi all.
> I have Global data of latent heat at 12 different levels. I have to
> compute the areal average of each layer , for one sector and only over the
> Ocean area. Accordingly, I masked the land area and plotted the data for
> each layer.
> It is plotted fine, but when I try to take the areal average of a
> particular layer and particular sector over the ocean, I run into problems.
> My output shows me
> 1999           7,
> 0.5000,-----------------,-9999.90039062
>   (DATE      MONTH    ,  1.0000,                 ,
>                                          ,  1.5000,                 ,
>                                          ,  2.0000,                 ,
>                                          ,  2.5000,                 ,
>                                          ,  3.0000,                 ,
>                                          ,  3.5000,                 ,
>                                          ,  4.0000,                 ,
>                                          ,  4.5000,                 ,
>                                          ,  5.0000,                 ,
>                                          ,  5.5000,                 ,
>                                         ,  6.0000,
>                                          (layers)
> (areal Average Value)
>
> I am unable to proceed further>>>>. Attaching my script and the figures
> and output file.
> when I run this, I get areal_ave = -9999. for all the layers...
> umber Of Attributes: 10
>   longitude :    degrees_east
>   latitude :    degrees_north
>   comments :    Unknown1 variable comment
>   long_name :    latent heat (C/hr)
>   units :
>   grid_name :    grid-1
>   grid_type :    linear
>   time_statistic :    instantaneous
>   missing_value :    -9999.9
>   _FillValue :    -9999.9
>
>
> Variable: date_final
> Type: string
> Total Size: 8 bytes
>             1 values
> Number of Dimensions: 1
> Dimensions and sizes:    [1]
> Coordinates:
> (0)    1999    7
>
>
> Variable: area_avg
> Type: float
> Total Size: 4 bytes
>             1 values
> Number of Dimensions: 1
> Dimensions and sizes:    [1]
> Coordinates:
> Number Of Attributes: 1
>   _FillValue :    -9999.9
> (0)    -9999.9
>
> Geeta.
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160513/47760f94/attachment.html 


More information about the ncl-talk mailing list