
    1i6                         S r SSKJrJrJrJrJrJr  SSKJrJ	r	J
r
JrJrJr  SrS rS r\rS r\rS rS	 r\rS
 rS r\rS rS rS r SSKr\" 5         g! \ a     gf = f)z
Import math functions from either numpy (in order to vectorize operations) or
builtins math module.

By default, use numpy when available.

To force builtins math module usage when numpy is available:
    import pysolar
    pysolar.use_math()
    )degreescossinradianstanpi)acosatanasinatan2expemathc                 D    [        X/S9n [        X5      [        5       U'   g)z<
Does "from <module> import <name> as <name_as>" (globally)
)fromlistN)
__import__getattrglobals)modulenamename_ass      R/var/www/html/motor_solar_iot/venv/lib/python3.13/site-packages/pysolar/numeric.pyglobals_import_fromr   %   s!     0F .GIg    c                     U (       a  U$ U$ )zscalar version of numpy.where  )	conditionxys      r   
where_mathr    -   s    r   c                 6    U R                  5       R                  $ N)utctimetupletm_ydayds    r   tm_yday_mathr'   7       >>###r   c                     [         R                  " U SS9n[         R                  " U SS9nX-
  R                  S5      S-   $ )Ndatetime64[D]dtypezdatetime64[Y]int   numpyarrayastype)r&   dddys      r   tm_yday_numpyr5   =   s:    	Qo	.B	Qo	.BGE"Q&&r   c                 6    U R                  5       R                  $ r"   )r#   tm_hourr%   s    r   tm_hour_mathr8   C   r(   r   c                 |    [         R                  " U SS9n[         R                  " U SS9nX-
  R                  S5      $ )Ndatetime64[h]r+   r*   r-   r/   )r&   dhr3   s      r   tm_hour_numpyr<   I   5    	Qo	.B	Qo	.BGE""r   c                 6    U R                  5       R                  $ r"   )r#   tm_minr%   s    r   tm_min_mathr@   O   s    >>"""r   c                 |    [         R                  " U SS9n[         R                  " U SS9nX-
  R                  S5      $ )Nzdatetime64[m]r+   r:   r-   r/   )r&   dmr;   s      r   tm_min_numpyrC   U   r=   r   c                     [        SSS5        [        SSS5        [        SSS5        [        SSS5        [        SSS5        [        SSS5        [        SSS	5        [        SS
S5        [        SSS5        [        SSS5        [        SSS5        [        SSS5        [        SSS5        [        [        5       S'   [        [        5       S'   [        [        5       S'   S[        5       S'   g)z0
Import required functions/constants from numpy
r0   r   r   r   r   r   r   arccosr	   arctanr
   arcsinr   arctan2r   r   r   wherer$   r7   r?   current_modN)r   r5   r   r<   rC   r   r   r   	use_numpyrK   [   s     I6..I6.t,626262G4.c*'2(GIi(GIi&GIh&GImr   c                     [        SSS5        [        SSS5        [        SSS5        [        SSS5        [        SSS5        [        SSS5        [        SSS5        [        SS	S	5        [        SS
S
5        [        SSS5        [        SSS5        [        SSS5        [        [        5       S'   [        [        5       S'   [        [        5       S'   [
        [        5       S'   S[        5       S'   g)z?
Import required functions/constants from builtins math module
r   r   r   r   r   r   r   r	   r
   r   r   r   r   rI   r$   r7   r?   rJ   N)r   rI   r   r'   r8   r@   r   r   r   use_mathrM   r   s     	95u-u-	95u-d+///1u-S)GIg'GIi'GIi%GIh%GImr   N)__doc__r   r   r   r   r   r   r   r	   r
   r   r   r   r   rJ   r   r    rI   r'   r$   r5   r8   r7   r<   r@   r?   rC   rK   rM   r0   ImportErrorr   r   r   <module>rP      s   (	 5 4 0 0/ 	$ '$ ## 
#'.&.	K 		s   A A! A!