a
    ߙfbn                     @   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)   ZA)    eA      &@	Frequency)r   wcsctypecunitcdeltcrvalcrpixcnamer    r   :lib/python3.9/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   sN   t dd} d| j_d| j_d| j_d| j_d| j_d| j_d	| _g d
| _	| 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_dimP   s    z!Spectral1DLowLevelWCS.pixel_n_dimc                 C   s   dS rB   r   rC   r   r   r   world_n_dimT   s    z!Spectral1DLowLevelWCS.world_n_dimc                 C   s   dS )N)zem.freqr   rC   r   r   r   world_axis_physical_typesX   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:   f   s    z!Spectral1DLowLevelWCS.pixel_shapec                 C   s
   || _ d S rJ   rK   rD   valuer   r   r   r:   j   s    c                 C   s   | j S rJ   _pixel_boundsrC   r   r   r   r;   p   s    z"Spectral1DLowLevelWCS.pixel_boundsc                 C   s
   || _ d S rJ   rO   rM   r   r   r   r;   t   s    c                 C   s   t |d d d S )N
   r   r   npZasarray)rD   Zpixel_arrayr   r   r   pixel_to_world_valuesx   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_values{   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   )ZpytestZnumpyrS   Z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,   




9
0