- Timestamp:
- Sep 30, 2019, 5:57:34 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/generic_tools.py
r2712 r2715 130 130 # fromanydate_CFYmd: Function to transform from any string format of date to Y-m-d used in 131 131 # CF-conventions 132 # gamma_TS_S99: Function to compute a gamma factor from which construct an equivalent 133 # T-student distribution from a given numbers of freedom and apair of sigma values 134 # after von Storch, H. and Zwiers, F. W. (1999) 132 135 # gen_impose_gregorian: Function to impose gregorian calendar to a series of times with a 133 136 # non-standard calendar independently from datetime (imposes yr > 1900) … … 226 229 # sign: Function to provide the sign of a number 227 230 # singleline_printing_class: Function to print all the values of a given class in a single line to be parseavel 231 # snr_K08: Function to compute the signal-to-noise-ratio after Kendon et al., 2008 228 232 # stagger_unstagger: Function to de-stagger a variable 229 233 # stats_Slist: Function to provide extremes from a string as a list separated by a given character … … 17183 17187 return factor, vals2 17184 17188 17189 def snr_K08(signal,sigx,sigy): 17190 """ Function to compute the signal-to-noise-ratio after Kendon et al., 2008, J. 17191 Climate, 21(17):4280â4297 17192 signal: signal to find the noise ratio 17193 sigx, sigy: 2 standard deviation to compute the noise 17194 """ 17195 fname = 'snr_K08' 17196 17197 snr = signal/(np.sqrt(sigx**2+sigy**2)/2.) 17198 17199 return snr 17200 17201 def gamma_TS_S99(counts, sigx, sigy): 17202 """ Function to compute a gamma factor from which construct an equivalent 17203 T-student distribution from a given numbers of freedom and apair of sigma values 17204 after von Storch, H. and Zwiers, F. W. (1999). Statistical analysis in 17205 climate research. Cambridge University Press, page 484. 17206 counts: number of degrees of freedom 17207 sigx, sigy: pair of standard deviation 17208 """ 17209 fname = 'gamma_TS_S99' 17210 17211 gamma = (counts-1)*( (1+(sigy/sigx)**2)**2/(1+(sigy/sigx)**4) ) 17212 17213 return gamma 17214 17185 17215 #quit() 17186 17216
Note: See TracChangeset
for help on using the changeset viewer.