U
    e»{jž  ã                   @   sÌ   d dl Zd dlZd dlmZ d dlmZ d dlmZ d dl	m
Z
 dgZejdd„ ƒZejd	d
„ ƒZejdd„ ƒZejdd„ ƒZejdd„ ƒZG dd„ de
ƒZejdd„ ƒZG dd„ de
ƒZejdd„ ƒZdS )é    N©ÚSkyCoord©ÚQuantity)ÚWCS)ÚBaseLowLevelWCSzsliced_low_level_wcs.pyc                  C   s>   t dd�} d| j_d| j_d| j_d| j_d| j_d| j_| S )	Né   ©Znaxis)ÚFREQ©ÚHz)ç   ÀZæA)ç    eÍíA©ç      &@©Ú	Frequency)r   ÚwcsÚctypeÚcunitÚcdeltÚcrvalÚcrpixÚcname©r   © r   úZ/var/www/html/bwave/python/venv/lib/python3.8/site-packages/astropy/wcs/wcsapi/conftest.pyÚspectral_1d_fitswcs   s    
r   c                  C   s>   t dd�} d| j_d| j_d| j_d| j_d| j_d| j_| S )	Nr   r	   )ÚTIME©iZu  r   )g      @r   )ÚTimeÚs)r   r   r   Úmjdrefr   r   r   r   r   r   r   r   Útime_1d_fitswcs   s    
r#   c                  C   sN   t dd�} d| j_d| j_d| j_d| j_d| j_d| j_d	| _d
dg| _	| S )Né   r	   )úRA---CARúDEC--CAR©Údegr(   )ç       Àç       @)ç      @ç        )ç      @ç      @©úRight AscensionÚDeclination©é   é   ©éÿÿÿÿé   ©r   r4   ©
r   r   r   r   r   r   r   r   Úpixel_shapeÚpixel_boundsr   r   r   r   Úcelestial_2d_fitswcs%   s    

r<   c                  C   sP   t dd�} d| j_d| j_d| j_d| j_d| j_d| j_d	| _d
ddg| _	| S )Né   r	   )r%   r&   r
   )r(   r(   r   )r)   r*   r   )r+   r,   r   )r-   r.   r   )r0   r1   r   )r3   r4   r=   r5   r8   )r   g      @r9   r   r   r   r   Úspectral_cube_3d_fitswcs3   s    
r>   c                  C   sF   t dd�} d| j_d| j_d| j_d| j_d| j_d| j_d	| j_| S )
Né   r	   )r%   r&   r
   r   )r(   r(   r   r!   )r)   r*   r   r   )r+   r,   r   r=   )r-   r.   r   r   )r0   r1   r   r    r   )	r   r   r   r   r   r   r   r   r"   r   r   r   r   Úcube_4d_fitswcsA   s    
r@   c                   @   s¬   e Zd Zedd„ ƒZedd„ ƒZedd„ ƒZedd„ ƒZed	d
„ ƒZdZ	edd„ ƒZ
e
jdd„ ƒZ
dZedd„ ƒZejdd„ ƒZdd„ Zdd„ Zedd„ ƒZedd„ ƒZdS )ÚSpectral1DLowLevelWCSc                 C   s   dS ©Nr   r   ©Úselfr   r   r   Úpixel_n_dimO   s    z!Spectral1DLowLevelWCS.pixel_n_dimc                 C   s   dS rB   r   rC   r   r   r   Úworld_n_dimS   s    z!Spectral1DLowLevelWCS.world_n_dimc                 C   s   dS )N)zem.freqr   rC   r   r   r   Úworld_axis_physical_typesW   s    z/Spectral1DLowLevelWCS.world_axis_physical_typesc                 C   s   dS )Nr   r   rC   r   r   r   Úworld_axis_units[   s    z&Spectral1DLowLevelWCS.world_axis_unitsc                 C   s   dS )Nr   r   rC   r   r   r   Úworld_axis_names_   s    z&Spectral1DLowLevelWCS.world_axis_namesNc                 C   s   | j S ©N©Ú_pixel_shaperC   r   r   r   r:   e   s    z!Spectral1DLowLevelWCS.pixel_shapec                 C   s
   || _ d S rJ   rK   ©rD   Úvaluer   r   r   r:   i   s    c                 C   s   | j S rJ   ©Ú_pixel_boundsrC   r   r   r   r;   o   s    z"Spectral1DLowLevelWCS.pixel_boundsc                 C   s
   || _ d S rJ   rO   rM   r   r   r   r;   s   s    c                 C   s   t  |d ¡d d S )Né
   r   r   ©ÚnpZasarray)rD   Zpixel_arrayr   r   r   Úpixel_to_world_valuesw   s    z+Spectral1DLowLevelWCS.pixel_to_world_valuesc                 C   s   t  |d ¡d d S )Nr   r   rQ   rR   )rD   Zworld_arrayr   r   r   Úworld_to_pixel_valuesz   s    z+Spectral1DLowLevelWCS.world_to_pixel_valuesc                 C   s   dS )N))Útestr   rN   r   rC   r   r   r   Úworld_axis_object_components}   s    z2Spectral1DLowLevelWCS.world_axis_object_componentsc                 C   s   dt dddifiS )NrV   r   Úunitr   r   rC   r   r   r   Úworld_axis_object_classes�   s    z/Spectral1DLowLevelWCS.world_axis_object_classes)Ú__name__Ú
