11.07.2015 Views

PyClimate 1.1. A set of C and Python routines for the ... - Starship

PyClimate 1.1. A set of C and Python routines for the ... - Starship

PyClimate 1.1. A set of C and Python routines for the ... - Starship

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Function: def rightpatterns()Idem <strong>for</strong> <strong>the</strong> right patterns.Function: def leftexpcoeffs()This method returns an array which columns are <strong>the</strong> left (those associated to <strong>the</strong> sfield)canonical canonical expansin coefficients.Function: def rightexpcoeffs()Idem <strong>for</strong> <strong>the</strong> right coeffiients.Function: def correlation()Gives <strong>the</strong> ordered canonical correlations <strong>of</strong> <strong>the</strong> expansion coefficients as an array.Function: def getvariancefractions()Returns a tuple containing <strong>the</strong> variance fraction explained by each canonical pattern.The first element <strong>of</strong> <strong>the</strong> tuple is <strong>the</strong> array <strong>of</strong> fractions corresponding to <strong>the</strong> left field.The second one is that <strong>of</strong> <strong>the</strong> right field.10 Multivariate linear filters: LinearFilter.pyFilters are used in climate analysis to atenuate components <strong>of</strong> irrelevant frequenciesfrom a broadb<strong>and</strong> signal <strong>and</strong> to select <strong>the</strong> frequencies <strong>of</strong> interest <strong>for</strong> <strong>the</strong> problem underconsideration. The simplest <strong>of</strong> <strong>the</strong>se filters are <strong>the</strong> linear filters <strong>and</strong> two <strong>of</strong> <strong>the</strong>m areprovided: <strong>the</strong> Kolmogorov-Zurbenko filter <strong>and</strong> <strong>the</strong> Lanczos filter. In <strong>the</strong> current version,<strong>the</strong> filter does not h<strong>and</strong>le missing values.Both <strong>of</strong> <strong>the</strong>m filter <strong>the</strong> data by weighting <strong>the</strong> input with coefficientsHJI that depend on<strong>the</strong> filter:O P IRQSOHTIVU¥IXWLThis common part <strong>of</strong> <strong>the</strong> computation is carried out by subclassing <strong>the</strong> LinearFilterclass.Class: LinearFilterMethod: LinearFilter.getfiltered(ifield)KMLNGiven an input field, <strong>the</strong> function returns <strong>the</strong> filtered data corresponding to each inputrecord. This function must be called in an iterative way. The filter has been implementedwith per<strong>for</strong>mance in mind, so that, in order to avoid several iterations througha possibly long data<strong>set</strong>, it iterates just once, per<strong>for</strong>ming a multivariate filtering to eachrecord. This makes that during <strong>the</strong> initialization phase, <strong>the</strong> internal running buffer mustbe initialized (filled) until valid values can be obtained. During <strong>the</strong> initialization phase<strong>of</strong> <strong>the</strong> filter, this function returns None. After <strong>the</strong> internal buffer is ready, <strong>the</strong> functionreturns valid filtered fields until <strong>the</strong> user arrives at <strong>the</strong> final record <strong>of</strong> <strong>the</strong> iteration.Method: LinearFilter.re<strong>set</strong>()This method re<strong>set</strong>s <strong>the</strong> linear filter so that it is able to start computing with a data <strong>set</strong> <strong>of</strong>a different shape avoiding <strong>the</strong> creation <strong>of</strong> a new instance <strong>of</strong> <strong>the</strong> class.10.1 KZ filter: KZFilter.pyThe Kolmogorov–Zurbenko digital filter is a very simple but powerful digital filter. Itsfeatures are documented elsewhere [7, 12].Class: KZFilterMethod: KZFilter. init (self,points,iterations,lowpass=1)Default (<strong>and</strong> only) constructor. points is an odd integer representing <strong>the</strong> number <strong>of</strong>13

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!