U
    e»{j¼  ã                   @   s<   d dl Zd dlmZ d dlmZ dZdZdd„ Zdd	„ Z	dS )
é    N)ÚPath)Úangular_separationg      ð?g      $@c           
   	   C   sú  t t | dd…df ¡t | dd…df ¡t |dd…df ¡t |dd…df ¡ƒ}t t | ddd…f ¡t | ddd…f ¡žŽ }tjdd��4 ||tjk  dtj 8  < t |t| k¡}W 5 Q R X |t |dd…df ¡B t |dd…df ¡B }tj| j	d tj
d�}tj|dd…< tj|d< tj||< tj|dd… |dd… < t |dd…df |dd…df  d	 |dd…df |dd…df  d	  ¡}|dd… t|dd…  k}tj|d	d… |< |d t|d  k�rêtj|d< t||d
�}	|	S )a­  
    Draw a curve, taking into account discontinuities.

    Parameters
    ----------
    lon_lat : ndarray
        The longitude and latitude values along the curve, given as a (n,2)
        array.
    pixel : ndarray
        The pixel coordinates corresponding to ``lon_lat``
    lon_lat_check : ndarray
        The world coordinates derived from converting from ``pixel``, which is
        used to ensure round-tripping.
    Nr   é   Úignore)Úinvalidg       @©Zdtypeéÿÿÿÿé   ©Úcodes)r   ÚnpÚradiansZerrstateÚpiÚabsÚROUND_TRIP_RTOLÚisnanÚzerosÚshapeÚuint8r   ÚLINETOÚMOVETOÚsqrtÚDISCONT_FACTOR)
Zlon_latÚpixelZlon_lat_checkÚsepZ
scale_sizeÚmaskr   ÚstepZdiscontinuousÚpath© r   úg/var/www/html/bwave/python/venv/lib/python3.8/site-packages/astropy/visualization/wcsaxes/grid_paths.pyÚget_lon_lat_path   s8    ü ÿ0

	Fÿ
r    c                 C   sŽ   t  |dd…df ¡t  |dd…df ¡B }t j| jd t jd�}tj|dd…< tj|d< tj||< tj|dd… |dd… < t||d�}|S )z÷
    Draw a grid line

    Parameters
    ----------
    world : ndarray
        The longitude and latitude values along the curve, given as a (n,2)
        array.
    pixel : ndarray
        The pixel coordinates corresponding to ``lon_lat``
    Nr   r   r   r   r
   )r   r   r   r   r   r   r   r   )Zworldr   r   r   r   r   r   r   Úget_gridline_path^   s    ,

r!   )
Únumpyr   Zmatplotlib.linesr   Z#astropy.coordinates.angle_utilitiesr   r   r   r    r!   r   r   r   r   Ú<module>   s   N