U
    e»{jÝ  ã                   @   s|   d dl mZ d dlmZ d dlmZ d ¡ Zdd„ Zej	j
d ¡ dd	�Zd
 ¡ Zdd„ Zd ¡ Zdd„ Zdd„ Zdd„ ZdS )é    )Úassert_allclose)Úfits)ÚWCSz2
rsun_ref:
dsun_obs:
crln_obs:
hgln_obs:
hglt_obs:c                  C   s|   t dd�} | jjjd kst‚| jjjd ks.t‚| jjjd ks@t‚| jjjd ksRt‚| jjjd ksdt‚t	| jjƒt
ksxt‚d S )Né   ©Znaxis)r   ÚwcsÚauxÚrsun_refÚAssertionErrorÚdsun_obsÚcrln_obsÚhgln_obsÚhglt_obsÚstrÚSTR_EXPECTED_EMPTY©Úw© r   ú\/var/www/html/bwave/python/venv/lib/python3.8/site-packages/astropy/wcs/tests/test_auxprm.pyÚ
test_empty   s    
r   a  
WCSAXES =                    2 / Number of coordinate axes
CRPIX1  =                 64.5 / Pixel coordinate of reference point
CRPIX2  =                 64.5 / Pixel coordinate of reference point
PC1_1   =     0.99999994260024 / Coordinate transformation matrix element
PC1_2   = -0.00033882076120692 / Coordinate transformation matrix element
PC2_1   =  0.00033882076120692 / Coordinate transformation matrix element
PC2_2   =     0.99999994260024 / Coordinate transformation matrix element
CDELT1  =   0.0053287911111111 / [deg] Coordinate increment at reference point
CDELT2  =   0.0053287911111111 / [deg] Coordinate increment at reference point
CUNIT1  = 'deg'                / Units of coordinate increment and value
CUNIT2  = 'deg'                / Units of coordinate increment and value
CTYPE1  = 'HPLN-TAN'           / Coordinate type codegnomonic projection
CTYPE2  = 'HPLT-TAN'           / Coordinate type codegnomonic projection
CRVAL1  =  -0.0012589367249586 / [deg] Coordinate value at reference point
CRVAL2  =  0.00079599300143911 / [deg] Coordinate value at reference point
LONPOLE =                180.0 / [deg] Native longitude of celestial pole
LATPOLE =  0.00079599300143911 / [deg] Native latitude of celestial pole
DATE-OBS= '2011-02-15T00:00:00.34' / ISO-8601 time of observation
MJD-OBS =      55607.000003935 / [d] MJD at start of observation
RSUN_REF=          696000000.0 / [m] Solar radius
DSUN_OBS=       147724815128.0 / [m] Distance from centre of Sun to observer
CRLN_OBS=            22.814522 / [deg] Carrington heliographic lng of observer
CRLT_OBS=            -6.820544 / [deg] Heliographic latitude of observer
HGLN_OBS=             8.431123 / [deg] Stonyhurst heliographic lng of observer
HGLT_OBS=            -6.820544 / [deg] Heliographic latitude of observer
Ú
)Úsepzt
rsun_ref: 696000000.000000
dsun_obs: 147724815128.000000
crln_obs: 22.814522
hgln_obs: 8.431123
hglt_obs: -6.820544c                  C   sp   t tƒ} t| jjjdƒ t| jjjdƒ t| jjjdƒ t| jjjdƒ t| jjj	dƒ t
| jjƒtkslt‚d S )Ni |)l   K+J‰ g]ß‡ƒ„Ð6@gXc'¼Ü @gR·³¯<HÀ)r   ÚHEADER_SOLARr   r   r   r	   r   r   r   r   r   ÚSTR_EXPECTED_GETr
   r   r   r   r   Útest_solar_aux_getD   s    r   zu
rsun_ref: 698000000.000000
dsun_obs: 140000000000.000000
crln_obs: 10.000000
hgln_obs: 30.000000
hglt_obs: 40.000000c                  C   sð   t tƒ} d| jj_t| jjjdƒ d| jj_t| jjjdƒ d| jj_t| jjjdƒ d| jj_t| jjjdƒ d| jj_	t| jjj	dƒ t
| jjƒtksžt‚|  ¡ }t|d dƒ t|d dƒ t|d dƒ t|d	 dƒ t|d
 dƒ d S )Né€¢š)ì    xL1‚ ç      $@ç      >@ç      D@ÚRSUN_REFÚDSUN_OBSÚCRLN_OBSÚHGLN_OBSÚHGLT_OBS)r   r   r   r   r	   r   r   r   r   r   r   ÚSTR_EXPECTED_SETr
   Ú	to_header©r   Úheaderr   r   r   Útest_solar_aux_setV   s$    




r)   c                  C   sò   t dd�} d| jj_t| jjjdƒ d| jj_t| jjjdƒ d| jj_t| jjjdƒ d| jj_t| jjjdƒ d| jj_t| jjjdƒ t	| jjƒt
ks t‚|  ¡ }t|d dƒ t|d	 dƒ t|d
 dƒ t|d dƒ t|d dƒ d S )Né   r   r   r   r   r   r   r    r!   r"   r#   r$   )r   r   r   r	   r   r   r   r   r   r   r%   r
   r&   r'   r   r   r   Útest_set_aux_on_emptyr   s$    





r+   c                  C   sV  t tƒ} | jjjd k	st‚d | jj_| jjjd ks6t‚| jjjd k	sHt‚d | jj_| jjjd ksdt‚| jjjd k	svt‚d | jj_| jjjd ks’t‚| jjjd k	s¤t‚d | jj_| jjjd ksÀt‚| jjj	d k	sÒt‚d | jj_	| jjj	d ksît‚t
| jjƒdk�st‚|  ¡ }d|k�st‚d|k�s(t‚d|k�s6t‚d|k�sDt‚d|k�sRt‚d S )Nz1rsun_ref:
dsun_obs:
crln_obs:
hgln_obs:
hglt_obs:r    r!   r"   r#   r$   )r   r   r   r   r	   r
   r   r   r   r   r   r&   r'   r   r   r   Útest_unset_auxŽ   s.    




r,   N)Znumpy.testingr   Z
astropy.ior   Zastropy.wcsr   Úlstripr   r   ÚHeaderÚ
fromstringr   r   r   r%   r)   r+   r,   r   r   r   r   Ú<module>   s   
ä 
