Re: missing values

From: rafael dido <raf.eldido_at_nyahnyahspammersnyahnyah>
Date: Fri Jan 04 2013 - 12:41:29 MST

Hallo NCL Users,

Thanks for the response,

I meant, why did the result of the areal average either for land masking or
ocean masking in this case (precipitation over the ocean or land) is equal
to -999. I noticed in the previous email the the print value for "ave"
which is an areal average for sea is equal to missing value.

What should i do thus i will obtain the real value of this calculation.

my code
[snip]

f = addfile("/projekt1/precip_ocean.nc","r") ; Read in first time step
and
  pocean = f->psea(:,{-10:10},:)
  pocean@_FillValue = pocean@missing_value
  pocean@_FillValue = -999
  printVarSummary(pocean)

rad = 4.0*atan(1.0)/180.0
clat = cos(lat*rad)
ocean = dim_avg_Wrap( pocean(lat|:, lon|:, time|:) )
Ave = wgt_areaave(ocean, clat, 1.0, 1)
print(ave)

[snip]

--------------------------Result-------------------
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 <------------------------------Areal Average of
precipitation over the Ocean*

Thanks,
Rafael

On Sat, Jan 5, 2013 at 3:57 AM, Mary Haley <haley@ucar.edu> wrote:

> Rafael,
>
> I'm not sure what the problem is. Do you mean that you don't want a
> _FillValue of -999?
>
> If so, then in your script, you changed the _FillValue attribute to have a
> value of -999, which means when you take the average, it will also
> have a _FillValue attribute of -999.
>
> If you don't want -999 as a _FillValue, then remove this line:
>
>
> pocean@_FillValue = -999
>
>
> --Mary
>
>
> On Jan 4, 2013, at 10:49 AM, rafael dido wrote:
>
> Hi NCL,
>
> I have nc file containing missing value indicated by "_"
>
> dimensions:
> lon = 360 ;
> lat = 181 ;
> time = UNLIMITED ; // (4383 currently)
> variables:
> double lon(lon) ;
> lon:units = "degrees_east" ;
> lon:modulo = 360. ;
> lon:point_spacing = "even" ;
> lon:axis = "X" ;
> double lat(lat) ;
> lat:units = "degrees_north" ;
> lat:point_spacing = "even" ;
> lat:axis = "Y" ;
> double time(time) ;
> time:units = "hours since 1997-01-01 00:00:00" ;
> time:time_origin = "01-JAN-1997 00:00:00" ;
> time:axis = "T" ;
> float psea(time, lat, lon) ;
> * **psea:missing_value = -1.e+34f ;*
> * psea:_FillValue = -1.e+34f ;*
> // global attributes:
> :Conventions = "CF-1.0" ;
> data:
>
> psea =
> _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,
> _,
> _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,
> 0.02250607, 0.5173603, 0, 0, 0, 0, 0, 0, 0, 0.01500405, 0, 0, 0, 0, 0, 0,
> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
> 0,
> _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,
> _,
> _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 0, 0, 0.4348826,
> 0.05248583,
> 3.899931, 24.72732, 53.44849, 21.48183, 11.3707, 3.757559, 0.0299919,
>
> [SNIP]
>
> Once, I calculated the average for a specific domain i got the result is
> -999 as
> i set my command as follow:
>
> f = addfile("/projekt1/precip_ocean.nc","r") ; Read in first time
> step and
> pocean = f->psea(:,{-10:10},:)
> pocean@_FillValue = pocean@missing_value
> pocean@_FillValue = -999
> printVarSummary(pocean)
>
> rad = 4.0*atan(1.0)/180.0
> clat = cos(lat*rad)
> ocean = dim_avg_Wrap( pocean(lat|:, lon|:, time|:) )
> Ave = wgt_areaave(ocean, clat, 1.0, 1)
> print(ave)
>
> === [executed]
> 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*
>
>
> Is there any hints how to handle this problem in NCL? When I used another
> language program,
> and I do not get any problem to calculate this average.
>
>
> Thanks
>
> RF.
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>

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

This archive was generated by hypermail 2.1.8 : Fri Jan 04 2013 - 15:34:10 MST