
    h2                     ,   S SK rS SKrS SKJr  S rS rS r  SS jrSS jr	SS jr
 " S	 S
5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S5      r " S S\5      r " S S\5      rg)    N)ExtremeFinderSimplec                 R   / SQn/ SQnS/[        U5      -  n/ SQn/ SQn[        R                  " U5      S-  nS/[        U5      -  n[        R                  " U5      S-  nS	/[        U5      -  n	/ UQUQUQn
/ UQUQUQn/ U	QUQUQn[        R                  " X5      nX   nX<   nX4$ )
N)
      ?            (   F   x   i  i  )
         
         -   Z      ih        ?)r         @      @            r   )r   r   r   r   r   r   r	   r   <         N@        @lennparraysearchsorted)dvdegree_limits_degree_steps_degree_factorsminsec_limits_minsec_steps_minute_limits_minute_factorssecond_limits_second_factorsdegree_limitsdegree_stepsnstepfactors                  V/var/www/html/env/lib/python3.13/site-packages/mpl_toolkits/axisartist/angle_helper.pyselect_step_degreer6      s    ?N?MTC..N7N7MXXn-2NUS00NXXn-4NWs>22NGnG~GGMC]C]C]CLH~HHHN
*A?DF<    c                 R   / SQn/ SQnS/[        U5      -  n/ SQn/ SQn[        R                  " U5      S-  nS/[        U5      -  n[        R                  " U5      S-  nS	/[        U5      -  n	/ UQUQUQn
/ UQUQUQn/ U	QUQUQn[        R                  " X5      nX   nX<   nX4$ )
N)	r   r   r   r   r   r   r      $   )	r   r   r         r      r      r   )r   r   r   g      @g      @r   r      r   r   r   )r   r   r   r;   r   r<   r   r=   r   r	   r   r   r   r   r    r!   )r&   hour_limits_hour_steps_hour_factorsr*   r+   r,   r-   r.   r/   hour_limits
hour_stepsr2   r3   r4   s                  r5   select_step_hourrE   !   s    8L8K4#k**LENEMXXn-2NUS00NXXn-4NWs>22NCNC^ClCK?=?=?;?JD^DnD|DL
(A=D_F<r7   c                     S[        [        R                  " U 5      5      S-
  -  nSU-  nSU-  U :  a  SnX24$ SU-  U :  a  SnX24$ SU-  U :  a  SnX24$ SnS	U-  nX24$ )
Ng      $@r   r   r   g      @r   g      @r   g?)intmathlog10)r&   tmpr4   r3   s       r5   select_step_subrK   ;   s     DJJrN#B&
'CVF
3w"} < 
C2 < 
C2
 < V<r7   c                 z   X:  a  XpX-
  U-  nU(       a	  [         nSnO[        nSnUSU-  :  a  U" U5      u  pO[        Xe-  5      u  pX-  n
[        R                  " [        R
                  " X
-  U	-  5      [        R                  " X-  U	-  5      S-   [        S9U	-  n[        U5      nU
S:X  at  US   US   U-   :  ae  [        X-  5      nU(       a%  US   [        R                  " SUS-   S5      U	-  -   nO!US   [        R                  " SUS5      U	-  -   n[        U5      n[        R                  " U5      X4$ )	Ng      8@     v@r   g      ?)dtyper   r   )
rE   r6   rK   r#   arangefloorceilrG   r"   r$   )v1v2nvhourinclude_lastthreshold_factorr&   _select_stepcycler3   r4   levsr2   s                r5   select_stepr\   O   s>    
wB
'RB') 
A   #B'f&r':;*99RXXbkD01WWR[4/036 "&'D 	D	A
 |RDGeO37RYYq"Q$2T99D7RYYq"a0477DI88D>1$$r7   c           	      B    U S-  US-  p[        XUSUUS9u  pVnUS-  Xg4$ )Nr   TrV   rW   rX   r\   )rS   rT   rU   rW   rX   r[   r2   r4   s           r5   select_step24r`      s=    "Wb2g!""4/;3CEODV "9ar7   c           	          [        XUSUUS9$ )NFr^   r_   )rS   rT   rU   rW   rX   s        r5   select_step360rb      s    rr$0(8: :r7   c                   (    \ rS rSrSS jrSS jrSrg)LocatorBase   c                     Xl         X l        g N)nbins_include_last)selfrh   rW   s      r5   __init__LocatorBase.__init__   s    
)r7   Nc                 ,    Ub  [        U5      U l        g g rg   )rG   rh   )rj   rh   s     r5   
set_paramsLocatorBase.set_params   s    UDJ r7   )ri   rh   )Trg   )__name__
__module____qualname____firstlineno__rk   rn   __static_attributes__ r7   r5   rd   rd      s    *$r7   rd   c                       \ rS rSrS rSrg)
LocatorHMS   c                 D    [        XU R                  U R                  5      $ rg   r`   rh   ri   rj   rS   rT   s      r5   __call__LocatorHMS.__call__   s    RTZZ1C1CDDr7   ru   Nrp   rq   rr   rs   r|   rt   ru   r7   r5   rw   rw      s    Er7   rw   c                       \ rS rSrS rSrg)	LocatorHM   c                 B    [        XU R                  U R                  SS9$ Nr   rX   rz   r{   s      r5   r|   LocatorHM.__call__   s"    RTZZ1C1C.02 	2r7   ru   Nr~   ru   r7   r5   r   r          2r7   r   c                       \ rS rSrS rSrg)LocatorH   c                 B    [        XU R                  U R                  SS9$ Nr   r   rz   r{   s      r5   r|   LocatorH.__call__   s"    RTZZ1C1C./1 	1r7   ru   Nr~   ru   r7   r5   r   r      s    1r7   r   c                       \ rS rSrS rSrg)
LocatorDMS   c                 D    [        XU R                  U R                  5      $ rg   rb   rh   ri   r{   s      r5   r|   LocatorDMS.__call__   s    bdjj$2D2DEEr7   ru   Nr~   ru   r7   r5   r   r      s    Fr7   r   c                       \ rS rSrS rSrg)	LocatorDM   c                 B    [        XU R                  U R                  SS9$ r   r   r{   s      r5   r|   LocatorDM.__call__   s"    bdjj$2D2D/13 	3r7   ru   Nr~   ru   r7   r5   r   r      s    3r7   r   c                       \ rS rSrS rSrg)LocatorDr   c                 B    [        XU R                  U R                  SS9$ r   r   r{   s      r5   r|   LocatorD.__call__   s"    bdjj$2D2D/02 	2r7   ru   Nr~   ru   r7   r5   r   r      r   r7   r   c                       \ rS rSrSrSrSrS\-   S-   rS\-   S-   rS\-   S	-   \-   S-   r	S\-   S
-   \-   S-   r
S\-   S	-   \-   S-   rS\-   S-   rS\-   S-   rS rS rSrg)FormatterDMS   z^{\circ}z	^{\prime}z^{\prime\prime}$%d$$%d.%s$%s%d\,%02d	\,%02d.%s\,%02d%02d.%sc                     S nS Hc  nX::  a    X4$ X-  n[        [        R                  " [        R                  " U5      5      5      nSU-  U:X  d  MN  US:w  d  MV  UnUSU-  -  nX4s  $    X4$ )N)r   r   r   r   r   )rG   r#   rQ   rI   )rj   r4   number_fraction	thresholdd	int_log_ds         r5   _get_number_fraction!FormatterDMS._get_number_fraction   s     'I" && #ABHHRXXa[12I9}!a1f"+2y=0.. ' &&r7   c                    [        U5      S:X  a  / $ [        R                  " U5      nU Vs/ s H  oUS:  a  SOSPM     nnU R                  U5      u  p'[        R                  " U5      nUb,  [        USU-  5      u  p8SU4-  n	U V
s/ s H  oU
4-  PM
     nn
US:X  a|  Uc:  [        XC5       VVs/ s H!  u  pU R                  U[        U5      -  4-  PM#     snn$ [        XCW5       VVV
s/ s H#  u  pn
U R                  U[        U5      -  U
4-  PM%     sn
nn$ US:X  a  [        US5      u  pUc5  [        XmU5       VVVs/ s H  u  nnnU R                  UUU4-  PM     snnn$ [        XmUW5       VVVV
s/ s H  u  nnnn
U R                  UUUU
4-  PM     sn
nnn$ US:X  a  US	   S	:X  a  S
nUS S S	2   nUS S S	2   nOSnSn/ n[        US5      u  nn[        US5      u  nnUc   U Vs/ s H  oR                  U4-  PM     nnO.[        UW5       VV
s/ s H  u  pU R                  X4-  PM     nnn
[        XmUU5       HA  u  nnnnU R                  UUU4-  nUU:w  a  UnUU-   nOSU-   U-   nUR                  U5        MC     U(       a  US S S	2   $ U$ XC-   Vs/ s H  nSU-  PM
     sn$ s  snf s  sn
f s  snnf s  sn
nnf s  snnnf s  sn
nnnf s  snf s  sn
nf s  snf )Nr   - r   z%%0%ddr   r   r   rO   TFr   z$%s^{\circ}$)r"   r#   signr   absdivmodzipfmt_drG   fmt_dsfmt_d_mfmt_d_msfmt_s_partialfmt_ss_partialfmt_d_m_partialappend)rj   	directionr4   valuesssvsignsr   	frac_partfrac_fmtf1frac_strsdeg_partmin_parts1d1m1inverse_orderl_hm_oldr	min_part_sec_partsec_strl_hmls                             r5   r|   FormatterDMS.__call__   sS   v;!IWWV_/56v!A2%v6"&";";F"C& &vr_/D EF?"44H3<=9RB5(9H=Q;&?B2Otq

a#a&j]2OO ),B(AC(AHA" q3q6z2&66(AC Cr\!'!3H&*-ex*HJ*HJBB B|3*HJ J
 u(CEC *Ar2r BB7CE E t^"v| $"dd %HA"("6Hi!'	2!6Hh&@HI"--5I *-Xx)@B)@vr  .."9)@  B "%Uh!H2r2++q"bk98##Hr	Aa"A "I 2w 24;AOa';;} 7 > PC
JE& JB$ <s5   J3J80(J=,*K K
9"K
.KK!K$ru   N)rp   rq   rr   rs   deg_markmin_marksec_markr   r   r   r   r   r   r   r   r|   rt   ru   r7   r5   r   r      s    HH!HHs"E!C'F !I-83>G("\1H<sBH(94x?%GOX%+M)C/N'$C<r7   r   c                      ^  \ rS rSrSrSrSrS\-   S-   rS\-   S-   rS\-   S	-   \-   S-   r	S\-   S
-   \-   S-   r
S\-   S	-   \-   S-   rS\-   S-   rS\-   S-   rU 4S jrSrU =r$ )FormatterHMSi"  z^\mathrm{h}z^\mathrm{m}z^\mathrm{s}r   r   r   r   r   r   r   r   r   c                 R   > [         TU ]  X[        R                  " U5      S-  5      $ )Nr   )superr|   r#   asarray)rj   r   r4   r   	__class__s       r5   r|   FormatterHMS.__call__2  s#    w	2::f3E3JKKr7   ru   )rp   rq   rr   rs   r   r   r   r   r   r   r   r   r   r   r|   rt   __classcell__)r   s   @r5   r   r   "  s    HHHHs"E!C'F !I-8<G("\1H<S@H(94x?%GOX%+M)C/NL Lr7   r   c                   (    \ rS rSr  SS jrS rSrg)ExtremeFinderCyclei6  Nc                 T    XsU l         U l        X4sU l        U l        XPl        X`l        g)a  
This subclass handles the case where one or both coordinates should be
taken modulo 360, or be restricted to not exceed a specific range.

Parameters
----------
nx, ny : int
    The number of samples in each direction.

lon_cycle, lat_cycle : 360 or None
    If not None, values in the corresponding direction are taken modulo
    *lon_cycle* or *lat_cycle*; in theory this can be any number but
    the implementation actually assumes that it is 360 (if not None);
    other values give nonsensical results.

    This is done by "unwrapping" the transformed grid coordinates so
    that jumps are less than a half-cycle; then normalizing the span to
    no more than a full cycle.

    For example, if values are in the union of the [0, 2] and
    [358, 360] intervals (typically, angles measured modulo 360), the
    values in the second interval are normalized to [-2, 0] instead so
    that the values now cover [-2, 2].  If values are in a range of
    [5, 1000], this gets normalized to [5, 365].

lon_minmax, lat_minmax : (float, float) or None
    If not None, the computed bounding box is clipped to the given
    range in the corresponding direction.
N)nxny	lon_cycle	lat_cycle
lon_minmax
lat_minmax)rj   r   r   r   r   r   r   s          r5   rk   ExtremeFinderCycle.__init__9  s+    @ )2&$$r7   c                    [         R                  " [         R                  " X$U R                  5      [         R                  " X5U R                  5      5      u  pgU" [         R
                  " U5      [         R
                  " U5      5      u  p[         R                  " SS9   U R                  b#  [         R                  " U5      n
USX-
  S:  -  -  nU R                  b#  [         R                  " U	5      nU	SX-
  S:  -  -  n	S S S 5        [         R                  " U5      [         R                  " U5      p[         R                  " U	5      [         R                  " U	5      pU R                  XX5      u  ppU R                  (       a  [        XU R                  -   5      nU R                  (       a  [        XU R                  -   5      nU R                  b6  U R                  S   n[        UU5      nU R                  S   n[        UU5      nU R                  b6  U R                  S   n[        UU5      nU R                  S   n[        UU5      nXX4$ ! , (       d  f       GNV= f)Nignore)invalidrM   g     f@r   r   )r#   meshgridlinspacer   r   ravelerrstater   nanminr   nanmax_add_padminr   maxr   )rj   transform_xyx1y1x2y2xylonlatlon0lat0lon_minlon_maxlat_minlat_maxmin0max0s                     r5   r|   ExtremeFinderCycle.__call__^  s   {{KK("++bdgg*FHRXXa[9 [[*~~)yy~t
d233~~)yy~t
d233 + 99S>299S>99S>299S> MM'G= 	+' >>'T^^#;<G>>'T^^#;<G??&??1%D$(G??1%D$(G??&??1%D$(G??1%D$(G11A +*s   A!I
I)r   r   r   r   r   r   )rM   NN)ir   )rp   rq   rr   rs   rk   r|   rt   ru   r7   r5   r   r   6  s     ,0-6#%J,2r7   r   )FTr    )Tr   )numpyr#   rH   #mpl_toolkits.axisartist.grid_finderr   r6   rE   rK   r\   r`   rb   rd   rw   r   r   r   r   r   r   r   r   ru   r7   r5   <module>r     s      C44( 6:!&.%b :$ $E E
2 21{ 1F F
3 32{ 2e< e<PL< L(T2, T2r7   