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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Zpoints in <strong>the</strong> moving average, while iterations is an integer representing <strong>the</strong> number <strong>of</strong>times that <strong>the</strong> average is iterated to get a better damping <strong>of</strong> <strong>the</strong> secondary maximums.When <strong>the</strong> flag lowpass is false, <strong>the</strong> filter instance works as a high–pass filter.Method: KZFilter.getcoefs(self)This function returns <strong>the</strong> coefficients that are being used in <strong>the</strong> filter.Method: KZFilter.cut<strong>of</strong>ffrequency()Returns <strong>the</strong> approximate cut<strong>of</strong>f frequency <strong>of</strong> <strong>the</strong> filter.10.2 Lanczos filter: LanczosFilter.pyThe Lanczos filter is ano<strong>the</strong>r very common filter <strong>and</strong> its ma<strong>the</strong>matical properties <strong>and</strong><strong>the</strong> algorithms <strong>for</strong> <strong>the</strong> compilation <strong>of</strong> <strong>the</strong> coefficients can be found <strong>for</strong> instance at [5].Class: LanczosFilterMethod: LanczosFilter. init (self,filtertype=’bp’, fc1=0.0, fc2=0.5, n=None)Default constructor. filtertype specifies if <strong>the</strong> filter is low (’lp’), high (’hp’) or b<strong>and</strong>(’bp’) pass. The cut-<strong>of</strong>f frequencies <strong>for</strong> <strong>the</strong> b<strong>and</strong>pass case are <strong>set</strong> in fc1 <strong>and</strong> fc2. If <strong>the</strong>filtertype is <strong>set</strong> to ’lp’ or ’hp’ both cut-<strong>of</strong>f frequencies must be equal. B<strong>and</strong>–pass filterwill be assumed if <strong>the</strong> frequencies are different, regardless you have specified o<strong>the</strong>rtype <strong>of</strong> filter!The number <strong>of</strong> different coefficients to be calculated is <strong>set</strong> with <strong>the</strong> parameter n. Eventhough it has a default value that is appropiate in <strong>the</strong> b<strong>and</strong>–pass case, it is stronglyrecommended not to use <strong>the</strong> default value in any o<strong>the</strong>r case (high–pass or low–pass) [5].Method: LanczosFilter.getcoefs(self)As in section 10.1 this function returns <strong>the</strong> coefficients that are being used in <strong>the</strong> filter.11 Differential operators: diffoperators.pySome <strong>routines</strong> to compute differential operators on <strong>the</strong> sphere specially suited <strong>for</strong> climateanalysis are provided. By now, <strong>the</strong>y only process regular latitude–longitude grids.The operators make <strong>the</strong> computations by means <strong>of</strong> centered differences, except at <strong>the</strong>borders, where <strong>the</strong>y use backward or <strong>for</strong>ward differences. Periodic boundary conditionsare supported in <strong>the</strong> zonal axis. All <strong>the</strong> operators assume that <strong>the</strong> input fields areorganized according to <strong>the</strong> COARDS scheme ([latindex,lonindex]), with o<strong>the</strong>r dimensions(time, vertical level) prepending <strong>the</strong> latitude <strong>and</strong> longitude axis <strong>of</strong> <strong>the</strong> arrays.Class: HGRADIENTMethod: HGRADIENT. init (self,lats,lons,asdegrees=1,PBlon=0)This is <strong>the</strong> constructor <strong>for</strong> <strong>the</strong> horizontal gradient calculator. lats is a NumPy arraywhich holds <strong>the</strong> latitudes corresponding to <strong>the</strong> grid points, lons holds <strong>the</strong> longitudes <strong>of</strong><strong>the</strong> grid points <strong>and</strong> if <strong>the</strong> optional parameter asdegrees is <strong>set</strong> to true, it means that <strong>the</strong>input angular variables are expressed as degrees, not radians. PBlon is true if periodicboundary conditions are to be applied in <strong>the</strong> longitudinal axis. In this case, secondorder centered differences are used in <strong>the</strong> whole zonal domain.Method: HGRADIENT.hgradient(self,hfield,R=6.37e6)Given as input <strong>the</strong> horizontal field hfield (Y), get as a result a tuple which holds <strong>the</strong>[gbed []\_^+`Vacbedzonal <strong>and</strong> meridional components <strong>of</strong> <strong>the</strong> gradient on <strong>the</strong> sphere (is assigned by default <strong>the</strong> radius <strong>of</strong> <strong>the</strong> Earth.Class: HDIVERGENCEMethod: HDIVERGENCE. init (self,lats,lons,asdegrees=1,PBlon=0)Default constructor, with parameters defined as <strong>for</strong> <strong>the</strong> gradient operator.,Z befba). R14

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

Saved successfully!

Ooh no, something went wrong!