Re: month_to_season with missing data

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Wed, 07 Jun 2006 15:13:40 -0600

Hi Jeff,

By including the (/ /) around the dim_avg function:

tavgDJF_avg = (/dim_avg(tavgDJF(latitude|:,longitude|:,time|:)) /)

you are telling NCL to not transfer any metadata to the left-hand side
of the equal sign (_FillValue's are set correctly on the left-hand side
of the equation though.). Thus, latitude and longitude information are
not included as coordinate variables in tavgDJF. (This can be seen in
your printVarSummary.) You would be getting error messages when you plot
this array though...

I would suggest using dim_avg_Wrap instead of dim_avg:
http://www.ncl.ucar.edu/Document/Functions/Contributed/dim_avg_Wrap.shtml

as the coordinate variable info along with attributes are passed to
resulting array. Try using dim_avg_Wrap and see if anything changes.

Let us know if this doesn't solve your problem..
Adam

Jeff Van Dorn wrote:
> Apologies if this has been covered before, I didn't see it in the
> documentation or in my searching.
>
> I'm trying to produce some seasonal average plots with a netCDF file
> that doesn't contain data over the ocean or in Canada, yet they are in
> the area that I'm interested in (the upper Northeast US).
>
> I'm able to successfully plot the netCDF file when I issue:
> "tavg@_FillValue=1e20", and the missing data areas then have no color
> to them, which is cool. However, when I try to do my seasonal
> averages, via:
>
> tavg_ts = tavg( time | 12:371, latitude | 89:189, longitude | 349:461)
> tavgDJF = month_to_season( tavg_ts, "DJF" )
> tavgDJF_avg = (/dim_avg(tavgDJF(latitude|:,longitude|:,time|:)) /)
>
> it really seems like the missing data isn't being ignored, as I get
> data (certainly invalid data) over the oceans and Canada. When I do a
> printVarSummary, tavgDJF_avg does contain that proper FillValue for
> the missing data:
>
> Variable: tavgSON2070_avg
> Type: float
> Total Size: 45652 bytes
> 11413 values
> Number of Dimensions: 2
> Dimensions and sizes: [101] x [113]
> Coordinates:
> Number Of Attributes: 1
> _FillValue : 1e+20
>
> So, do I have to compute my seasonal means in a different manner, or am
> doing something wrong above?
>
> Thanks for any help.
> Jeff Van Dorn
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
--------------------------------------------------------------
Adam Phillips			             asphilli_at_ucar.edu
National Center for Atmospheric Research   tel: (303) 497-1726
ESSL/CGD/CAS                               fax: (303) 497-1333
P.O. Box 3000				
Boulder, CO 80307-3000	  http://www.cgd.ucar.edu/cas/asphilli
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Jun 07 2006 - 15:13:40 MDT

This archive was generated by hypermail 2.2.0 : Wed Jun 07 2006 - 16:05:46 MDT