)Uc@sdZddlZddlZddlmZddljZejjdZ e e e d \Z Z e dko}e dkZidd6d d 6d d 6d d6dd6dd6dd6dd6dd6dd6dd6dd6dd 6d!d"6d#d$6d%d&6d'd(6d)d*6d+d,6d-d.6d d/6d0d16d2d36d4d56d6d76d8d96d:d;6d<d=6d>d?6d@dA6dBdC6dDdE6dFdG6dHdI6dJdK6dLdM6dNdO6dPdQ6dRdS6dTdU6dVdW6dXdY6dZd[6d\d]6d^d_6d`da6dbdc6ddde6dfdg6dhdi6djdk6dldm6dndo6dpdq6drds6dtdu6dvdw6dxdy6dzd{6d|d}6d~d6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6d`d6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6d d 6d d 6d d6dd6dd6dd6dd6dd6dd6ZxNejD]@\ZZejdkdkr`ejdkdZeee (0.93725, 0.93725, 0.93725) s$hex2color requires a string argumentsinvalid hex color string "%s"iiiiigo@N( t isinstancet basestringt TypeErrorthexColorPatterntmatchtNoneRRtint(tstn((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/colors.pyt hex2colors tColorConvertercBsseZdZidd6dd6dd6dd6dd 6dd 6dd 6dd 6ZiZdZddZddZRS(s Provides methods for converting color specifications to *RGB* or *RGBA* Caching is used for more efficient conversion upon repeated calls with the same argument. Ordinarily only the single instance instantiated in this module, *colorConverter*, is needed. gg?tbg?tgtrg?RitmtytktwcCsDy|j|SWnytk r"nitk rt|}y|j|SWqtk r]qtk rtdt|fqXnXyztj|rF|j}|j j |d }|d krt j ||}|j drt|}qCt|}|dks|dkr-tdnt|gd}qntj|rt|dksyt|dkrtdt|nt|d }g|D]*}t|dks|dkr|^qrtd qn td ||j| than that given). The list must start with x=0, end with x=1, and all values of x must be in increasing order. Values between the given mapping points are determined by simple linear interpolation. Alternatively, data can be a function mapping values between 0 - 1 to 0 - 1. The function returns an array "result" where ``result[x*(N-1)]`` gives the closest value for values of x between 0 and 1. iiRs$data must be convertable to an arrayiisdata must be nx3 formatNgig?s9data mapping points must start with x=0. and end with x=1s3data mapping points must have x in increasing order(tcallableRtlinspacetclipRRRRRRtsometruetsortRt searchsorted( tNtdatatgammatxindtluttadataRRty0ty1tind((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/colors.pytmakeMappingArrays< - "   !**tColormapcBsqeZdZddZd edZdd dZdd dZdd dZ dZ d Z d Z RS( sBase class for all scalar to rgb mappings Important methods: * :meth:`set_bad` * :meth:`set_under` * :meth:`set_over` icCs]||_||_d|_d|_d|_||_|d|_|d|_t |_ dS(s Public class attributes: :attr:`N` : number of rgb quantization levels :attr:`name` : name of colormap giiN(gggg( tnameRt _rgba_badRt _rgba_undert _rgba_overt_i_undert_i_overt_i_badRt_isinit(RRR((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/colors.pyt__init__s        c Cs|js|jnd }tj|sFd}tj|g}n9d}tj|dt}|j d}tj |}|j j tj dkrtj||dkdtrtj||jd|jd |ntj||jd|j}|jt}ntj|||jd k|jtj||dk|j|d k r|j|jkrtj|||jn|r|jd jtj}n|jj}|d k r't|d}t|d }|ddkjr||d ddf len(colors) the list will be extended by repetition. iN(RRRRRRRRRtlistRRRR(RRRRR4((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/colors.pyRs*        cCstjg|jD]}tj|^qtj}tj|jddftj|_||jddddfeZdZdddddddZdZddZRS( s9 Create a light source coming from the specified azimuth and elevation. Angles are in degrees, with the azimuth measured clockwise from north and elevation up from the zero plane of the surface. The :meth:`shade` is used to produce rgb values for a shaded relief image given a data array. i;i-iicCs:||_||_||_||_||_||_dS(s Specify the azimuth (measured clockwise from south) and altitude (measured up from the plane of the surface) of the light source in degrees. The color of the resulting image will be darkened by moving the (s,v) values (in hsv colorspace) toward (hsv_min_sat, hsv_min_val) in the shaded regions, or lightened by sliding (s,v) toward (hsv_max_sat hsv_max_val) in regions that are illuminated. The default extremes are chose so that completely shaded points are nearly black (s = 1, v = 0) and completely illuminated points are nearly white (s = 0, v = 1). N(tazdegtaltdegt hsv_min_valt hsv_max_valt hsv_min_satt hsv_max_sat(RRTRURVRWRXRY((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/colors.pyR&s      cCsh|||j|j|j}|j|d|}||ddddddf<|S(sE Take the input data array, convert to HSV values in the given colormap, then adjust those color values to given the impression of a shaded relief map with a specified light source. RGBA values are returned, which can then be used to plot the shaded image with imshow. t elevationNii(RRt shade_rgb(RRtcmaptrgb0trgb1((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/colors.pytshade=s *%g?c Cso|jtjd}|jtjd}tj|\}}dtjtjtj||}tj||} tj|tj|tj |tj |tj | | dtj} | | j | j | j } d| d|} t |ddddddf} tj tjtj| dddddfd k| dkd| | dddddf| |j| dddddf| dddddf2sT       =l?Q@C