# [ncl-talk] issue on doing the average in mask area

Dennis Shea shea at ucar.edu
Thu Feb 7 07:48:56 MST 2019

```What is 'dox_a7'

wgt  = (/0, 1.472102, 4.587478, 7.944124, 11.55863, 15.44871, 19.6333,
24.13265, 28.96836, 34.16353, 39.74284, 45.73265, 52.16112/)

dox_a7 = a7->dox                                                        ;
?????
printVarSummary(dox_a7)                                           ;
(time, lev, lat, lon) ; (0,1,2,3)
printMinMax(dox_a7,0)

dox_ave_a7 = dim_avg_wgt_n_Wrap(dox_a7, wgt, 0, 1 )  ; wgt by level =>
(time,lat,lon) ==> (0,1,2)
y_a7             = dim_avg_n_Wrap(dox_ave_a7,(/1,2/))        ; scalar

On Thu, Feb 7, 2019 at 5:33 AM Amal Inge <amalingenieur89 at gmail.com> wrote:

> Dear NCL Experts,
>
> I did a masking and I'm trying to do the average of 4D variable in the
> area I need but I get a so low values, it seems that my code is making the
> average in all the area (the masked and the non masked).
> how could i resolve this issue please?
>
> code:
>  wgt  = (/0, 1.472102, 4.587478, 7.944124, 11.55863, 15.44871, 19.6333,
> 24.13265, 28.96836, 34.16353, 39.74284, 45.73265, 52.16112/)
>   dox_ave_a7 = dim_avg_wgt_n_Wrap(dox_a7, wgt, 0, 1 )
>   y_a7 = dim_avg_n_Wrap(dox_ave_a7,(/1,2/))
>
> variable
> netcdf dox07_med_0-52_s2014 {
> dimensions:
>     lon = 670 ;
>     lat = 253 ;
>     lev = 13 ;
>     time = UNLIMITED ; // (1 currently)
>     bnds = 2 ;
> variables:
>     float lon(lon) ;
>         lon:standard_name = "longitude" ;
>         lon:long_name = "longitude" ;
>         lon:units = "degrees_east" ;
>         lon:axis = "X" ;
>     float lat(lat) ;
>         lat:standard_name = "latitude" ;
>         lat:long_name = "latitude" ;
>         lat:units = "degrees_north" ;
>         lat:axis = "Y" ;
>     float lev(lev) ;
>         lev:standard_name = "depth" ;
>         lev:long_name = "depth" ;
>         lev:units = "m" ;
>         lev:positive = "down" ;
>         lev:axis = "Z" ;
>         lev:_CoordinateZisPositive = "down" ;
>         lev:_CoordinateAxisType = "Height" ;
>     double time(time) ;
>         time:standard_name = "time" ;
>         time:long_name = "time" ;
>         time:bounds = "time_bnds" ;
>         time:units = "seconds since 1970-01-01 00:00:00" ;
>         time:calendar = "standard" ;
>         time:axis = "T" ;
>     double time_bnds(time, bnds) ;
>     float dox(time, lev, lat, lon) ;
>         dox:standard_name =
> "mole_concentration_of_dissolved_molecular_oxygen_in_sea_water" ;
>         dox:long_name = "Mole concentration of Dissolved Molecular Oxygen
> in sea water" ;
>         dox:units = "millimol m-3" ;
>         dox:_FillValue = 1.e+20f ;
>         dox:missing_value = 1.e+20f ;
>         dox:_ChunkSizes = 1, 22, 84, 161  ;
>
> Many thanks
> Amal
> _______________________________________________
> 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/20190207/c27704c8/attachment.html>
```