Re: Missing value problem?

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon Jun 03 2013 - 11:00:42 MDT

I don't understand why you set your _FillValue attribute to 0.0. This is a dangerous value to use for missing values *and* NCL will not correctly plot data with 0.0 as a _FillValue.

What you mean by, "I printed missing values and it showed they are 0"?

When I read in your data, it showed there were no missing values:

(0) # of missing values = 0
(0) # of non missing values = 25878528

Also, you already have a _FillValue attribute attached to your data, so why are you resetting it to 0.0?

I didn't realize before that you had set _FillValue to 0.0, so that's why I was getting more values that were missing.

Try commenting these two lines:

; t1@_FillValue = 0
; t1@missing_value = t1@_FillValue

The above lines seem unecessary. Also, "missing_value" is not a recognized attribute by most NCL plotting and computational functions. Only "_FillValue" is recognized as a missing value.

--Mary

On Jun 3, 2013, at 10:51 AM, Jiang, Lifen wrote:

> Dear Mary,
>
> Thank you so much for checking my data! Yes, I printed missing values and it showed they are "0". So I added:
>
> t1@_FillValue = 0
> t1@missing_value = t1@_FillValue
>
> However, every grid of the output file is missing values (Min and Max are the same). When I plotted, it was blank.
>
> Do you mean you have run my codes and got valid data? Do you know what is the missing values? Is that "0"?
>
> Thanks,
>
> Lifen
>
>
>
>
> 2013-06-03
> Jiang, Lifen
> 发件人: Mary Haley
> 发送时间: 2013-06-03 11:38:34
> 收件人: Jiang, Lifen
> 抄送: ncl-talk
> 主题: Re: [ncl-talk] Missing value problem?
> Thanks for providing a file.
> Did you look at your data? I added three lines so I could print the min/max and count the number of missing and non-missing values of your input data (t1):
> printMinMax(t1,0)
> print("# of missing values = " + num(ismissing(t1)))
> print("# of non missing values = " + num(.not.ismissing(t1)))
> The output was:
> (0) Carbon Mass Flux out of Atmosphere due to Net Primary Production on Land: min=-5.92884e-08 max=9.2756e-08
> (0) # of missing values = 19720579
> (0) # of non missing values = 6157949
> I did the same for the (output) values, "Yearly":
> printMinMax(Yearly,0)
> print("# of missing values = " + num(ismissing(Yearly)))
> print("# of non missing values = " + num(.not.ismissing(Yearly)))
> Here's the output:
> (0) Carbon Mass Flux out of Atmosphere due to Net Primary Production on Land: min=-1.08987e-09 max=6.66729e-08
> (0) # of missing values = 1660494
> (0) # of non missing values = 496050
> So, I'm not sure what you mean by "it always return empty file (all grids are missing value)". You do have
> some missing values, but you also have some valid values. This is to be expected given that your input
> had some missing values.
> --Mary
> On Jun 1, 2013, at 10:47 AM, Jiang, Lifen wrote:
> > Dear NCL members,
> >
> > I am calculating annual average of my monthly data using NCL "month_to_annual" function. However, it always returned empty file (all grids are missing value).
> >
> > I don't think the codes (see below) have problems because they worked very well for other data but for this. I guess the issue is related with missing value of the data file but cann't find what it is.
> >
> > I have uploaded the data file to UCAR's ftp under folder "incoming". I appreciate if anyone can help check what is the problem.
> >
> > Thank you!
> >
> > Lifen
> >
> > ****************
> >
> > load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
> > f1 = addfile("npp_Lmon_NorESM1-M_historical_r1i1p1_185001-200512.nc", "r")
> > t1 = f1->npp ; t1(time,lat,lon)
> > printVarSummary(t1)
> >
> > t1@_FillValue = 0
> > t1@missing_value = t1@_FillValue
> >
> > Yearly = month_to_annual(t1(time|:,lat|:,lon|:), 1) ; TMP(156,nlat,mlon)
> >
> > system("/bin/rm -f yearly_npp_NorESM1-M.nc") ; remove any pre-exist file
> > fout = addfile("yearly_npp_NorESM1-M.nc", "c") ; new netCDF file
> > fout@title = "Month to year"
> > fout->Yearly = Yearly
> > _______________________________________________
> > 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 Mon Jun 3 11:01:22 2013

This archive was generated by hypermail 2.1.8 : Tue Jun 04 2013 - 09:50:17 MDT