! Test median smoothing tranform
! Default length is 3

use gtsa056_2.cdf
let var = u[x=180,y=0,k=1,t=1-jan-1982:1-jan-1983]
plot var, var[t=@med],  var[t=@med:3], var[t=@med:7]
list/t=1-dec-1982:1-jan-1983 var, var[t=@med],  var[t=@med:3], var[t=@med:7]

use coads_climatology
let var= sst[y=0,L=10]
plot var,var[x=@med:3], var[x=@med:7]
list/x=80w:50w var,var[x=@med:3], var[x=@med:7]

let var= sst[x=180,L=10]
plot var,var[y=@med:3], var[y=@med:7]
list/y=-20:0 var,var[y=@med:3], var[y=@med:7]

define axis/z=0:1000:20/depth zax
let var = cos(z[gz=zax]/30) + randu(1+k[gz=zax])
plot/trans var, var[z=@med:3], var[z=@med:9]
list/z=1:140 var, var[z=@med:3], var[z=@med:9]

set mode ignore
! Argument to the median smoother must be odd.

plot/trans var, var[z=@med:4]

set mode/last ignore

