Re: error: constant values

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Mon Aug 05 2013 - 13:33:18 MDT

You sent this same email directly to me.
Please do not do that. *Only* to ncl-talk.
No personal salutations please.

The ezfftf/b codes are just fine. I added your code to the
end of the attached script. Run it for illustration.
You can see that it does not produce the messages you include below.

I am not even sure what "X2" represents.
There is nothing in the code to indicate

Check your input data

     in = addfile("hgt.anom.nc","r") ; climatology: 1989-2005
     z = in->Z300 ; (time,lat,lon)
     printVarSummary(z)
     print("z: min="+min(z)+" max="+max(z))

You are doing the FFT on the longitude dimension:

     CF = ezfftf (z)
     CF(:,:,:,1:) = 0.0 ; set all wave 2 and higher to 0.0
                          ; retain wave number one (index 0)

This is fine as in attached script.

Please use print and/or a subset of your data for
debug purposes.

On 8/4/13 7:48 AM, Ahmad Farsyud wrote:
> Hallo NCL,
>
> Anybody can tell me why did I get the constant values using the output from
> fourier filter:
>
> (0) X2 contains all constant values at nx = 14
> (0) X2 contains all constant values at nx = 29
> (0) X2 contains all constant values at nx = 44
> (0) X2 contains all constant values at nx = 59
> (0) X2 contains all constant values at nx = 74
> (0) X2 contains all constant values at nx = 89
> etc
> --
> Here is my mini script:
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
>
>
> in = addfile("hgt.anom.nc","r") ; climatology: 1989-2005
>
> z = in->Z300 ; (time,lat,lon)
>
> dimz = dimsizes(z)
> ntim = dimz(0)
> nlat = dimz(1)
> mlon = dimz(2)
> ;****************************************
>
> CF = ezfftf (z)
> printVarSummary(CF)
>
> cf = CF
> cf(:,:,:,1:) = 0.0
> z_wave1 = ezfftb (cf, 0.0)
> copy_VarMeta(z, z_wave1)
>
>
> X2 = onedtond( ndtooned(z_wave1), (/ *nxy*, *ntim* /) )
>
> if(any(ismissing(X2))) then
> print("X2 contains one or more missing values, cannot continue!!.")
> return
> end if
>
> xxx = dimsizes(X2)
> nx = xxx(0)
> nt = xxx(1)
> do i=0,nx-1
> pmin = min(X2(i,:))
> pmax = max(X2(i,:))
> if(pmin.eq.pmax) then
> print("X2 contains all constant values at nx = " + i)
> end if
> end do
>
> end
>
>
>
> _______________________________________________
> 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 Aug 5 13:33:24 2013

This archive was generated by hypermail 2.1.8 : Wed Aug 07 2013 - 13:59:00 MDT