NCL Home > Documentation > Functions > General applied math

specx_ci

Calculates the theoretical Markov spectrum and the lower and upper confidence curves.

Prototype

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/shea_util.ncl"

	function specx_ci (
		sdof     : numeric,  
		lowval   : numeric,  
		highval  : numeric   
	)

	return_val [4][*] :  typeof(sdof)

Arguments

sdof

A degrees of freedom array returned from the NCL functions specx_anal or specxy_anal.

lowval

The lower confidence limit (0.0 < lowval < 1.). A typical value is 0.05.

highval

The upper confidence limit (0.0 < hival < 1.). A typical value is 0.95.

Return value

A two-dimensional array dimensioned 4 x N where N is the size of sdof@spcx. It will contain four curves:

  • splt(0,:) - input spectrum
  • splt(1,:) - Markov "Red Noise" spectrum
  • splt(2,:) - lower confidence bound for Markov
  • splt(3,:) - upper confidence bound for Markov

Description

This function calculates the theoretical Markov spectrum and the lower and upper confidence curves using the lag 1 autocorrelation returned as an attribute by the NCL functions specx_anal or specxy_anal.

See Also

specx_anal, specxy_anal

Examples

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/shea_util.ncl"

begin
  f      = addfile ("/cgd/cas/shea/MURPHYS/ATMOS/b003_T_200-299.nc", "r")
  x      = f->T(:,17,:,:)
  x = rmMonAnnCycTLL(x)   ;removes the annual cycle from monthly data, in contributed.ncl
  ts = x(:,{50.},{290.})

  sdof = specx_anal(ts,0,0,0.1)
  splt = specx_ci(sdof,0.05,0.95)
  
  wks = gsn_open_wks("ps","test")
  res                     = True
  res@tiYAxisString = "Power"              ; yaxis
  res@xyLineThicknesses   = (/2.,1.5,1.,1./)  ; Define line thicknesses 
  res@xyDashPatterns      = (/0,0,0,0/)
  res@xyLineColors        = (/"foreground","red","blue","green"/)                

  plot = gsn_csm_xy(wks,sdof@frq,splt,res)
end
For some application examples, see: