Re: missing values

From: rafael dido <raf.eldido_at_nyahnyahspammersnyahnyah>
Date: Fri Jan 04 2013 - 16:43:43 MST

Sharp eyes,, thanks Mary.
I forgot that part to be considered, because my first call for my data was
not containing missing values (without mask).

Rafael.

On Saturday, January 5, 2013, Mary Haley wrote:

> Rafael,
>
> Thanks for providing the script and data offline.
>
> The issue is that you are setting the last argument of wgt_areaave to "1".
> The
> documentation states that if you set this to 1, *and* your input array
> contains
> any missing values, then you will get a missing value returned.
>
> ------
> http://www.ncl.ucar.edu/Document/Functions/Built-in/wgt_areaave.shtml
>
> 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.
> -----
>
> If you set this last argument to 0, then you get a value for Ave:
>
> Variable: Ave
> Type: float
> Total Size: 4 bytes
> 1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
> Coordinates:
> Number Of Attributes: 1
> _FillValue : -999
> (0) 4.533181
>
> --Mary
>
>
> On Jan 4, 2013, at 2:52 PM, rafael dido wrote:
>
> Yes, I did and produced the same result: -999,
> ok, here is the simple test for that:
>
> begin
>
> f = addfile("/projekt1/precip_ocean.nc","r")
> pocean = f->psea(:,{-10:10},:)
> lat = f->lat({-10:10})
> pocean@_FillValue = pocean@missing_value
> pocean@_FillValue = -999
> printVarSummary(pocean)
>
> ocean = dim_avg_Wrap( pocean(lat|:, lon|:, time|:) )
> printVarSummary(ocean)
>
> rad = 4.0*atan(1.0)/180.0
> clat = cos(lat*rad)
> Ave = wgt_areaave(ocean, clat, 1.0, 1) ;ocean
> print ("Areal Average")
> print(Ave)
>
> end
>
> ==== Output====
>
> Variable: pocean
> Type: float
> Total Size: 132541920 bytes
> 33135480 values
> Number of Dimensions: 3
> Dimensions and sizes: [time | 4383] x [lat | 21] x [lon | 360]
> Coordinates:
> time: [8760..113928]
> lat: [ -10.. 10]
> lon: [ 0.. 359]
> Number Of Attributes: 3
> missing_value : -1e+34
> _FillValue : -999
>
> Variable: ocean
> Type: float
> Total Size: 30240 bytes
> 7560 values
> Number of Dimensions: 2
> Dimensions and sizes: [lat | 21] x [lon | 360]
> Coordinates:
> lat: [ -10.. 10]
> lon: [ 0.. 359]
> Number Of Attributes: 4
> _FillValue : -999
> missing_value : -1e+34
> average_op_ncl : dim_avg over dimension(s): time
>
> *(0) Areal Average*
>
>
> Variable: Ave
> Type: float
> Total Size: 4 bytes
> 1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
> Coordinates:
> Number Of Attributes: 1
> _FillValue : -999
> *(0) -999*
>
>
>
> Thanks
> Rafael
>
>
>
> On Sat, Jan 5, 2013 at 6:36 AM, Dennis Shea <shea@ucar.edu> wrote:
>
> Did you do:
> clat = cos(ocean&lat*rad)
> ^^^^^^^^^
>
>
> On 1/4/13 2:32 PM, rafael dido wrote:
>
> Thanks for the response:
>
> Yes, i created lat in another line for different dataset (total precip,
> without masking). Ok, i will send the code, but the size is quite large ~
> 1.1 Gb. I will try again here. If in the end I am still not able figure out
> this matter, I will cut some of time steps and send the small data to ftp.
>
> Mary, here is the information:
>
> Variable: pocean
> Type: float
> Total Size: 132541920 bytes
> 33135480 values
> Number of Dimensions: 3
> Dimensions and sizes: [time | 4383] x [lat | 21] x [lon | 360]
> Coordinates:
> time: [8760..113928]
> lat: [ -10.. 10]
> lon: [ 0.. 359]
> Number Of Attributes: 3
> missing_value : -1e+34
> _FillValue : -1e+34
> ncl 26> print("min/max pocean = " + min(pocean) + "/" + max(pocean))
> *(0) min/max pocean = 0/560.664 ------> I guess it's realitic value and
> Ok.
>
> *
>
> I just wonder, why the plot is just fine but the areal average is
> incorrect.
> Thank you.
>
>
> Rafael.
>
>
>
>
>
>
>
>
> On Sat, Jan 5, 2013 at 5:54 AM, Mary Haley <haley@ucar.edu> wrote:
>
> Rafael,
>
> If you are getting one single missing value, then something is likely
> wrong with the data you are passing in.
>
> Did you look at pocean to make sure it is okay?
>
> printVar
>
>
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Jan 4 16:44:00 2013

This archive was generated by hypermail 2.1.8 : Mon Jan 07 2013 - 08:57:08 MST