__module__Ú__qualname__ÚpropertyrE   rF   rG   rH   rI   rL   r:   ÚsetterrP   r;   rT   rU   rW   rY   r   r   r   r   rA   N   s4   









rA   c                   C   s   t ƒ S rJ   )rA   r   r   r   r   Úspectral_1d_ape14_wcs†   s    r_   c                   @   sˆ   e Zd Zedd„ ƒZedd„ ƒZedd„ ƒZedd„ ƒZed	d
„ ƒZedd„ ƒZ	edd„ ƒZ
dd„ Zdd„ Zedd„ ƒZedd„ ƒZdS )ÚCelestial2DLowLevelWCSc                 C   s   dS ©Nr$   r   rC   r   r   r   rE   Œ   s    z"Celestial2DLowLevelWCS.pixel_n_dimc                 C   s   dS ra   r   rC   r   r   r   rF   �   s    z"Celestial2DLowLevelWCS.world_n_dimc                 C   s   dS )N)z	pos.eq.raz
pos.eq.decr   rC   r   r   r   rG   ”   s    z0Celestial2DLowLevelWCS.world_axis_physical_typesc                 C   s   dS )Nr'   r   rC   r   r   r   rH   ˜   s    z'Celestial2DLowLevelWCS.world_axis_unitsc                 C   s   dS )Nr/   r   rC   r   r   r   rI   œ   s    z'Celestial2DLowLevelWCS.world_axis_namesc                 C   s   dS )Nr2   r   rC   r   r   r   r:       s    z"Celestial2DLowLevelWCS.pixel_shapec                 C   s   dS )N)r5   r8   r   rC   r   r   r   r;   ¤   s    z#Celestial2DLowLevelWCS.pixel_boundsc                 C   s*   t  |¡d  d d t  |¡d d fS )Nç      @r$   r+   r-   rR   )rD   ZpxÚpyr   r   r   rT   ¨   s    z,Celestial2DLowLevelWCS.pixel_to_world_valuesc                 C   s*   t  |¡d  d d t  |¡d d fS )Nr+   r$   rb   r-   rR   )rD   ZwxZwyr   r   r   rU   «   s    z,Celestial2DLowLevelWCS.world_to_pixel_valuesc                 C   s   ddgS )N)rV   r   zspherical.lon.degree)rV   r   zspherical.lat.degreer   rC   r   r   r   rW   ®   s    þz3Celestial2DLowLevelWCS.world_axis_object_componentsc                 C   s   dt dddifiS )NrV   r   rX   r(   r   rC   r   r   r   rY   µ   s    z0Celestial2DLowLevelWCS.world_axis_object_classesN)rZ   r[   r\   r]   rE   rF   rG   rH   rI   r:   r;   rT   rU   rW   rY   r   r   r   r   r`   ‹   s(   







r`   c                   C   s   t ƒ S rJ   )r`   r   r   r   r   Úcelestial_2d_ape14_wcsº   s    rd   )ÚnumpyrS   ZpytestZastropy.coordinatesr   Zastropy.unitsr   Zastropy.wcsr   Zastropy.wcs.wcsapir   Zcollect_ignoreZfixturer   r#   r<   r>   r@   rA   r_   r`   rd   r   r   r   r   Ú<module>   s,   




8
/