Re: RE : Re: [ncl-talk] problem to use lancos filter with NCL

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Fri, 18 May 2007 16:37:50 -0600

Just saying "I don't know why" does not help much :-)

I down loaded an OLR dataset from the Climate Diagnostics Center [CDC].
I ran the script and it generated OLR.matthews.nc

I used the attached script to read OLR.Matthews.nc an plot one tropical
strip
[30D - 30N] and a time series of the 20-200 band passed data. It look fine
to me.

[1] You do realize that applying a 241-point Lancos filter over the data
     will result in the first and last 120-days being missing.

[2] If you realize [1] and you get all missing values [_FillValue] then
     I speculate that the OLR dataset you are using has missing data.
     Since the FFT used to remove the first 12 harmonics does not
     allow missing data, it will return all missing values.

Using CDC OLR file, I ran the script and created OLR.matthews.nc
I used the period
     dStrt = 19790601 ; start date (yyyymmdd)
     dLast = 20070331 ; last date

The output file is at

ftp ftp.cgd.ucar.edu
anonymous
email
cd pub/shea/OLR
get OLR.matthews.nc
quit

Please note [1] above ... the 1st and last 120 days are missing.

I have attached a simple script to read/plot the data.

D

temeching gladice joelle wrote:
> Thank you for your help
> there is not problem regarding the execution of script
> but i can't display the variable OLR because the output file:
> "OLR.matthews.nc" contains only missing values: 1.e20
> I dont know why
>
> */Dennis Shea <shea_at_ucar.edu>/* a écrit :
>
> Bonjour,
>
> The response function of the 241-weight Lancos filter
> [Duschon, 1979] may be seen at:
> http://www.cgd.ucar.edu/web/public_html/shea/lancos_241.gif
>
> I suggest that you create a netCDF file containing the band passed
> filtered data. This way you create the band passed data one time.
>
[snip]

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"

begin

  f = addfile ("OLR.matthews.nc", "r")
  olr = f->OLR ; (lat,lon,time)

  time = olr&time
  lat = olr&lat
  lon = olr&lon
  
  ntim = dimsizes(time)
  nlat = dimsizes(lat)
  mlon = dimsizes(lon)
  
  latS = lat(0)
  latN = lat(nlat-1)
  
  lonL = lon(0)
  lonR = lon(mlon-1)
  
  date = ut_calendar(time, -2)
  
  nwgt = 241
  nt1 = nwgt/2 ; 1st time avec valid data
  nt2 = ntim-(nt1+1)

  lt1 = 10 ; arbitrary latitude
  ln1 = 250 ; " longitude
  print(date +" "+ olr({lt1},{ln1},:) )
;------------------------------------------------------------
; PLOTS
;------------------------------------------------------------
  wks = gsn_open_wks("x11","olr_Matthews")
  gsn_define_colormap(wks,"BlueDarkRed18") ; choose colormap
 ;gsn_define_colormap(wks,"BlWhRe") ; choose colormap
 
  res = True
  res_at_gsnSpreadColors = True ; spread out color table
 
  res_at_mpFillOn = False ; turn off map fill
  res_at_mpMinLatF = latS ; zoom in on map
  res_at_mpMaxLatF = latN
  res_at_mpMinLonF = lonL
  res_at_mpMaxLonF = lonR
  res_at_mpCenterLonF = 180
  
  res_at_mpShapeMode = "FreeAspect" ; change aspect ration of map
  res_at_vpWidthF = 0.8
  res_at_vpHeightF = 0.4

  res_at_cnFillOn = True ; turn on color fill
  res_at_cnLinesOn = False ; True is default
;;res_at_cnFillMode = "RasterFill" ; Raster Mode

                                          ; set symmetric plot min/max
;;symMinMaxPlt(olr, 16, False, res) ; contributed.ncl

  res_at_cnLevelSelectionMode = "ManualLevels" ; set manual contour levels
  res_at_cnMinLevelValF = -50. ; set min contour level
  res_at_cnMaxLevelValF = 50. ; set max contour level
  res_at_cnLevelSpacingF = 5. ; set contour spacing
  res_at_lbLabelAutoStride = True
  res_at_tiMainString = "20-200 day Band Pass: 12 harmonics removed"

  do nt=9200,9200 ; arbitrary day ; nt1,nt2
     res_at_gsnCenterString = date(nt)
     plot=gsn_csm_contour_map_ce(wks,olr(:,:,nt),res)
  end do
 
;*******************************************
; second plot
;*******************************************

  rts = True
 ;rts_at_gsnScale = True ; force text scaling
  rts_at_gsnMaximize = True

; these four rtsources allow the user to stretch the plot size, and
; decide exactly where on the page to draw it.

  rts_at_vpHeightF = 0.40 ; Changes the aspect ratio
  rts_at_vpWidthF = 0.75
  res_at_vpXF = 0.05
 ;res_at_vpYF = 0.4

  rts_at_gsnLeftString = "daily OLR: 20-200 Band Pass: 12 har removed"
  rts_at_gsnRightString = olr_at_units
  delete(olr_at_long_name)
  
  rts_at_tiMainString = "Grid Point ("+lt1+" , "+ln1+")"
  rts_at_tiXAxisString = "Days since " + date(0)
  rts_at_gsnYRefLine = 0. ; reference line
 ;rts_at_gsnAboveYRefLineColor = "red" ; above ref line fill red
 ;rts_at_gsnBelowYRefLineColor = "blue" ; below ref line fill blue

  plot = gsn_csm_y (wks,olr({lt1},{ln1},:) ,rts)
end

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri May 18 2007 - 16:37:50 MDT

This archive was generated by hypermail 2.2.0 : Mon May 21 2007 - 09:22:55 MDT