! bn_var_hist_levels.jnl
! Syntax for variance-based or histogram-based levels
!

use levitus_climatology

! Variance levels
shade/line/lev=50v/title="/LEV=50v" temp[K=1]

! New symbol LEV_OPNLEVS captures the levels set with /V or VC
sh sym lev*

shade/line/lev=50v,5min/title="/LEV=50v,5min" temp[K=1]
shade/line/lev=50v,5mean/title="/LEV=50v,5mean" temp[K=1]
shade/line/lev=50v,25max/title="/LEV=50v,25max" temp[K=1]
shade/line/lev=50v,1d/title="/LEV=50v,1d" temp[K=1]

! If the data has lots of negative data, the computation of
! the std deviation was incorrect.  See ticket 1778.

let negvar = -1* temp

shade/line/lev=50v,-20min/title="/LEV=50v,-20min" negvar[K=1]
shade/line/lev=50v,-15mean/title="/LEV=50v,-15mean" negvar[K=1]
shade/line/lev=50v,-15max/title="/LEV=50v,-15max" negvar[K=1]
shade/line/lev=50v,1d/title="/LEV=50v,1d" negvar[K=1]

! Histogram-based
shade/line/lev=50h/title="/LEV=50h" temp[K=1]


! Need some tests with centered levels and with /LINE

let cvar = temp - 15

shade/line/key/lev=50v/title="/LEV=50v,-20min" cvar[K=1]
shade/line/key/lev=50v/title="/LEV=50v,-15mean" cvar[K=1]
shade/line/key/lev=50v/title="/LEV=50v,-15max" cvar[K=1]
shade/line/key/lev=50v,1d/title="/LEV=50v,1d" cvar[K=1]


shade/line/key/lev=cv/title="/LEV=cv" cvar[K=1]
shade/line/key/lev=50/title="/LEV=50" cvar[K=1]
shade/line/key/lev=50c/title="/LEV=50c" cvar[K=1]
shade/line/key/lev=c,1d/title="/LEV=c,1d" cvar[K=1]
shade/line/key/lev=20c,1d/title="/LEV=20c,1d" cvar[K=1]

! Histogram-based
shade/line/key/lev=50h/title="/LEV=50h" cvar[K=1]

