?PNG  IHDR ? f ??C1 sRGB ?? gAMA ? a pHYs ? ??od GIDATx^LeY?a?("Bh?_????q5k?*:t0A-o??]VkJM??f?8\k2ll1]q????T
Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/user1137782/www/china1.by/classwithtostring.php on line 86

Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 213

Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 214

Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 215

Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 216

Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 217

Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 218
sJc@ sdZddklZddkZddkZddkZddkZddkZei Z ddk l Z ddk i Z ddkiZdZdZdZdZed Zd d Zd Zd ZdZddeed ededZeZdedZ=ddk>Z>ddk?Z?e?i@d?ZAd@ZBdAZCdBZDdCZEdDZFdEZGddFZHeedGZIddHedIZJdd dJZKdKdLZLe?i@dMdNZMdOZNdPZOdQZPdRZQedSZRdTZSdUZTdVZUdWZVdXedYdZd[ZWd=d d d\eed]ee$d^ ZXd_fd`YZYdaeYfdbYZZdceYfddYZ[dee[fdfYZ\dgeYfdhYZ]dieYfdjYZ^dke\fdlYZ_dme\fdnYZ`doe\fdpYZadqeYfdrYZbdsebfdtYZche^eid6e]eie6e]eif6e]eig6e\eih6e\eii6eYeij6eZeik6ZleduZmdvZnedwdwedxZod\ed]ee#dyZpdzd{Zqe$eq_re$d|Zsd}Zted~ZudZvdZwdZxdZydZzdZ{dZ|dMedZ}dZ~dZdZdS(s Numerical python functions written for compatability with matlab(TM) commands with the same names. Matlab(TM) compatible functions ------------------------------- :func:`cohere` Coherence (normalized cross spectral density) :func:`csd` Cross spectral density uing Welch's average periodogram :func:`detrend` Remove the mean or best fit line from an array :func:`find` Return the indices where some condition is true; numpy.nonzero is similar but more general. :func:`griddata` interpolate irregularly distributed data to a regular grid. :func:`prctile` find the percentiles of a sequence :func:`prepca` Principal Component Analysis :func:`psd` Power spectral density uing Welch's average periodogram :func:`rk4` A 4th order runge kutta integrator for 1D or ND systems :func:`specgram` Spectrogram (power spectral density over segments of time) Miscellaneous functions ------------------------- Functions that don't exist in matlab(TM), but are useful anyway: :meth:`cohere_pairs` Coherence over all pairs. This is not a matlab function, but we compute coherence a lot in my lab, and we compute it for a lot of pairs. This function is optimized to do this efficiently by caching the direct FFTs. :meth:`rk4` A 4th order Runge-Kutta ODE integrator in case you ever find yourself stranded without scipy (and the far superior scipy.integrate tools) :meth:`contiguous_regions` return the indices of the regions spanned by some logical mask :meth:`cross_from_below` return the indices where a 1D array crosses a threshold from below :meth:`cross_from_above` return the indices where a 1D array crosses a threshold from above record array helper functions ------------------------------- A collection of helper methods for numpyrecord arrays .. _htmlonly: See :ref:`misc-examples-index` :meth:`rec2txt` pretty print a record array :meth:`rec2csv` store record array in CSV file :meth:`csv2rec` import record array from CSV file with type inspection :meth:`rec_append_fields` adds field(s)/array(s) to record array :meth:`rec_drop_fields` drop fields from record array :meth:`rec_join` join two record arrays on sequence of fields :meth:`rec_groupby` summarize data by groups (similar to SQL GROUP BY) :meth:`rec_summarize` helper code to filter rec array fields into new fields For the rec viewer functions(e rec2csv), there are a bunch of Format objects you can pass into the functions that will do things like color negative values red, set percent formatting and scaling, etc. Example usage:: r = csv2rec('somefile.csv', checkrows=0) formatd = dict( weight = FormatFloat(2), change = FormatPercent(2), cost = FormatThousands(2), ) rec2excel(r, 'test.xls', formatd=formatd) rec2csv(r, 'test.csv', formatd=formatd) scroll = rec2gtk(r, formatd=formatd) win = gtk.Window() win.set_size_request(600,800) win.add(scroll) win.show_all() gtk.main() Deprecated functions --------------------- The following are deprecated; please import directly from numpy (with care--function signatures may differ): :meth:`load` load ASCII file - use numpy.loadtxt :meth:`save` save ASCII file - use numpy.savetxt i(tdivisionN(tverbosecC s.tititi|ti||S(N(tnptexptlinspacetlog(txmintxmaxtN((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pytlogspacescC stiti||S(sreturn sqrt(x dot x)(Rtsqrttdot(tx((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyt_normscC stit||S(s+return x times the hanning window of len(x)(Rthanningtlen(R ((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pytwindow_hanningscC s|S(s#No window function; simply return x((R ((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyt window_nonescC sA|djp |djo t|S|djo t|SdS(Ntconstanttlinear(tNonet detrend_meantdetrend_linear(R tkey((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pytdetrends  icC sti|}|djp|djp|idjo||i|Stdg|i}ti||<||i||S(s0Return x minus its mean along the specified axisiiN(RtasarrayRtndimtmeantslicetnewaxis(R taxistind((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pytdemeans * cC s||iS(sReturn x minus the mean(x)(R(R ((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyRscC s|S(sReturn x: no detrending((R ((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyt detrend_nonescC srtit|dti}ti||dd}|d|d}|i||i}||||S(s2Return y minus best fit line; 'linear' detrending tdtypetbiasii(ii(ii(RtarangeRtfloat_tcovR(tyR tCtbta((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyRs iitdefaultc  C s||j} ti|}| pti|}nt||jo/t|} ti||f}d|| )n| oBt||jo/t|} ti||f}d|| )n|djo |}n| djo t} n|djoti|p |djo|} d} n2|d jo|dd} d} n td | o| |} nti |o$t||jpt |}n|ti |f|i }||}ti dt||d|}t|} ti| | fti}xt| D]}||||||!}|||}tii|d |}| o |}nB||||||!}|||}tii|d |}ti|| || |dd|f coherence vector for that pair. I.e., ``Cxy[(i,j) = cohere(X[:,i], X[:,j])``. Number of dictionary keys is ``len(ij)``. - *Phase*: dictionary of phases of the cross spectral density at each frequency for each pair. Keys are (*i*, *j*). - *freqs*: vector of frequencies, equal in length to either the coherence or phase vectors for any (*i*, *j*) key. Eg., to make a coherence Bode plot:: subplot(211) plot( freqs, Cxy[(12,19)]) subplot(212) plot( freqs, Phase[(12,19)]) For a large number of pairs, :func:`cohere_pairs` can be much more efficient than just calling :func:`cohere` for each pair, because it caches most of the intensive computations. If :math:`N` is the number of pairs, this function is :math:`O(N)` for most of the heavy lifting, whereas calling cohere for each pair is :math:`O(N^2)`. However, because of the caching, it is also more memory intensive, making 2 additional complex arrays with approximately the same number of elements as *X*. See :file:`test/cohere_pairs_test.py` in the src tree for an example script that shows that this :func:`cohere_pairs` and :func:`cohere` give the same results for a given pair. .. seealso:: :func:`psd` For information about the methods used to compute :math:`P_{xy}`, :math:`P_{xx}` and :math:`P_{yy}`. Niiis Cacheing FFTsR"i sComputing coherences(RZRR7R"tsettaddRR1R3R4R5R6R9tlinalgtnormR8R:R;R]RR<tarctan2timagRWR$($tXtijR@RARRBRCtpreferSpeedOverMemorytprogressCallbackt returnPxxtnumRowstnumColsttmpt allColumnsRMtjtNcolsRHRJRt numSlicest FFTSlicest FFTConjSlicesRXtslicestnormValtiColtSlicestiSlicet thisSliceRatPhasetcountRRLRS((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyt cohere_pairss|Q         "* -      *&cC sti||\}}|iti}ti|ti|d}ti|t|}|d|d}dti|t |t |}|S(s Return the entropy of the data in *y*. .. math:: \sum p_i \log_2(p_i) where :math:`p_i` is the probability of observing *y* in the :math:`i^{th}` bin of *bins*. *bins* can be a number of bins or a range of bins; see :func:`numpy.histogram`. Compare *S* with analytic calculation for a Gaussian:: x = mu + sigma * randn(200000) Sanalytic = 0.5 * ( 1.0 + log(2*pi*sigma**2.0) ) iig( Rt histogramtastypeR%ttaketnonzeroR]RR=R(R'tbinsR.tptdeltatS((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pytentropys'cG sI|\}}dtidti|tidd|||dS(sCReturn the normal pdf evaluated at *x*; args provides *mu*, *sigma*g?ig(RR tpiR(R Rctmutsigma((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pytnormpdfs c C st|}|ddjotddn|d|d}d||ti| d|dti}titi|d|ttid|dtg}|d|d}t| tidt ||}ti i ti |||i ti} ti | |S(s@Returm the levy pdf evaluated at *x* for params *gamma*, *alpha*iis%x must be an event length array; try s/x = np.linspace(minx, maxx, N), where N is eveni( RR2RR$R%R?tintRR^RR:RR( R tgammatalphaRtdxR_Rtdftcfltpx((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pytlevypdfs  -&.cC stiti|\}|S(s1Return the indices where ravel(condition) is true(RRtravel(t conditiontres((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pytfindscC sDti|}t|djotigS|djid}t|djotit|St|t|jotigStit|df|i}||dd+ti|}|djid}|djid}||t ||jidd}ti||||}|S(s Return the indices of the longest stretch of contiguous ones in *x*, assuming *x* is a vector of zeros and ones. If there are two equally long stretches, pick the first. iiii( RRRtarrayRR$R7R"tdifftmax(R RR'tdiftuptdnRM((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pytlongest_contiguous_oness " (cC s t|S(s!alias for longest_contiguous_ones(R(R ((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyt longest_onessc C stii|\}}}|d|id}|i}||}t||ji}|dd|fi} ti| |} | | ||fS(s Compute the principal components of *P*. *P* is a (*numVars*, *numObs*) array. *frac* is the minimum fraction of variance that a component must contain to be included. Return value is a tuple of the form (*Pcomponents*, *Trans*, *fracVar*) where: - *Pcomponents* : a (numVars, numObs) array - *Trans* : the weights matrix, ie, *Pcomponents* = *Trans* * *P* - *fracVar* : the fraction of the variance accounted for by each component returned A similar function of the same name was in the Matlab (TM) R13 Neural Network Toolbox but is not found in later versions; its successor seems to be called "processpcs". iiN(RRgtsvdRZR=Rt transposeR ( tPtfractUtstvtvarEachttotVartfracVarRtTranst Pcomponents((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pytprepcas  gg9@gI@gR@gY@cC sti|i}|it|}ti|p|t||dSti||d}|i t}ti ||j|d|}|i |S(sS Return the percentiles of *x*. *p* can either be a sequence of percentile values or a scalar. If *p* is a sequence, the ith element of the return sequence is the *p*(i)-th percentile of *x*. If *p* is a scalar, the largest value of *x* less than or equal to the *p* percentage point in the sequence is returned. gY@i( RRRtsortRR3R4RRRtwhereR(R RtNxR((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pytprctiles   cC sti|p!tid|dd|}nti|}|idjp&|idjp|idjotdnt||}ti ||S(s Return the rank for each element in *x*, return the rank 0..len(*p*). Eg if *p* = (25, 50, 75), the return value will be a len(*x*) array with values in [0,1,2,3] where 0 indicates the value is less than the 25th percentile, 1 indicates the value is >= the 25th and < 50th percentile, ... and 3 indicates the value is above the 75th percentile cutoff. *p* is either an array of percentiles in [0..100] or a scalar which indicates how many quantiles of data you want ranked. gY@iiids/percentiles should be in range 0..100, not 0..1( R3R4RR$RRtminR2Rt searchsorted(R Rtptiles((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyt prctile_rank/s !9cC sti|ti}|o*||idd|idd}nS||iddddtif}||iddddtif}|S(s Return the matrix *M* with each row having zero mean and unit std. If *dim* = 1 operate on columns instead of rows. (*dim* is opposite to the numpy axis kwarg.) RiiN(RRR%RtstdR(tMtdim((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyt center_matrixGs *))c C syt|}Wn1tj o%tit|fti}n#Xtit||fti}||d`_ at mathworld. ii(RRR R( RktYtsigmaxtsigmaytmuxtmuytsigmaxytXmutYmutrhotztdenom((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pytbivariate_normals  :*cC s1ti|i\}}||||||fS(s. *Z* and *Cond* are *M* x *N* matrices. *Z* are data and *Cond* is a boolean matrix where some condition is satisfied. Return value is (*x*, *y*, *z*) where *x* and *y* are the indices into *Z* and *z* are the values of *Z* at those indices. *x*, *y*, and *z* are 1D arrays. (RtindicesRZ(tZtCondRkR((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyt get_xyz_wheresg?cC sti||fd}xmtt|||D]Q}tiid|d}tiid|d}tii|||f`_. .. note:: What the function here calculates may not be what you really want; *caveat emptor*. It also seems that this function's name is badly misspelled. s6This does not belong in matplotlib and will be removed(twarningstwarntDeprecationWarningRRRR^(R tfprime((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyt liaupunovst FIFOBuffercB sDeZdZdZdZdZdZdZdZRS(s A FIFO queue to hold incoming *x*, *y* data in a rotating buffer using numpy arrays under the hood. It is assumed that you will call asarrays much less frequently than you add data to the queue -- otherwise another data structure will be faster. This can be used to support plots where data is added from a real time feed and the plot object wants to grab data from the buffer and plot it to screen less freqeuently than the incoming. If you set the *dataLim* attr to :class:`~matplotlib.transforms.BBox` (eg :attr:`matplotlib.Axes.dataLim`), the *dataLim* will be updated as new data come in. TODO: add a grow method that will extend nmax .. note:: mlab seems like the wrong place for this class. cC sti|fti|_ti|fti|_ti|fti|_ti|fti|_d|_||_d|_ h|_ dS(s- Buffer up to *nmax* points. iN( RR7R%t_xat_yat_xst_yst_indt_nmaxRtdataLimt callbackd(tselftnmax((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyt__init__Fs   cC s |ii|gi|dS(sk Call *func* every time *N* events are passed; *func* signature is ``func(fifo)``. N(Rt setdefaulttappend(RtfuncR((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pytregisterSscC s|idj o/ti||fg}|ii|dn|i|i}||i|<||i|g}t| | D]\}}|| ||q{~}t |}| i |qxWt i| |} | i\}}|djp |djot||f| _n|o | iS| SdS(s Load ASCII data from *fname* into an array and return the array. Deprecated: use numpy.loadtxt. The data must be regular, same number of values in every row *fname* can be a filename or a file handle. Support for gzipped files is automatic, if the filename ends in '.gz'. matfile data is not supported; for that, use :mod:`scipy.io.mio` module. Example usage:: X = load('test.dat') # data in two columns t = X[:,0] y = X[:,1] Alternatively, you can do the same with "unpack"; see below:: X = load('test.dat') # a matrix of data x = load('test.dat') # a single column of data - *comments*: the character used to indicate the start of a comment in the file - *delimiter* is a string-like character used to seperate values in the file. If *delimiter* is unspecified or *None*, any whitespace string is a separator. - *converters*, if not *None*, is a dictionary mapping column number to a function that will convert that column to a float (or the optional *dtype* if specified). Eg, if column 0 is a date string:: converters = {0:datestr2num} - *skiprows* is the number of rows from the top to skip. - *usecols*, if not *None*, is a sequence of integer column indexes to extract where 0 is the first column, eg ``usecols=[1,4,5]`` to extract just the 2nd, 5th and 6th columns - *unpack*, if *True*, will transpose the matrix allowing you to unpack into named arguments on the left hand side:: t,y = load('test.dat', unpack=True) # for two column data x,y,z = load('somefile.dat', usecols=[3,5,7], unpack=True) - *dtype*: the array will have this dtype. default: ``numpy.float_`` .. seealso:: See :file:`examples/pylab_examples/load_converter.py` in the source tree Exercises many of these options. suse numpy.loadtxtR cS s |iS(N(tsplit(R ((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyt splitfuncsc s |iS(N(R5(R (R-(s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyR6siiN(RRRRR3t to_filehandlet enumerateR5tstripRtgetR>R RRRZRR(R+tcommentsR-t converterstskiprowstusecolstunpackR"R.RkR6t converterseqRMtlineR1RtR2tvalst_[2]R0t_[3]tthisLentrtc((R-s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pytloadsB;       <  36  ggcC sAt|tijotti|ttSti|SdS(s Compute exponentials which safely underflow to zero. Slow, but convenient to use. Note that numpy provides proper floating point exception handling with access to the underlying hardware. N(ttypeRtndarrayRtclipt exp_safe_MINt exp_safe_MAXtmath(R ((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pytexp_safees cG stit||S(s amap(function, sequence[, sequence, ...]) -> array. Works like :func:`map`, but it returns an array. This is just a convenient shorthand for ``numpy.array(map(...))``. (RRtmap(tfnRc((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pytamapsscC s#tititi|dS(sP Return the root mean square of all the elements of *a*, flattened out. i(RR RR^(R*((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pytrms_flat}scC stiti|S(s Return the *l1* norm of *a*, flattened out. Implemented as a separate function (not a call to :func:`norm` for speed). (RR=R^(R*((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pytl1normscC s#tititi|dS(s Return the *l2* norm of *a*, flattened out. Implemented as a separate function (not a call to :func:`norm` for speed). i(RR R=R^(R*((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pytl2normscC sJ|djotiti|Stiti||d|SdS(s norm(a,p=2) -> l-p norm of a.flat Return the l-p norm of *a*, considered as a flat array. This is NOT a true matrix norm, since arrays of arbitrary rank are always flattened. *p* can be a number or the string 'Infinity' to get the L-infinity norm. tInfinityg?N(RtamaxR^R=(R*R((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyt norm_flats cK s|idd|ddj}|djo|d}d}n|djo d}ny&|d}||t||}Wn1tj o%tt||||}nXti|||S(s frange([start,] stop[, step, keywords]) -> array of floats Return a numpy ndarray containing a progression of floats. Similar to :func:`numpy.arange`, but defaults to a closed interval. ``frange(x0, x1)`` returns ``[x0, x0+1, x0+2, ..., x1]``; *start* defaults to 0, and the endpoint *is included*. This behavior is different from that of :func:`range` and :func:`numpy.arange`. This is deliberate, since :func:`frange` will probably be more useful for generating lists of points for function evaluation, and endpoints are often desired in this use. The usual behavior of :func:`range` can be obtained by setting the keyword *closed* = 0, in this case, :func:`frange` basically becomes :func:numpy.arange`. When *step* is given, it specifies the increment (or decrement). All arguments can be floating point numbers. ``frange(x0,x1,d)`` returns ``[x0,x0+d,x0+2d,...,xfin]`` where *xfin* <= *x1*. :func:`frange` can also be called with the keyword *npts*. This sets the number of points the list should contain (and overrides the value *step* might have been given). :func:`numpy.arange` doesn't offer this option. Examples:: >>> frange(3) array([ 0., 1., 2., 3.]) >>> frange(3,closed=0) array([ 0., 1., 2.]) >>> frange(1,6,2) array([1, 3, 5]) or 1,3,5,7, depending on floating point vagueries >>> frange(1,6.5,npts=5) array([ 1. , 2.375, 3.75 , 5.125, 6.5 ]) tclosediigg?tnptsN(R RR>tKeyErrorRtroundRR$(txinitxfinRtkwtendpointRZ((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pytfranges)      #tlcC sb|dj o |}nti|f||}x+t|D]}|f|}d||ti|do*t|t|jo tdq~n|g}|g}tti|}|djo(g}|D]}||i q~}nti|p |g}nt|t|jo4t|djo|t|}q/tdnti |i i t ||}ti |i d|}x"|i iD]}||||Wtii|d|S(sL *r* is a numpy record array *summaryfuncs* is a list of (*attr*, *func*, *outname*) tuples which will apply *func* to the the array *r*[attr] and assign the output to a new attribute name *outname*. The returned record array is identical to *r*, with extra arrays for each element in *summaryfuncs*. R(RR"RR RRRR( RFt summaryfuncsRR1RRRR R((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyt rec_summarizes % $tinnerR~t2c2% stio fnx\D]T}|iijotd|n|iijotd|q$q$Wfd}tg} tD]\} } | || | fq~ } tg} tD]\} } | || | fq~ }t| i}t|i}||@}t i g}|D]}|| |qH~}t i g}|D]}|||qv~}t |}d}}|djp |djoM|i |}t i g}|D]}|| |q~}t |}n|djoM|i |}t i g}|D]}|||q=~}t |}nfd} g}!D]}|!| |q~!}"fd}#fd }$g}%ii D]6}&|&djo|%|#|&d|&d fqq~%}'g}(ii D]6}&|&djo|(|$|&d|&d fq+q+~(})t i|"|'|)}*t i|||fd |*}+|dj oCx@|D]4},|,|*ijotid |,|*ifqqWnx9|*iD].}|*|}-|-idjod|+|,RtnanRtstrRt startswithReRfR8R9tlowerRyR*R:R R#R5R2R"RRRtanytnumpy.maRt ImportErrort RuntimeErrorRR((R+R;R=RR-RRRRt use_mrecordstdateutilR t parsedateRRRtitemdRt needheaderR0theaderstdeletetseenRMRR1RGtcntRCR.R<RtrowmasksRDR RR2RRRF((RRRRRRRRRRR.RRRRR=Rs5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pytcsv2recjs,           !   !    ;   4     !  FD  t FormatObjcB s#eZdZdZdZRS(cC s |i|S(N(ttoval(RR ((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyttostrnscC s t|S(N(R(RR ((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyR!qscC s|S(N((RR((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pytfromstrts(RRR"R!R#(((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyR ms  t FormatStringcB seZdZRS(cC st|}|dd!S(Nii(Rx(RR R2((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyR"xs (RRR"(((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyR$wstFormatFormatStrcB seZdZdZRS(cC s ||_dS(N(R,(RR,((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyR scC s&|djodS|i|i|S(NR(RR,R!(RR ((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyR"s (RRR R"(((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyR%s t FormatFloatcB s)eZdddZdZdZRS(ig?cC s*ti|d|||_||_dS(Ns%%1.%df(R%R t precisiontscale(RR'R(((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyR s cC s"|dj o||i}n|S(N(RR((RR ((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyR!s cC st||iS(N(R>R((RR((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyR#s(RRR R!R#(((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyR&s t FormatIntcB s#eZdZdZdZRS(cC sdt|S(Ns%d(R(RR ((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyR"scC s t|S(N(R(RR ((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyR!scC s t|S(N(R(RR((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyR#s(RRR"R!R#(((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyR)s  t FormatBoolcB seZdZdZRS(cC s t|S(N(R(RR ((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyR!scC s t|S(N(tbool(RR((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyR#s(RRR!R#(((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyR*s t FormatPercentcB seZddZRS(icC sti||dddS(NR(gY@(R&R (RR'((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyR s(RRR (((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyR,stFormatThousandscB seZddZRS(icC sti||dddS(NR(gMbP?(R&R (RR'((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyR s(RRR (((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyR-stFormatMillionscB seZddZRS(icC sti||dddS(NR(gư>(R&R (RR'((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyR s(RRR (((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyR.st FormatDatecB s#eZdZdZdZRS(cC s ||_dS(N(R,(RR,((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyR scC s"|djodS|i|iS(NR(RtstrftimeR,(RR ((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyR!s cC s"ddk}|ii|iS(Ni(RR R R(RR R((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyR#s (RRR R!R#(((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyR/s  tFormatDatetimecB seZddZdZRS(s%Y-%m-%d %H:%M:%ScC sti||dS(N(R/R (RR,((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyR scC sddk}|ii|S(Ni(RR R (RR R((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyR#s (RRR R#(((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyR1s cC s|djo t}nxot|iiD][\}}|i|}|i|}|djoti|it}n|||R(Rtatypettdict(tget_type(s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyR< s c  st|d}|tijp0|tijp |tijp|tijo*tt||i}d|dfS|ti jpP|ti jp@|ti jp0|ti jp |ti jp|tijoBtt|titttt|}d|dfS|tijpP|tijp@|tijp0ttdo|tijp|tijo_dt|dtt|titttfd|}d|fSdtt|titttt|dfS( Nis%sis%dtfloat96s%.R_c s|S(((R (R,(s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyt7 s(RIRRtstr_tstring0RRRtitemsizeRtint16tint32tint64tint8tint_RPR>tfloat32tfloat64R(R=R%(tcolnametcolumnR'tntypetlength(Rm(R,s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyt get_justify s@`0`9iic s|\}}}}|djo|dt|i|S|tjo|t|}n(|tjo|t|}n|i|SdS(NiR (RtljustR>Rtrjust(Rtjust_pad_prec_spacertjusttpadtprectspacer(R<(s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyR4O s RrN(RRR3t is_numlikeRR"RRR8t __getitem__R9R R*trstriptostlinesep(RFtheaderRmR'RRMR1RMRItjustify_pad_prectjustify_pad_prec_spacerRQRRRStpjusttppadtpprecR4ttextlRCRttcolitemR0RDttext((R<Rms5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pytrec2txts>  P ! J J c C s|djo t}nd}t||}g}x@t|iiD],\} } |i|t|| iqKWt i |ddt \} } t i | d|} |ii}|o| i|ng}x'|D]} |i|i| |qWt}t|o|d}t|d}nx|D]}|o |i|ii}}ntgt|}| ig}t||||D]%\}}}}|||||q~q9W| o| indS(s3 Save the data from numpy recarray *r* into a comma-/space-/tab-delimited file. The record array dtype names will be used for column headers. *fname*: can be a filename or a file handle. Support for gzipped files is automatic, if the filename ends in '.gz' *withheader*: if withheader is False, do not write the attribute names in the first row .. seealso:: :func:`csv2rec` For information about *missing* and *missingd*, which can be used to fill in masked values into your CSV file. c sfd}|S(Nc s|o|S|SdS(N((R2Rtmval(R (s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyR s((R R((R s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyt with_mask~ sR!t return_openedR-it _fieldmaskN(RRR5R8R"RR R9R"R3R7R0R twritertwriterowR:RRR(RRgRR(RFR+R-R3RRt withheaderReRRMRR.topenedRhRZtmvalstismaskedR0trowmaskR1R R2RRd((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pytrec2csvg s<    $     FtnncC sJy ddkl}l}t}Wn8tj o,ddki} ddkl}t}nXti p:|ot i d|nt i d|tt_ n|i |i jot dn|i djo |i d jot d nt|t|jot|jnpt d nt|d o@|i|itj}|i|itj}|i}n|ot|d jotdn|i d jo0|dddf}|dddf}n|idd|idti|iti}|iti}|iti}|iti} |iti} t| d| dd!djp"t| d| dd!djo tdnti| id| idfti} |i|||| | | n|i |i jot dn|i djo |i d jot d n|i djoti||\}}n| i||} |d jo"| i |}|||} nO|djo5|dddf|dddf}|dddf|dddf}ti!|i"i#}ti!|i"i#}|i$|i|jp|i$|i|jotdn| i%|}||i|i$t&d|id|i|i$t&d|idf} n tdti'ti(| o"ti)i*ti(| | } n| S(s ``zi = griddata(x,y,z,xi,yi)`` fits a surface of the form *z* = *f*(*x*, *y*) to the data in the (usually) nonuniformly spaced vectors (*x*, *y*, *z*). :func:`griddata` interpolates this surface at the points specified by (*xi*, *yi*) to produce *zi*. *xi* and *yi* must describe a regular grid, can be either 1D or 2D, but must be monotonically increasing. A masked array is returned if any grid points are outside convex hull defined by input data (no extrapolation is done). If interp keyword is set to '`nn`' (default), uses natural neighbor interpolation based on Delaunay triangulation. By default, this algorithm is provided by the :mod:`matplotlib.delaunay` package, written by Robert Kern. The triangulation algorithm in this package is known to fail on some nearly pathological cases. For this reason, a separate toolkit (:mod:`mpl_tookits.natgrid`) has been created that provides a more robust algorithm fof triangulation and interpolation. This toolkit is based on the NCAR natgrid library, which contains code that is not redistributable under a BSD-compatible license. When installed, this function will use the :mod:`mpl_toolkits.natgrid` algorithm, otherwise it will use the built-in :mod:`matplotlib.delaunay` package. If the interp keyword is set to '`linear`', then linear interpolation is used instead of natural neighbor. In this case, the output grid is assumed to be regular with a constant grid spacing in both the x and y directions. For regular grids with nonconstant grid spacing, you must use natural neighbor interpolation. Linear interpolation is only valid if :mod:`matplotlib.delaunay` package is used - :mod:`mpl_tookits.natgrid` only provides natural neighbor interpolation. The natgrid matplotlib toolkit can be downloaded from http://sourceforge.net/project/showfiles.php?group_id=80706&package_id=142792 i(t_natgridt __version__N(Rrsusing natgrid version %ssusing delaunay version %ss=inputs xi and yi must have same number of dimensions (1 or 2)iis"inputs xi and yi must be 1D or 2D.s5inputs x,y,z must all be 1D arrays of the same lengthRRpsRonly natural neighor interpolation allowed when using natgrid toolkit in griddata.itexttnuls8output grid defined by xi,yi must be monotone increasingRsAoutput grid must have constant spacing when using interp='linear'sinterp keyword must be one of 'linear' (for linear interpolation) or 'nn' (for natural neighbor interpolation). Default is 'nn'.(+tmpl_toolkits.natgridRqRrR0Rtmatplotlib.delaunaytdelaunayRtgriddatat _reportedRtreportRRRR(tcompressRt compressedR2tsetitsetrRR RR>RRRZtnatgriddtmeshgridt Triangulationtnn_interpolatortfinfoR"t resolutionRtlinear_interpolatortcomplexRRtmat masked_where(R R'RtxityitinterpRqRrt _use_natgridRwtxotyotzottriRtdytepsxtepsy((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyRx s~%     0 D )    **:+3 "c C sti|o |g}nti|}ti|}ti|}t|i}t||d x[-1]``, the routine tries an extrapolation. The relevance of the data obtained from this, of course, is questionable... Original implementation by Halldor Bjornsson, Icelandic Meteorolocial Office, March 2006 halldor at vedur.is Completely reworked and optimized for Python by Norbert Nemec, Institute of Theoretical Physics, University or Regensburg, April 2006 Norbert.Nemec at physik.uni-regensburg.de iiigN(RRR%RZR5RRRR7RRtchooseRtsignRC(RR R'RRRRRRRftsidxtxidxtyidxtxidxp1Rtdy1tdy2tdy1dy2((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pytstineman_interpo s4+    +cC s"titi||\}|S(s *points* is a sequence of *x*, *y* points. *verts* is a sequence of *x*, *y* vertices of a polygon. Return value is a sequence of indices into points for the points that are inside the polygon. (RRtnxutilstpoints_inside_poly(tpointstvertsR((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyt inside_poly scC sti|pti|o t}nt}|i|}|i|}t|}t|}||jpt||id|}|id|}|||*|||*|ddd||)||fS(s, Given a sequence of *xs* and *ys*, return the vertices of a polygon that has a horizontal base at *xmin* and an upper bound at the *ys*. *xmin* is a scalar. Intended for use with :meth:`matplotlib.axes.Axes.fill`, eg:: xv, yv = poly_below(0, x, y) ax.fill(xv, yv) iNi(Rt isMaskedArrayRRRR5R6(RtxstystnxRRR R'((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyt poly_below s      cC sti|p ti|pti|o t}nt}t|}ti|p||i|}nti|p||i|}n|i||dddf}|i||dddf}||fS(sC Given a sequence of *x*, *ylower* and *yupper*, return the polygon that fills the regions between them. *ylower* or *yupper* can be scalar or iterable. If they are iterable, they must be equal in length to *x*. Return value is *x*, *y* arrays for use with :meth:`matplotlib.axes.Axes.fill`. Ni(RRRRR3R4R6R?(R tylowertyupperRRR'((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyt poly_between s 0  ""cC sti|d|djS(s Tests whether first and last object in a sequence are the same. These are presumably coordinates on a polygonal curve, in which case this function tests if that curve is closed. ii(Rtall(Rk((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pytis_closed_polygon scC sd}g}xjt|D]\\}}|djo|o |}q|dj o%| o|i||fd}qqW|dj o|i||dfn|S(s return a list of (ind0, ind1) such that mask[ind0:ind1].all() is True and we cover all such regions TODO: this is a pure python implementation which probably has a much faster numpy impl iN(RR8R (Rt in_regiont boundariesRMR2((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pytcontiguous_regions s   cC s^ti|}|}ti|d |j|d|j@d}t|o |dS|SdS(s return the indices into *x* where *x* crosses some threshold from below, eg the i's where:: x[i-1]=threshold Example code:: import matplotlib.pyplot as plt t = np.arange(0.0, 2.0, 0.1) s = np.sin(2*np.pi*t) fig = plt.figure() ax = fig.add_subplot(111) ax.plot(t, s, '-o') ax.axhline(0.5) ax.axhline(-0.5) ind = cross_from_below(s, 0.5) ax.vlines(t[ind], -1, 1) ind = cross_from_above(s, -0.5) ax.vlines(t[ind], -1, 1) plt.show() .. seealso:: :func:`cross_from_above` and :func:`contiguous_regions` iiiN(RRRR(R t thresholdR((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pytcross_from_below/ s !+ cC sXti|}ti|d |j|d|j@d}t|o |dS|SdS(s return the indices into *x* where *x* crosses some threshold from below, eg the i's where:: x[i-1]>threshold and x[i]<=threshold .. seealso:: :func:`cross_from_below` and :func:`contiguous_regions` iiiN(RRRR(R RR((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pytcross_from_aboveV s + cC s.ti|}ti||d|d|S(s Finds the length of a set of vectors in *n* dimensions. This is like the :func:`numpy.norm` function for vectors, but has the ability to work over a particular axis of the supplied array or matrix. Computes ``(sum((x_i)^P))^(1/P)`` for each ``{x_i}`` being the elements of *X* along the given axis. If *axis* is *None*, compute over all elements of *X*. Rg?(RRR=(RkRR((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pytvector_lengthsj s cC s%ti|dd}t|ddS(s Computes the distance between a set of successive points in *N* dimensions. Where *X* is an *M* x *N* array or matrix. The distances between successive rows is computed. Distance is the standard Euclidean distance. Rii(RRR(Rk((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pytdistances_along_curvew scC s1t|}titidti|fS(s Computes the distance travelled along a polygonal curve in *N* dimensions. Where *X* is an *M* x *N* array or matrix. Returns an array of length *M* consisting of the distance along the curve at each point (i.e., the rows of *X*). i(RRR?R7tcumsum(Rk((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyt path_length s c C sf|d|||d||}}|d|||d||}} |||||| ||fS(s Converts a quadratic Bezier curve to a cubic approximation. The inputs are the *x* and *y* coordinates of the three control points of a quadratic curve, and the output is a tuple of *x* and *y* coordinates of the four control points of the cubic curve. g@g@g?gUUUUUU?gUUUUUU?gUUUUUU?gUUUUUU?(( tq0xtq0ytq1xtq1ytq2xtq2ytc1xtc1ytc2xtc2y((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyt quad2cubic s %%(Rt __future__RR RR6RXtnumpyRRt matplotlibRtmatplotlib.nxutilsRtmatplotlib.cbookR3R R RRRRR RR!RRTRtkwdocdRYRVR[R\RbRdR0RRRRRRRRRRRRRRRRRRRRRRRR3R%RHRtRNRRLRMRORRRSRTRURXRaRgRjR}RRRRRRRRRRRRR R$R%R&R)R*R,R-R.R/R1tbool_RBRCRDRGRHtobject_RR2R5R9RcRoRxRyRRRRRRRRRRRRRR(((s5/usr/lib64/python2.6/site-packages/matplotlib/mlab.pyts0            X :    ' '            G    a 3        D   "   /                   s = s  ) ) ]    '