Re: error compiling bpf

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Tue Aug 14 2012 - 14:44:17 MDT

"i guess not" .... "I guess this looks ok"

bandpass_latlon_time uses the Lanczos filter.
 
http://www.ncl.ucar.edu/Document/Functions/Built-in/filwgts_lanczos.shtml

Specifically, a 201 weight bpf. This means the 1st and last
100 values are _FillValue. This includes bpass(0,:,:)
and bpass(10,:,:). The data start at bpass(100,:,:)
and end at bpass(ntim-100,:,:)

Think of a 5-pt smoother

    0 1 2 3 4 5 6 7 8 9

The 0 and 1 anf the 8 and 9 values will be _FillValue upon return.

The 1st 2 locations (0 and 1) can not be filled

  xband(2) = x(0)*w(0) + x(1)*w(1) + x(2)*w(2) + x(3)*w(3) + x(4)*w(4) \

On 8/14/12 2:26 PM, Wilhelm Haygen wrote:
> HI,
> I think the problem is not in the plotting code.
> Here are some min/max of bpass values at the first, 10th, 100th,
> 200th time step.
>
> ncl 24> printMinMax(bpass(0,:,:),0)
> (0)Band Pass: Daily OLR: *min=9.96921e+36 max=9.96921e+36*
> ncl 25> printMinMax(bpass(10,:,:),0)
> (0)Band Pass: Daily OLR: *min=9.96921e+36 max=9.96921e+36*
> ncl 26> printMinMax(bpass(100,:,:),0)
> (0)Band Pass: Daily OLR: *min=-84.083 max=46.403*
> ncl 27> printMinMax(bpass(200,:,:),0)
> (0)Band Pass: Daily OLR: *min=-68.0747 max=39.9504*
>
> Is it a normal behavior of bpf results?, i guess not.
>
> Thanks,
> WH.
> *
> *
> *
> *
>
>
>
>
> On Tue, Aug 14, 2012 at 9:44 PM, Mary Haley <haley@ucar.edu
> <mailto:haley@ucar.edu>> wrote:
>
> It's not clear whether the issue is with the actual bpass values, or
> with the plotting code itself.
>
> How are you trying to plot the data? It would help if we could see
> your script. Did you by any chance set res@mpCenterLon to 180 just
> in case?
>
> You should add some print statements to see what the min/max of your
> data looks like.
>
> For example, if you are trying to plot the first timestep:
>
> printMinMax(bpass(0,:,:),0)
>
> will give you the min/max of bpass at the first time step.
>
> --Mary
>
> On Aug 14, 2012, at 12:36 PM, Wilhelm Haygen wrote:
>
>> Hello NCL,
>> Thanks for the response, It worked. But i found a
>> strange behavior in my results. The data is empty.I save the bpass
>> in netcdf file as follow. When i tried to plot the result in Lat
>> Lon map (2D) for time=0, i couldn't see anything. No Valid data.
>>
>> latS = -20.
>> latN = 20.
>> lonL = 0.
>> lonR = 360.
>>
>> srate = 1
>> bpf = (/20,100,201/)
>> opt = False
>> bpass = band_pass_latlon_time
>> (x(:,{latS:latN},{lonL:lonR}),srate, bpf, opt)
>>
>> diro ="./"
>> filo = "filterolr.nc <http://filterolr.nc/>"
>> NCFILE = diro+filo
>> system ("/bin/rm -f " + NCFILE)
>> ncdf = addfile(NCFILE,"c")
>> ncdf->olr_filt =bpass ; write data (lat,lon,time)
>> end
>>
>> *Variable: bpass*
>> Type: float
>> Total Size: 3574080 bytes
>> 893520 values
>> Number of Dimensions: 3
>> Dimensions and sizes:[time | 365] x [lat | 17] x [lon | 144]
>> Coordinates:
>> time: [17496624..17505360]
>> lat: [-20..20]
>> lon: [ 0..357.5]
>> Number Of Attributes: 18
>> band_pass_Nwgts :201
>> band_pass_last :100
>> band_pass_start :20
>> process :wgt_runave
>> wgt_runave_op_ncl :wgt_runave
>> missing_value :32766
>> valid_range :( 0, 500 )
>> _FillValue :32766
>> parent_stat :Individual Obs
>> statistic :Mean
>> level_desc :Other
>> dataset :NOAA Interpolated OLR
>> precision :2
>> var_desc :Outgoing Longwave Radiation
>> units :W/m^2
>> actual_range :( 83.5, 338.19 )
>> unpacked_valid_range :( 0, 500 )
>> long_name :Band Pass: Daily OLR
>>
>>
>>
>> Thanks for your help.
>> WH
>> -
>>
>>
>> On Sat, Aug 11, 2012 at 2:33 AM, David Brown <dbrown@ucar.edu
>> <mailto:dbrown@ucar.edu>> wrote:
>>
>> You don't have a closing parenthesis for the subscript of the
>> x variable.
>> -dave
>>
>> On Aug 10, 2012, at 6:04 PM, Wilhelm Haygen wrote:
>>
>>> Hi NCL users,
>>> Anybody know why i couldnt run this simple script?
>>>
>>> fatal:syntax error: line 22 before or near \n
>>> bpass = band_pass_latlon_time
>>> (x(:,{latS:latN},{lonL:lonR},srate, bpf, wgty({latS:latN}), opt)
>>> ------------------------------------------------------------------------------------------------^
>>>
>>> fatal:Syntax Error in block, block not executed
>>>
>>>
>>> Thanks
>>>
>>> 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"
>>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/diagnostics_cam.ncl"
>>>
>>> begin
>>>
>>> f = addfile("./golden_mjo.nc <http://golden_mjo.nc/>",
>>> "r")
>>> x = short2flt(f->olr) ; (time,lat,lon)
>>> , ntim=1461
>>> printVarSummary( x )
>>>
>>> ; select region
>>> latS = -20.
>>> latN = 20.
>>> lonL = 0.
>>> lonR = 360.
>>>
>>> srate = 1
>>> bpf = (/20,100,201/)
>>> wgty = latRegWgt(x&lat, "float", 0)
>>> opt = False
>>> bpass = band_pass_latlon_time
>>> (x(:,{latS:latN},{lonL:lonR},srate, bpf, wgty({latS:latN}), opt)
>>>
>>> diro ="./"
>>> filo = "filterolr.nc <http://filterolr.nc/>"
>>> a = addfile(diro+filo, "c")
>>> a->olr_filt =bpass
>>> end
>>>
>>>
>>> Variable: x
>>> Type: float
>>> Total Size: 15347520 bytes
>>> 3836880 values
>>> Number of Dimensions: 3
>>> Dimensions and sizes:[time | 365] x [lat | 73] x [lon | 144]
>>> Coordinates:
>>> time: [17496624..17505360]
>>> lat: [90..-90]
>>> lon: [ 0..357.5]
>>> Number Of Attributes: 13
>>> long_name :Daily OLR
>>> unpacked_valid_range :( 0, 500 )
>>> actual_range :( 83.5, 338.19 )
>>> units :W/m^2
>>> var_desc :Outgoing Longwave Radiation
>>> precision :2
>>> dataset :NOAA Interpolated OLR
>>> level_desc :Other
>>> statistic :Mean
>>> parent_stat :Individual Obs
>>> _FillValue :32766
>>> valid_range :( 0, 500 )
>>> missing_value :32766
>>> _______________________________________________
>>> 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
>
>
>
>
> _______________________________________________
> 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 Tue Aug 14 14:44:29 2012

This archive was generated by hypermail 2.1.8 : Wed Aug 15 2012 - 08:12:08 MDT