In [72]:
from astropy.io import fits as pyfits
import matplotlib
#matplotlib.use('nbagg')
import matplotlib.pyplot as plt
%matplotlib inline

There are two kinds of data products from IRIS, raster spectra and slit jaw images

RASTER Images


In [2]:
file = '/Users/schriste/Downloads/iris_l2_20140128_140021_3860259280_raster/iris_l2_20140128_140021_3860259280_raster_t000_r00000.fits'

In [3]:
f = pyfits.open(file)

In [4]:
f


Out[4]:
[<astropy.io.fits.hdu.image.PrimaryHDU at 0x10685f310>,
 <astropy.io.fits.hdu.image.ImageHDU at 0x10685fa90>,
 <astropy.io.fits.hdu.image.ImageHDU at 0x106871190>,
 <astropy.io.fits.hdu.image.ImageHDU at 0x106871850>,
 <astropy.io.fits.hdu.image.ImageHDU at 0x106871f10>,
 <astropy.io.fits.hdu.image.ImageHDU at 0x10687c610>,
 <astropy.io.fits.hdu.image.ImageHDU at 0x10687ccd0>,
 <astropy.io.fits.hdu.image.ImageHDU at 0x1068863d0>,
 <astropy.io.fits.hdu.image.ImageHDU at 0x106886a90>,
 <astropy.io.fits.hdu.image.ImageHDU at 0x10688e190>,
 <astropy.io.fits.hdu.image.ImageHDU at 0x10688e990>,
 <astropy.io.fits.hdu.table.TableHDU at 0x106896510>]

In [5]:
f[0].header


Out[5]:
SIMPLE  =                    T / Written by IDL:  Sat Jun  7 09:31:24 2014      
BITPIX  =                   16 / Number of bits per data pixel                  
NAXIS   =                    0 / Number of data axes                            
EXTEND  =                    T / FITS data may contain extensions               
DATE    = '2014-06-07'         / Creation UTC (CCCC-MM-DD) date of FITS header  
COMMENT FITS (Flexible Image Transport System) format is defined in 'Astronomy  
COMMENT and Astrophysics', volume 376, page 359; bibcode 2001A&A...376..359H    
TELESCOP= 'IRIS    '           /                                                
INSTRUME= 'SPEC    '           /                                                
DATA_LEV=              2.00000 /                                                
LVL_NUM =              2.00000 /                                                
VER_RF2 = 'L12-2014-04-23'     /                                                
DATE_RF2= '2014-06-07T15:25:07.191' /                                           
DATA_SRC=              1.51000 /                                                
ORIGIN  = 'SDO     '           /                                                
BLD_VERS= 'V8R2X   '           /                                                
LUTID   =              4.00000 /                                                
OBSID   = '3860259280'         /                                                
OBS_DESC= 'Large coarse 8-step raster 14x120 8s  C II   Si IV Deep x 8  FUV spe'
OBSLABEL= '        '           /                                                
OBSTITLE= '        '           /                                                
DATE_OBS= '2014-01-28T14:00:21.880' /                                           
DATE_END= '2014-01-28T14:01:27.620' /                                           
STARTOBS= '2014-01-28T14:00:21.810' /                                           
ENDOBS  = '2014-01-28T14:59:15.686' /                                           
OBSREP  =                   47 /                                                
CAMERA  =                    1 /                                                
STATUS  = 'Quicklook'          /                                                
BTYPE   = 'Intensity'          /                                                
BUNIT   = 'Corrected DN'       /                                                
BSCALE  =                 0.25 /                                                
BZERO   =                 7992 /                                                
HLZ     =                    0 /                                                
SAA     = '           0'       /                                                
SAT_ROT =          -0.00200598 /                                                
AECNOBS =                    0 /                                                
AECNRAS =                    0 /                                                
DSUN_OBS=          1.47336E+11 /                                                
IAECEVFL= 'NO      '           /                                                
IAECFLAG= 'YES     '           /                                                
IAECFLFL= 'YES     '           /                                                
TR_MODE = '        '           /                                                
FOVY    =              129.088 /                                                
FOVX    =        14.0880165100 /                                                
XCEN    =             -933.205 /                                                
YCEN    =              168.252 /                                                
SUMSPTRL=                    0 /                                                
SUMSPTRN=                    1 /                                                
SUMSPTRF=                    2 /                                                
SUMSPAT =                    1 /                                                
EXPTIME =              7.99927 /                                                
EXPMIN  =              7.99920 /                                                
EXPMAX  =              7.99931 /                                                
DATAMEAN=              59.7069 /                                                
DATARMS =              119.123 /                                                
DATAMEDN=              8.00796 /                                                
DATAMIN =             -879.754 /                                                
DATAMAX =              1967.16 /                                                
DATAVALS=              9573577 /                                                
MISSVALS=              1718775 /                                                
NSATPIX =                    0 /                                                
NSPIKES =                    0 /                                                
TOTVALS =             11292352 /                                                
PERCENTD=              84.7793 /                                                
DATASKEW=              5.67763 /                                                
DATAKURT=              54.2779 /                                                
DATAP01 =             -4.35381 /                                                
DATAP10 =             -1.11225 /                                                
DATAP25 =              1.09880 /                                                
DATAP75 =              82.7182 /                                                
DATAP90 =              126.623 /                                                
DATAP95 =              152.047 /                                                
DATAP98 =              200.436 /                                                
DATAP99 =              319.395 /                                                
NEXP_PRP=                    1 /                                                
NEXP    =                    8 /                                                
NEXPOBS =                 1128 /                                                
NRASTERP=                    8 /                                                
RASTYPDX=                    1 /                                                
RASTYPNX=                    1 /                                                
RASRPT  =                    1 /                                                
RASNRPT =                   47 /                                                
STEPS_AV=        1.99544034685 /                                                
STEPS_DV=    5.12408487974E-07 /                                                
STEPT_AV=              9.40143 /                                                
STEPT_DV=            0.0701020 /                                                
CADPL_AV=              75.1890 /                                                
CADPL_DV=              0.00000 /                                                
CADEX_AV=              75.0434 /                                                
CADEX_DV=            0.0189029 /                                                
MISSOBS =                    1 /                                                
MISSRAS =                    0 /                                                
PC1_1   =        1.00000000000 /                                                
PC1_2   =        0.00000000000 /                                                
PC2_1   =        0.00000000000 /                                                
PC2_2   =       0.999936938286 /                                                
PC3_1   =        0.00000000000 /                                                
PC3_2   =      0.0112395808101 /                                                
NWIN    =                    9 /                                                
TDET1   = 'FUV1    '           /                                                
TDESC1  = 'C II 1336'          /                                                
TWAVE1  =              1335.71 /                                                
TWMIN1  =              1332.73 /                                                
TWMAX1  =              1337.17 /                                                
TDMEAN1 =              17.8052 /                                                
TDRMS1  =              43.4020 /                                                
TDMEDN1 =              1.81233 /                                                
TDMIN1  =             -40.0800 /                                                
TDMAX1  =              1152.11 /                                                
TDVALS1 =               909265 /                                                
TMISSV1 =               158511 /                                                
TSATPX1 =                    0 /                                                
TSPIKE1 =                    0 /                                                
TTOTV1  =              1067776 /                                                
TPCTD1  =              85.1550 /                                                
TDSKEW1 =              4.00937 /                                                
TDKURT1 =              28.6425 /                                                
TDP01_1 =             -4.52004 /                                                
TDP10_1 =             -1.79423 /                                                
TDP25_1 =            -0.195023 /                                                
TDP75_1 =              5.94775 /                                                
TDP90_1 =              72.2802 /                                                
TDP95_1 =              115.113 /                                                
TDP98_1 =              159.081 /                                                
TDP99_1 =              189.932 /                                                
TSR1    =                  156 /                                                
TER1    =                  931 /                                                
TSC1    =                   41 /                                                
TEC1    =                  212 /                                                
TDET2   = 'FUV1    '           /                                                
TDESC2  = '1343    '           /                                                
TWAVE2  =              1343.31 /                                                
TWMIN2  =              1342.36 /                                                
TWMAX2  =              1344.25 /                                                
TDMEAN2 =             0.569470 /                                                
TDRMS2  =              3.08303 /                                                
TDMEDN2 =             0.561411 /                                                
TDMIN2  =             -23.9759 /                                                
TDMAX2  =              578.392 /                                                
TDVALS2 =               351106 /                                                
TMISSV2 =               108286 /                                                
TSATPX2 =                    0 /                                                
TSPIKE2 =                    0 /                                                
TTOTV2  =               459392 /                                                
TPCTD2  =              76.4284 /                                                
TDSKEW2 =              5.68797 /                                                
TDKURT2 =              292.316 /                                                
TDP01_2 =             -5.90027 /                                                
TDP10_2 =             -2.99577 /                                                
TDP25_2 =             -1.28165 /                                                
TDP75_2 =              2.42107 /                                                
TDP90_2 =              3.96243 /                                                
TDP95_2 =              5.10006 /                                                
TDP98_2 =              6.30899 /                                                
TDP99_2 =              7.22007 /                                                
TSR2    =                  156 /                                                
TER2    =                  931 /                                                
TSC2    =                  412 /                                                
TEC2    =                  485 /                                                
TDET3   = 'FUV1    '           /                                                
TDESC3  = 'Fe XII 1349'        /                                                
TWAVE3  =              1349.43 /                                                
TWMIN3  =              1347.76 /                                                
TWMAX3  =              1350.90 /                                                
TDMEAN3 =             0.812907 /                                                
TDRMS3  =              2.62051 /                                                
TDMEDN3 =             0.810128 /                                                
TDMIN3  =             -31.6638 /                                                
TDMAX3  =              308.207 /                                                
TDVALS3 =               623518 /                                                
TMISSV3 =               133858 /                                                
TSATPX3 =                    0 /                                                
TSPIKE3 =                    0 /                                                
TTOTV3  =               757376 /                                                
TPCTD3  =              82.3261 /                                                
TDSKEW3 =              3.73535 /                                                
TDKURT3 =              220.595 /                                                
TDP01_3 =             -4.83784 /                                                
TDP10_3 =             -2.26864 /                                                
TDP25_3 =            -0.810476 /                                                
TDP75_3 =              2.41795 /                                                
TDP90_3 =              3.87763 /                                                
TDP95_3 =              4.80961 /                                                
TDP98_3 =              5.94306 /                                                
TDP99_3 =              6.69349 /                                                
TSR3    =                  156 /                                                
TER3    =                  931 /                                                
TSC3    =                  620 /                                                
TEC3    =                  741 /                                                
TDET4   = 'FUV1    '           /                                                
TDESC4  = 'O I 1356'           /                                                
TWAVE4  =              1355.60 /                                                
TWMIN4  =              1352.30 /                                                
TWMAX4  =              1355.86 /                                                
TDMEAN4 =              1.68425 /                                                
TDRMS4  =              6.22013 /                                                
TDMEDN4 =             0.947866 /                                                
TDMIN4  =             -46.9477 /                                                
TDMAX4  =              542.850 /                                                
TDVALS4 =               712200 /                                                
TMISSV4 =               144504 /                                                
TSATPX4 =                    0 /                                                
TSPIKE4 =                    0 /                                                
TTOTV4  =               856704 /                                                
TPCTD4  =              83.1326 /                                                
TDSKEW4 =              6.37780 /                                                
TDKURT4 =              59.7626 /                                                
TDP01_4 =             -5.04583 /                                                
TDP10_4 =             -2.33622 /                                                
TDP25_4 =            -0.767535 /                                                
TDP75_4 =              2.71852 /                                                
TDP90_4 =              4.60279 /                                                
TDP95_4 =              6.29385 /                                                
TDP98_4 =              17.5359 /                                                
TDP99_4 =              32.5031 /                                                
TSR4    =                  156 /                                                
TER4    =                  931 /                                                
TSC4    =                  795 /                                                
TEC4    =                  932 /                                                
TDET5   = 'FUV2    '           /                                                
TDESC5  = 'Si IV 1403'         /                                                
TWAVE5  =              1402.77 /                                                
TWMIN5  =              1398.70 /                                                
TWMAX5  =              1405.90 /                                                
TDMEAN5 =              13.6295 /                                                
TDRMS5  =              51.4078 /                                                
TDMEDN5 =              4.53973 /                                                
TDMIN5  =             -54.4879 /                                                
TDMAX5  =              1967.16 /                                                
TDVALS5 =              1539729 /                                                
TMISSV5 =               223343 /                                                
TSATPX5 =                    0 /                                                
TSPIKE5 =                    0 /                                                
TTOTV5  =              1763072 /                                                
TPCTD5  =              87.3322 /                                                
TDSKEW5 =              9.80143 /                                                
TDKURT5 =              150.596 /                                                
TDP01_5 =             -3.48580 /                                                
TDP10_5 =            -0.275763 /                                                
TDP25_5 =              1.76063 /                                                
TDP75_5 =              8.21986 /                                                
TDP90_5 =              15.6659 /                                                
TDP95_5 =              39.2860 /                                                
TDP98_5 =              145.654 /                                                
TDP99_5 =              251.227 /                                                
TSR5    =                  156 /                                                
TER5    =                  931 /                                                
TSC5    =                 1744 /                                                
TEC5    =                 2027 /                                                
TDET6   = 'NUV     '           /                                                
TDESC6  = '2832    '           /                                                
TWAVE6  =              2832.75 /                                                
TWMIN6  =              2831.33 /                                                
TWMAX6  =              2834.18 /                                                
TDMEAN6 =              111.505 /                                                
TDRMS6  =              47.1936 /                                                
TDMEDN6 =              110.760 /                                                
TDMIN6  =             -879.754 /                                                
TDMAX6  =              455.569 /                                                
TDVALS6 =               531211 /                                                
TMISSV6 =               170293 /                                                
TSATPX6 =                    0 /                                                
TSPIKE6 =                    0 /                                                
TTOTV6  =               701504 /                                                
TPCTD6  =              75.7246 /                                                
TDSKEW6 =             0.385296 /                                                
TDKURT6 =              2.25008 /                                                
TDP01_6 =              23.2846 /                                                
TDP10_6 =              48.8828 /                                                
TDP25_6 =              77.7217 /                                                
TDP75_6 =              140.623 /                                                
TDP90_6 =              168.911 /                                                
TDP95_6 =              190.877 /                                                
TDP98_6 =              222.992 /                                                
TDP99_6 =              244.181 /                                                
TSR6    =                  156 /                                                
TER6    =                  931 /                                                
TSC6    =                 1911 /                                                
TEC6    =                 2023 /                                                
TDET7   = 'NUV     '           /                                                
TDESC7  = '2826    '           /                                                
TWAVE7  =              2826.67 /                                                
TWMIN7  =              2824.83 /                                                
TWMAX7  =              2828.50 /                                                
TDMEAN7 =              105.854 /                                                
TDRMS7  =              39.3748 /                                                
TDMEDN7 =              106.192 /                                                
TDMIN7  =             0.822396 /                                                
TDMAX7  =              357.026 /                                                
TDVALS7 =               714512 /                                                
TMISSV7 =               185648 /                                                
TSATPX7 =                    0 /                                                
TSPIKE7 =                    0 /                                                
TTOTV7  =               900160 /                                                
TPCTD7  =              79.3761 /                                                
TDSKEW7 =             0.386126 /                                                
TDKURT7 =             0.990455 /                                                
TDP01_7 =              22.5965 /                                                
TDP10_7 =              54.6419 /                                                
TDP25_7 =              81.0719 /                                                
TDP75_7 =              128.739 /                                                
TDP90_7 =              152.194 /                                                
TDP95_7 =              172.674 /                                                
TDP98_7 =              199.401 /                                                
TDP99_7 =              214.991 /                                                
TSR7    =                  156 /                                                
TER7    =                  931 /                                                
TSC7    =                 1656 /                                                
TEC7    =                 1800 /                                                
TDET8   = 'NUV     '           /                                                
TDESC8  = '2814    '           /                                                
TWAVE8  =              2814.47 /                                                
TWMIN8  =              2812.64 /                                                
TWMAX8  =              2816.31 /                                                
TDMEAN8 =              93.5080 /                                                
TDRMS8  =              31.1895 /                                                
TDMEDN8 =              92.9364 /                                                
TDMIN8  =             0.941655 /                                                
TDMAX8  =              343.554 /                                                
TDVALS8 =               716294 /                                                
TMISSV8 =               183866 /                                                
TSATPX8 =                    0 /                                                
TSPIKE8 =                    0 /                                                
TTOTV8  =               900160 /                                                
TPCTD8  =              79.5741 /                                                
TDSKEW8 =             0.208963 /                                                
TDKURT8 =             0.686810 /                                                
TDP01_8 =              19.2546 /                                                
TDP10_8 =              55.9941 /                                                
TDP25_8 =              73.0685 /                                                
TDP75_8 =              112.787 /                                                
TDP90_8 =              131.117 /                                                
TDP95_8 =              144.887 /                                                
TDP98_8 =              163.883 /                                                
TDP99_8 =              175.734 /                                                
TSR8    =                  156 /                                                
TER8    =                  931 /                                                
TSC8    =                 1177 /                                                
TEC8    =                 1321 /                                                
TDET9   = 'NUV     '           /                                                
TDESC9  = 'Mg II k 2796'       /                                                
TWAVE9  =              2796.20 /                                                
TWMIN9  =              2790.64 /                                                
TWMAX9  =              2806.55 /                                                
TDMEAN9 =              95.1396 /                                                
TDRMS9  =              176.489 /                                                
TDMEDN9 =              44.2965 /                                                
TDMIN9  =            0.0661837 /                                                
TDMAX9  =              1821.48 /                                                
TDVALS9 =              3475742 /                                                
TMISSV9 =               410466 /                                                
TSATPX9 =                    0 /                                                
TSPIKE9 =                    0 /                                                
TTOTV9  =              3886208 /                                                
TPCTD9  =              89.4379 /                                                
TDSKEW9 =              3.86091 /                                                
TDKURT9 =              15.5190 /                                                
TDP01_9 =              13.8383 /                                                
TDP10_9 =              26.8520 /                                                
TDP25_9 =              34.5271 /                                                
TDP75_9 =              56.6393 /                                                
TDP90_9 =              160.944 /                                                
TDP95_9 =              505.511 /                                                
TDP98_9 =              805.174 /                                                
TDP99_9 =              948.433 /                                                
TSR9    =                  156 /                                                
TER9    =                  931 /                                                
TSC9    =                  313 /                                                
TEC9    =                  938 /                                                
KEYWDDOC= 'http://www.lmsal.com/iris_science/irisfitskeywords.pdf' /            
HISTORY iris_prep  Dark v20130925; T=[-61.0,-61.0,-60.0,-61.0,1.2,-2.4,-2.4,-2.4
HISTORY iris_prep  FUV background subtracted                                    
HISTORY iris_prep  Flat fielded with recnum    2                                
HISTORY iris_prep_geowave_roi  ran with rec_num 1 (FUVS), 2 (FUVL)              
HISTORY iris_prep_geowave_roi  boxwarp set to 1                                 
HISTORY iris_prep_geowave_roi  updated WCS parameters with iris_isp2wcs         
HISTORY iris_prep  Used iris_mk_poindtb ver 8                                   
HISTORY iris_prep         O I line wavelength shift [pix]:     -2.59            
HISTORY iris_prep    FUVS Fiducial midpoint Y shift [pix]:      2.53            
HISTORY iris_prep         O I line wavelength shift [pix]:     -2.59            
HISTORY iris_prep    FUVL Fiducial midpoint Y shift [pix]:      2.53            
HISTORY iris_prep VERSION:  1.26                                                
HISTORY iris_prep   ran on 20140607_163041                                      
HISTORY level2  Version L12-2014-04-23                                          

In [6]:
print(f[0].header.get('OBS_DESC'))


Large coarse 8-step raster 14x120 8s  C II   Si IV Deep x 8  FUV spe

In [7]:
print(f[0].header.comments['OBS_DESC'])




In [8]:
f[1].header


Out[8]:
XTENSION= 'IMAGE   '           / IMAGE extension                                
BITPIX  =                   16 / Number of bits per data pixel                  
NAXIS   =                    3 / Number of data axes                            
NAXIS1  =                  172 /                                                
NAXIS2  =                  776 /                                                
NAXIS3  =                    8 /                                                
PCOUNT  =                    0 / No Group Parameters                            
GCOUNT  =                    1 / One Data Group                                 
BSCALE  =                 0.25 /                                                
BZERO   =                 7992 /                                                
CDELT1  =            0.0259600 /                                                
CDELT2  =             0.166350 /                                                
CDELT3  =        1.99544034685 /                                                
CRPIX1  =              1.00000 /                                                
CRPIX2  =              388.500 /                                                
CRPIX3  =              4.00000 /                                                
CRVAL1  =              1332.73 /                                                
CRVAL2  =              168.252 /                                                
CRVAL3  =             -933.205 /                                                
CTYPE1  = 'WAVE    '           /                                                
CTYPE2  = 'HPLT-TAN'           /                                                
CTYPE3  = 'HPLN-TAN'           /                                                
CUNIT1  = 'Angstrom'           /                                                
CUNIT2  = 'arcsec  '           /                                                
CUNIT3  = 'arcsec  '           /                                                

In [9]:
np.shape(f[1].data[0,:,:])


Out[9]:
(776, 172)

In [10]:
num_plots = len(f[1].data[:,0,0])
fig, ax = plt.subplots(1, num_plots, figsize=(15, 10))
fig.subplots_adjust(hspace = .5, wspace=.001)
for i in range(num_plots):
    ax[i].imshow(f[1].data[i,:,:])


Slit Jaw Imager

From the User's Guide example


In [11]:
file = '/Users/schriste/Downloads/iris_l2_20131025_050530_3880013447_SJI_1400_t000.fits'

In [12]:
f = pyfits.open(file)
f


Out[12]:
[<astropy.io.fits.hdu.image.PrimaryHDU at 0x108efec10>,
 <astropy.io.fits.hdu.image.ImageHDU at 0x109009390>,
 <astropy.io.fits.hdu.table.TableHDU at 0x109009b10>]

In [13]:
header = f[0].header

Some key information from the header


In [14]:
print('The date of observation: ' + header.get('DATE_OBS'))
print(f[0].header.get('OBS_DESC'))
print('The observation ID: ' + header.get('OBSID'))
print('The number of exposures: ' + str(header.get('NAXIS3')))
print('Exposure Time: ' + str(header.get('EXPTIME')))


The date of observation: 2013-10-25T05:05:30.680
Dense synoptic raster 31.35x175 96s  Si IV   Mg II h/k Deep x 30
The observation ID: 3880013447
The number of exposures: 48
Exposure Time: 11.1879

In [15]:
header.get('DSUN_OBS')


Out[15]:
148751000000.0

In [16]:
header.get('RSUN_OBS')

In [17]:
header.get('CUNIT1')


Out[17]:
'arcsec'

In [18]:
header.get('CTYPE1')


Out[18]:
'HPLN-TAN'

In [19]:
header.get('CDELT1')


Out[19]:
0.16635

The slit-jaw context image is stored in the primary header

The first dimension is the number of exposures


In [20]:
np.shape(f[0].data)


Out[20]:
(48, 1093, 1212)

A plot of the first two frames. The black line is the image of the slit.


In [21]:
num_plots = 2
fig, ax = plt.subplots(1, 2, figsize=(15, 10))
for i in range(num_plots):
    ax[i].imshow(f[0].data[i,:,:])



In [22]:
from sunpy.map import Map
irismap = Map(file)

In [23]:
irismap


Out[23]:
[SunPy IRISSlitJawMap
 ---------
 Observatory:	 IRIS
 Instrument:	 SJI
 Detector:	 
 Measurement:	 
 Obs Date:	 2013-10-25T05:05:30.680
 dt:		 11.187900
 Dimension:	 [1093, 48]
 [dx, dy] =	 [0.166350, 0.166350]
 
 array([[[-200., -200., -200., ..., -200., -200., -200.],
         [-200., -200., -200., ..., -200., -200., -200.],
         [-200., -200., -200., ..., -200., -200., -200.],
         ..., 
         [-200., -200., -200., ..., -200., -200., -200.],
         [-200., -200., -200., ..., -200., -200., -200.],
         [-200., -200., -200., ..., -200., -200., -200.]],
 
        [[-200., -200., -200., ..., -200., -200., -200.],
         [-200., -200., -200., ..., -200., -200., -200.],
         [-200., -200., -200., ..., -200., -200., -200.],
         ..., 
         [-200., -200., -200., ..., -200., -200., -200.],
         [-200., -200., -200., ..., -200., -200., -200.],
         [-200., -200., -200., ..., -200., -200., -200.]],
 
        [[-200., -200., -200., ..., -200., -200., -200.],
         [-200., -200., -200., ..., -200., -200., -200.],
         [-200., -200., -200., ..., -200., -200., -200.],
         ..., 
         [-200., -200., -200., ..., -200., -200., -200.],
         [-200., -200., -200., ..., -200., -200., -200.],
         [-200., -200., -200., ..., -200., -200., -200.]],
 
        ..., 
        [[-200., -200., -200., ..., -200., -200., -200.],
         [-200., -200., -200., ..., -200., -200., -200.],
         [-200., -200., -200., ..., -200., -200., -200.],
         ..., 
         [-200., -200., -200., ..., -200., -200., -200.],
         [-200., -200., -200., ..., -200., -200., -200.],
         [-200., -200., -200., ..., -200., -200., -200.]],
 
        [[-200., -200., -200., ..., -200., -200., -200.],
         [-200., -200., -200., ..., -200., -200., -200.],
         [-200., -200., -200., ..., -200., -200., -200.],
         ..., 
         [-200., -200., -200., ..., -200., -200., -200.],
         [-200., -200., -200., ..., -200., -200., -200.],
         [-200., -200., -200., ..., -200., -200., -200.]],
 
        [[-200., -200., -200., ..., -200., -200., -200.],
         [-200., -200., -200., ..., -200., -200., -200.],
         [-200., -200., -200., ..., -200., -200., -200.],
         ..., 
         [-200., -200., -200., ..., -200., -200., -200.],
         [-200., -200., -200., ..., -200., -200., -200.],
         [-200., -200., -200., ..., -200., -200., -200.]]], dtype=float32),
 array([[  0.00000000e+00,  -1.67520885e+01,   1.32920906e-01,
           2.99996395e+01,   5.10000000e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89337112e+01,  -2.70811565e+02,
          -2.16338110e+03,   3.83943141e-01,   9.99936521e-01,
           1.12649733e-02,  -1.12649733e-02,   9.99936521e-01,
           0.00000000e+00,   0.00000000e+00],
        [  6.42400000e+01,  -1.60536823e+01,   1.35889590e-01,
           2.99996300e+01,   5.14198414e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89344533e+01,  -2.70829108e+02,
          -2.29765503e+03,   3.94913346e-01,   9.99936581e-01,
           1.12623628e-02,  -1.12623628e-02,   9.99936581e-01,
           0.00000000e+00,   0.00000000e+00],
        [  1.28430000e+02,  -1.53552790e+01,   1.38858914e-01,
           2.99996948e+01,   5.18396811e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89316465e+01,  -2.70796922e+02,
          -2.42296021e+03,   4.05874997e-01,   9.99936461e-01,
           1.12728179e-02,  -1.12728179e-02,   9.99936461e-01,
           0.00000000e+00,   0.00000000e+00],
        [  1.92610000e+02,  -1.46568756e+01,   1.41827941e-01,
           2.99996147e+01,   5.22595208e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89342187e+01,  -2.70800025e+02,
          -2.53998535e+03,   4.16834593e-01,   9.99936581e-01,
           1.12634469e-02,  -1.12634469e-02,   9.99936581e-01,
           0.00000000e+00,   0.00000000e+00],
        [  2.56820000e+02,  -1.39584732e+01,   1.44796953e-01,
           2.99996510e+01,   5.26793599e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89287578e+01,  -2.70853709e+02,
          -2.64592529e+03,   4.27798986e-01,   9.99936342e-01,
           1.12837600e-02,  -1.12837600e-02,   9.99936342e-01,
           0.00000000e+00,   0.00000000e+00],
        [  3.41990000e+02,  -1.32600670e+01,   1.47766292e-01,
           9.00054264e+00,   5.30992013e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89292306e+01,  -2.70876204e+02,
          -2.75609839e+03,   4.40550417e-01,   9.99936342e-01,
           1.12821246e-02,  -1.12821246e-02,   9.99936342e-01,
           0.00000000e+00,   0.00000000e+00],
        [  4.06200000e+02,  -1.25616627e+01,   1.50734976e-01,
           9.00047970e+00,   5.35190416e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89324132e+01,  -2.70791403e+02,
          -2.83944849e+03,   4.51515079e-01,   9.99936461e-01,
           1.12705221e-02,  -1.12705221e-02,   9.99936461e-01,
           0.00000000e+00,   0.00000000e+00],
        [  4.70380000e+02,  -1.18632584e+01,   1.53704301e-01,
           9.00050354e+00,   5.39388819e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89311431e+01,  -2.70800034e+02,
          -2.91090552e+03,   4.62474644e-01,   9.99936461e-01,
           1.12752952e-02,  -1.12752952e-02,   9.99936461e-01,
           0.00000000e+00,   0.00000000e+00],
        [  5.34570000e+02,  -1.11648540e+01,   1.56673312e-01,
           9.00054359e+00,   5.43587221e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89304168e+01,  -2.70779036e+02,
          -2.97041089e+03,   4.73436296e-01,   9.99936402e-01,
           1.12781040e-02,  -1.12781040e-02,   9.99936402e-01,
           0.00000000e+00,   0.00000000e+00],
        [  5.98770000e+02,  -1.04664507e+01,   1.59642339e-01,
           9.00047398e+00,   5.47785618e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89297364e+01,  -2.70876685e+02,
          -3.01854199e+03,   4.84399647e-01,   9.99936342e-01,
           1.12807527e-02,  -1.12807527e-02,   9.99936342e-01,
           0.00000000e+00,   0.00000000e+00],
        [  6.62970000e+02,  -9.76804638e+00,   1.62611663e-01,
           9.00048637e+00,   5.51984021e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89329192e+01,  -2.70822191e+02,
          -3.05359888e+03,   4.95362014e-01,   9.99936521e-01,
           1.12691475e-02,  -1.12691475e-02,   9.99936521e-01,
           0.00000000e+00,   0.00000000e+00],
        [  7.27160000e+02,  -9.06964397e+00,   1.65580511e-01,
           9.00051498e+00,   5.56182412e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89235362e+01,  -2.70785898e+02,
          -3.07684497e+03,   5.06323695e-01,   9.99936104e-01,
           1.13039110e-02,  -1.13039110e-02,   9.99936104e-01,
           0.00000000e+00,   0.00000000e+00],
        [  7.91380000e+02,  -8.37123871e+00,   1.68549687e-01,
           9.00049114e+00,   5.60380820e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89321391e+01,  -2.70773150e+02,
          -3.08738818e+03,   5.17290473e-01,   9.99936461e-01,
           1.12722469e-02,  -1.12722469e-02,   9.99936461e-01,
           0.00000000e+00,   0.00000000e+00],
        [  8.55580000e+02,  -7.67283440e+00,   1.71518698e-01,
           9.00052071e+00,   5.64579223e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89339636e+01,  -2.70764559e+02,
          -3.08455200e+03,   5.28253794e-01,   9.99936521e-01,
           1.12656336e-02,  -1.12656336e-02,   9.99936521e-01,
           0.00000000e+00,   0.00000000e+00],
        [  9.19770000e+02,  -6.97442961e+00,   1.74487710e-01,
           9.00048447e+00,   5.68777629e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89277490e+01,  -2.70743929e+02,
          -3.06964966e+03,   5.39214492e-01,   9.99936283e-01,
           1.12887276e-02,  -1.12887276e-02,   9.99936283e-01,
           0.00000000e+00,   0.00000000e+00],
        [  9.83940000e+02,  -6.27602673e+00,   1.77456871e-01,
           9.00056362e+00,   5.72976023e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89320209e+01,  -2.70698542e+02,
          -3.04245923e+03,   5.50172687e-01,   9.99936461e-01,
           1.12730730e-02,  -1.12730730e-02,   9.99936461e-01,
           0.00000000e+00,   0.00000000e+00],
        [  1.04817000e+03,  -5.57762146e+00,   1.80425897e-01,
           9.00047398e+00,   5.77174431e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89353654e+01,  -2.70688838e+02,
          -3.00363550e+03,   5.61141193e-01,   9.99936581e-01,
           1.12608178e-02,  -1.12608178e-02,   9.99936581e-01,
           0.00000000e+00,   0.00000000e+00],
        [  1.11235000e+03,  -4.87921762e+00,   1.83394909e-01,
           9.00049973e+00,   5.81372831e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89302260e+01,  -2.70711328e+02,
          -2.95133911e+03,   5.72100878e-01,   9.99936402e-01,
           1.12799397e-02,  -1.12799397e-02,   9.99936402e-01,
           0.00000000e+00,   0.00000000e+00],
        [  1.17653000e+03,  -4.18081331e+00,   1.86364010e-01,
           9.00053883e+00,   5.85571234e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89313568e+01,  -2.70690252e+02,
          -2.88859399e+03,   5.83060384e-01,   9.99936402e-01,
           1.12758968e-02,  -1.12758968e-02,   9.99936402e-01,
           0.00000000e+00,   0.00000000e+00],
        [  1.24073000e+03,  -3.48240972e+00,   1.89333081e-01,
           9.00050640e+00,   5.89769632e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89313103e+01,  -2.70628514e+02,
          -2.81328760e+03,   5.94023407e-01,   9.99936402e-01,
           1.12761846e-02,  -1.12761846e-02,   9.99936402e-01,
           0.00000000e+00,   0.00000000e+00],
        [  1.30494000e+03,  -2.78400540e+00,   1.92302182e-01,
           9.00050926e+00,   5.93968035e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89321133e+01,  -2.70611599e+02,
          -2.72683569e+03,   6.04988515e-01,   9.99936461e-01,
           1.12733617e-02,  -1.12733617e-02,   9.99936461e-01,
           0.00000000e+00,   0.00000000e+00],
        [  1.36911000e+03,  -2.08560133e+00,   1.95271268e-01,
           9.00048447e+00,   5.98166436e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89333560e+01,  -2.70569631e+02,
          -2.63021313e+03,   6.15946710e-01,   9.99936521e-01,
           1.12688709e-02,  -1.12688709e-02,   9.99936521e-01,
           0.00000000e+00,   0.00000000e+00],
        [  1.43332000e+03,  -1.38719714e+00,   1.98240265e-01,
           9.00050640e+00,   6.02364838e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89286491e+01,  -2.70517677e+02,
          -2.52360107e+03,   6.26911461e-01,   9.99936283e-01,
           1.12863733e-02,  -1.12863733e-02,   9.99936283e-01,
           0.00000000e+00,   0.00000000e+00],
        [  1.49751000e+03,  -6.88793182e-01,   2.01209381e-01,
           9.00055313e+00,   6.06563238e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89334558e+01,  -2.70538266e+02,
          -2.40755811e+03,   6.37872696e-01,   9.99936521e-01,
           1.12687498e-02,  -1.12687498e-02,   9.99936521e-01,
           0.00000000e+00,   0.00000000e+00],
        [  1.56170000e+03,   9.61100962e-03,   2.04178452e-01,
           9.00048828e+00,   6.10761640e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89340871e+01,  -2.70512484e+02,
          -2.28156909e+03,   6.48834109e-01,   9.99936521e-01,
           1.12665398e-02,  -1.12665398e-02,   9.99936521e-01,
           0.00000000e+00,   0.00000000e+00],
        [  1.62590000e+03,   7.08015144e-01,   2.07147524e-01,
           9.00050163e+00,   6.14960042e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89328995e+01,  -2.70475709e+02,
          -2.14712720e+03,   6.59797490e-01,   9.99936461e-01,
           1.12710521e-02,  -1.12710521e-02,   9.99936461e-01,
           0.00000000e+00,   0.00000000e+00],
        [  1.69011000e+03,   1.40641928e+00,   2.10116625e-01,
           9.00051975e+00,   6.19158443e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89319354e+01,  -2.70440699e+02,
          -2.00474927e+03,   6.70762479e-01,   9.99936461e-01,
           1.12747233e-02,  -1.12747233e-02,   9.99936461e-01,
           0.00000000e+00,   0.00000000e+00],
        [  1.75429000e+03,   2.10482335e+00,   2.13085681e-01,
           9.00049400e+00,   6.23356845e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89313146e+01,  -2.70405475e+02,
          -1.85593945e+03,   6.81721449e-01,   9.99936402e-01,
           1.12771597e-02,  -1.12771597e-02,   9.99936402e-01,
           0.00000000e+00,   0.00000000e+00],
        [  1.81847000e+03,   2.80322742e+00,   2.16054752e-01,
           9.00051403e+00,   6.27555246e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89355837e+01,  -2.70388253e+02,
          -1.69987744e+03,   6.92681432e-01,   9.99936581e-01,
           1.12615051e-02,  -1.12615051e-02,   9.99936581e-01,
           0.00000000e+00,   0.00000000e+00],
        [  1.88268000e+03,   3.50163126e+00,   2.19023764e-01,
           9.00046158e+00,   6.31753646e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89349925e+01,  -2.70351936e+02,
          -1.53846216e+03,   7.03646481e-01,   9.99936581e-01,
           1.12637961e-02,  -1.12637961e-02,   9.99936581e-01,
           0.00000000e+00,   0.00000000e+00],
        [  1.94686000e+03,   4.20003605e+00,   2.21992940e-01,
           9.00053215e+00,   6.35952051e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89361154e+01,  -2.70355502e+02,
          -1.37264758e+03,   7.14606404e-01,   9.99936581e-01,
           1.12597905e-02,  -1.12597905e-02,   9.99936581e-01,
           0.00000000e+00,   0.00000000e+00],
        [  2.01107000e+03,   4.89843988e+00,   2.24961892e-01,
           9.00049973e+00,   6.40150451e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89324235e+01,  -2.70285215e+02,
          -1.20227014e+03,   7.25570500e-01,   9.99936461e-01,
           1.12735443e-02,  -1.12735443e-02,   9.99936461e-01,
           0.00000000e+00,   0.00000000e+00],
        [  2.07530000e+03,   5.59684420e+00,   2.27931067e-01,
           9.00046921e+00,   6.44348854e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89308559e+01,  -2.70239432e+02,
          -1.02840857e+03,   7.36539006e-01,   9.99936402e-01,
           1.12794815e-02,  -1.12794815e-02,   9.99936402e-01,
           0.00000000e+00,   0.00000000e+00],
        [  2.13947000e+03,   6.29524803e+00,   2.30900213e-01,
           9.00047970e+00,   6.48547253e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89354227e+01,  -2.70253857e+02,
          -8.51571289e+02,   7.47497201e-01,   9.99936581e-01,
           1.12627028e-02,  -1.12627028e-02,   9.99936581e-01,
           0.00000000e+00,   0.00000000e+00],
        [  2.20365000e+03,   6.99365187e+00,   2.33869240e-01,
           9.00052357e+00,   6.52745653e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89308595e+01,  -2.70261303e+02,
          -6.73687012e+02,   7.58456767e-01,   9.99936402e-01,
           1.12797134e-02,  -1.12797134e-02,   9.99936402e-01,
           0.00000000e+00,   0.00000000e+00],
        [  2.26790000e+03,   7.69205713e+00,   2.36838251e-01,
           9.00053120e+00,   6.56944062e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89319446e+01,  -2.70208780e+02,
          -4.94505798e+02,   7.69428253e-01,   9.99936402e-01,
           1.12758391e-02,  -1.12758391e-02,   9.99936402e-01,
           0.00000000e+00,   0.00000000e+00],
        [  2.33205000e+03,   8.39046001e+00,   2.39807263e-01,
           9.00049877e+00,   6.61142456e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89308103e+01,  -2.70220245e+02,
          -3.15098297e+02,   7.80382872e-01,   9.99936402e-01,
           1.12801408e-02,  -1.12801408e-02,   9.99936402e-01,
           0.00000000e+00,   0.00000000e+00],
        [  2.39625000e+03,   9.08886433e+00,   2.42776260e-01,
           9.00052071e+00,   6.65340858e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89340123e+01,  -2.70105822e+02,
          -1.36925705e+02,   7.91346252e-01,   9.99936521e-01,
           1.12683978e-02,  -1.12683978e-02,   9.99936521e-01,
           0.00000000e+00,   0.00000000e+00],
        [  2.46045000e+03,   9.78726768e+00,   2.45745599e-01,
           9.00047684e+00,   6.69539255e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89305313e+01,  -2.70068397e+02,
           4.01078987e+01,   8.02309513e-01,   9.99936342e-01,
           1.12814447e-02,  -1.12814447e-02,   9.99936342e-01,
           0.00000000e+00,   0.00000000e+00],
        [  2.52465000e+03,   1.04856730e+01,   2.48714298e-01,
           9.00052357e+00,   6.73737664e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89291793e+01,  -2.70110876e+02,
           2.14864395e+02,   8.13272476e-01,   9.99936283e-01,
           1.12865642e-02,  -1.12865642e-02,   9.99936283e-01,
           0.00000000e+00,   0.00000000e+00],
        [  2.58887000e+03,   1.11840754e+01,   2.51683623e-01,
           9.00048923e+00,   6.77936055e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89347150e+01,  -2.70077630e+02,
           3.86031891e+02,   8.24238837e-01,   9.99936521e-01,
           1.12661878e-02,  -1.12661878e-02,   9.99936521e-01,
           0.00000000e+00,   0.00000000e+00],
        [  2.65303000e+03,   1.18824816e+01,   2.54652947e-01,
           9.00050259e+00,   6.82134469e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89322808e+01,  -2.70049353e+02,
           5.53579590e+02,   8.35195243e-01,   9.99936461e-01,
           1.12752933e-02,  -1.12752933e-02,   9.99936461e-01,
           0.00000000e+00,   0.00000000e+00],
        [  2.71725000e+03,   1.25808840e+01,   2.57621646e-01,
           9.00052929e+00,   6.86332860e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89292635e+01,  -2.70023355e+02,
           7.16218323e+02,   8.46162021e-01,   9.99936283e-01,
           1.12866247e-02,  -1.12866247e-02,   9.99936283e-01,
           0.00000000e+00,   0.00000000e+00],
        [  2.78145000e+03,   1.32792902e+01,   2.60591000e-01,
           9.00053406e+00,   6.90531274e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89310916e+01,  -2.70022339e+02,
           8.73854187e+02,   8.57125223e-01,   9.99936402e-01,
           1.12799713e-02,  -1.12799713e-02,   9.99936402e-01,
           0.00000000e+00,   0.00000000e+00],
        [  2.84565000e+03,   1.39776945e+01,   2.63559669e-01,
           9.00047970e+00,   6.94729677e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89342930e+01,  -2.69964889e+02,
           1.02491675e+03,   8.68087769e-01,   9.99936521e-01,
           1.12682376e-02,  -1.12682376e-02,   9.99936521e-01,
           0.00000000e+00,   0.00000000e+00],
        [  2.90980000e+03,   1.46760988e+01,   2.66528994e-01,
           9.00044346e+00,   6.98928080e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89296637e+01,  -2.69945982e+02,
           1.16889502e+03,   8.79042566e-01,   9.99936342e-01,
           1.12855053e-02,  -1.12855053e-02,   9.99936342e-01,
           0.00000000e+00,   0.00000000e+00],
        [  2.97405000e+03,   1.53745003e+01,   2.69498020e-01,
           9.00047207e+00,   7.03126465e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89307304e+01,  -2.69995565e+02,
           1.30506018e+03,   8.90014470e-01,   9.99936342e-01,
           1.12817092e-02,  -1.12817092e-02,   9.99936342e-01,
           0.00000000e+00,   0.00000000e+00],
        [  3.03822000e+03,   1.60729065e+01,   2.72467017e-01,
           9.00053406e+00,   7.07324879e+02,   5.09000000e+02,
           1.00000000e+00,   1.00000000e+00,   1.50999999e+00,
           4.00000000e+00,   9.89356794e+01,  -2.69974105e+02,
           1.43307605e+03,   9.00972724e-01,   9.99936581e-01,
           1.12634609e-02,  -1.12634609e-02,   9.99936581e-01,
           0.00000000e+00,   0.00000000e+00]])]

In [24]:
np.shape(irismap[0].data)


Out[24]:
(48, 1093, 1212)

In [25]:
from sunpy.map import GenericMap
imap = GenericMap(f[0].data[0,:,:], header)

In [26]:
plt.figure(figsize=(15, 10))
imap.cmap.set_gamma(0.45)
imap.plot()
plt.show()


/Users/schriste/Dropbox/Developer/python/sunpy/sunpy/map/mapbase.py:1068: Warning: This map is not aligned. Plot axes may be incorrect
  Warning)

In [27]:
num_plots = 20
imap_list = []
for i in range(num_plots):
   imap_list.append(GenericMap(f[0].data[i,:,:], header))

In [28]:
from sunpy.map import MapCube
cmap = MapCube(imap_list)

In [31]:
cmap.plot()


Out[31]:
<matplotlib.animation.FuncAnimation at 0x1083707d0>

Exploring the secondary HDU

This header contains various axis which are described in the header. For example the start time of each exposure is stored in f[1].data[:,0]


In [51]:
f[1].header


Out[51]:
XTENSION= 'IMAGE   '           / IMAGE extension                                
BITPIX  =                  -64 / Number of bits per data pixel                  
NAXIS   =                    2 / Number of data axes                            
NAXIS1  =                   20 /                                                
NAXIS2  =                   48 /                                                
PCOUNT  =                    0 / No Group Parameters                            
GCOUNT  =                    1 / One Data Group                                 
TIME    =                    0 /time of each exposure in s after start of OBS (r
PZTX    =                    1 /PZTX of each exposure in arcsec (rowindex)      
PZTY    =                    2 /PZTY of each exposure in arcsec (rowindex)      
EXPTIMES=                    3 /SJI Exposure duration of each exposure in s (row
SLTPX1IX=                    4 /Slit center in X of each exposure in window-pixe
SLTPX2IX=                    5 /Slit center in Y of each exposure in window-pixe
SUMSPTRS=                    6 /SJI spectral summing (rowindex)                 
SUMSPATS=                    7 /SJI spatial summing (rowindex)                  
DSRCSIX =                    8 /SJI data source level (rowindex)                
LUTIDS  =                    9 /SJI LUT ID (rowindex)                           
XCENIX  =                   10 /XCEN (rowindex)                                 
YCENIX  =                   11 /YCEN (rowindex)                                 
OBS_VRIX=                   12 /Speed of observer in radial direction (rowindex)
OPHASEIX=                   13 /Orbital phase (rowindex)                        
PC1_1IX =                   14 /PC1_1 (rowindex)                                
PC1_2IX =                   15 /PC1_2 (rowindex)                                
PC2_1IX =                   16 /PC2_1 (rowindex)                                
PC2_2IX =                   17 /PC2_2 (rowindex)                                
PC3_1IX =                   18 /PC3_1 (rowindex)                                
PC3_2IX =                   19 /PC3_2 (rowindex)                                

In [56]:
np.shape(f[1].data)


Out[56]:
(48, 20)

The time of each exposure in s after start of OBS


In [64]:
f[1].data[:,0]


Out[64]:
array([    0.  ,    64.24,   128.43,   192.61,   256.82,   341.99,
         406.2 ,   470.38,   534.57,   598.77,   662.97,   727.16,
         791.38,   855.58,   919.77,   983.94,  1048.17,  1112.35,
        1176.53,  1240.73,  1304.94,  1369.11,  1433.32,  1497.51,
        1561.7 ,  1625.9 ,  1690.11,  1754.29,  1818.47,  1882.68,
        1946.86,  2011.07,  2075.3 ,  2139.47,  2203.65,  2267.9 ,
        2332.05,  2396.25,  2460.45,  2524.65,  2588.87,  2653.03,
        2717.25,  2781.45,  2845.65,  2909.8 ,  2974.05,  3038.22])

Slit center in Y of each exposure in window-pixe


In [65]:
f[1].data[:,5]


Out[65]:
array([ 509.,  509.,  509.,  509.,  509.,  509.,  509.,  509.,  509.,
        509.,  509.,  509.,  509.,  509.,  509.,  509.,  509.,  509.,
        509.,  509.,  509.,  509.,  509.,  509.,  509.,  509.,  509.,
        509.,  509.,  509.,  509.,  509.,  509.,  509.,  509.,  509.,
        509.,  509.,  509.,  509.,  509.,  509.,  509.,  509.,  509.,
        509.,  509.,  509.])

Slit center in X of each exposure in window-pixe


In [66]:
f[1].data[:,4]


Out[66]:
array([ 510.        ,  514.19841413,  518.39681105,  522.59520798,
        526.79359917,  530.9920133 ,  535.19041596,  539.38881862,
        543.58722128,  547.78561821,  551.98402087,  556.18241206,
        560.38082046,  564.57922312,  568.77762864,  572.9760227 ,
        577.1744311 ,  581.37283089,  585.57123355,  589.76963191,
        593.96803457,  598.1664358 ,  602.36483774,  606.56323825,
        610.76164019,  614.96004178,  619.15844336,  623.35684459,
        627.55524582,  631.75364561,  635.95205114,  640.15045093,
        644.34885359,  648.54725339,  652.74565318,  656.94406157,
        661.14245563,  665.34085829,  669.53925522,  673.73766361,
        677.93605481,  682.13446893,  686.33286013,  690.53127425,
        694.72967691,  698.92807957,  703.12646503,  707.32487916])

Exploring the third HDU


In [68]:
f[2].header


Out[68]:
XTENSION= 'TABLE   '           / ASCII table extension                          
BITPIX  =                    8 / 8 bit bytes                                    
NAXIS   =                    2 / 2-dimensional ASCII table                      
NAXIS1  =                   90 /Number of positions along axis 1                
NAXIS2  =                   48 /Number of positions along axis 2                
PCOUNT  =                    0 / Size of special data area                      
GCOUNT  =                    1 / one data group (required keyword)              
TFIELDS =                    4 / Number of fields in each row                   
TBCOL1  =                    1 /                                                
TFORM1  = 'A10     '           /                                                
TTYPE1  = 'FRMID   '           /                                                
FRMID   =                    0 /FRM ID of each exposure (rowindex)              
LFRMID  =                   10 /Length of FRM ID (rows)                         
TBCOL2  =                   11 /                                                
TFORM2  = 'A10     '           /                                                
TTYPE2  = 'SJIFDBID'           /                                                
FDBIDS  =                   10 /SJI FDB ID of each exposure (rowindex)          
LFDBIDS =                   10 /Length of SJI FDB ID (rows)                     
TBCOL3  =                   21 /                                                
TFORM3  = 'A4      '           /                                                
TTYPE3  = 'SJICRSID'           /                                                
CRSIDS  =                   20 /SJI CRS ID of each exposure (rowindex)          
LCRSIDS =                    4 /Length of SJI CRS ID (rows)                     
TBCOL4  =                   25 /                                                
TFORM4  = 'A66     '           /                                                
TTYPE4  = 'SJIfilename'        /                                                
FILES   =                   24 /SJI filename of each exposure (rowindex)        
LFILES  =                   66 /Length of SJI filename (rows)                   

In [69]:
np.shape(f[2].data)


Out[69]:
(48,)

In [71]:
f[2].data


Out[71]:
FITS_rec([ ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05054568_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05064992_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05075411_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05085829_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05100250_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05111717_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05122138_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05132556_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05142975_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05153395_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05163815_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05174234_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05184656_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05195076_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05205495_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05215912_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05230335_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05240753_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05251171_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05261591_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05272012_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05282429_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05292850_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05303269_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05313688_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05324108_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05334529_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05344947_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05355365_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05365786_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05380204_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05390625_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05401048_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05411465_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05421883_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05432308_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05442723_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05453143_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05463563_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05473983_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05484405_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05494821_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05505243_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05515663_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05530083_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05540498_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05550923_sji.fits'),
       ('3880013447', '3808401392', '1637', '/irisa/data/level1/2013/10/25/H0500/iris20131025_05561340_sji.fits')], 
      dtype=[('FRMID', 'S10'), ('SJIFDBID', 'S10'), ('SJICRSID', 'S4'), ('SJIfilename', 'S66')])

Downloaded one of these files


In [ ]:


In [33]:
file = '/Users/schriste/Downloads/iris20131025_05064992_sji.fits'

In [34]:
ff = pyfits.open(file)

In [35]:
ff


Out[35]:
[<astropy.io.fits.hdu.image.PrimaryHDU at 0x1085344d0>,
 <astropy.io.fits.hdu.compressed.CompImageHDU at 0x10851af50>]

In [36]:
ff[0].header


Out[36]:
SIMPLE  =                    T / file does conform to FITS standard             
BITPIX  =                   16 / number of bits per data pixel                  
NAXIS   =                    0 / number of data axes                            
EXTEND  =                    T / FITS dataset may contain extensions            
COMMENT   FITS (Flexible Image Transport System) format is defined in 'Astronomy
COMMENT   and Astrophysics', volume 376, page 359; bibcode: 2001A&A...376..359H 

In [37]:
ff[0].data

In [38]:
ff[1].header


Out[38]:
XTENSION= 'IMAGE   '           / binary table extension                         
BITPIX  =                   16 / data type of original image                    
NAXIS   =                    2 / dimension of original image                    
NAXIS1  =                 2072 / length of original image axis                  
NAXIS2  =                 1096 / length of original image axis                  
PCOUNT  =                    0 / size of special data area                      
GCOUNT  =                    1 / one data group (required keyword)              
ORIGIN  = 'SDO/JSOC-SDP'                                                        
TELESCOP= 'IRIS'                                                                
BLD_VERS= 'V8R1X'                                                               
LVL_NUM = 1.000000                                                              
DATE    = '2013-10-28T17:09:53'                                                 
DATE-OBS= '2013-10-25T05:06:34.92'                                              
T_OBS   = '2013-10-25T05:06:49.92Z'                                             
IMGFPT  = '2013-10-25T05:07:05.88Z'                                             
FSN     =              2932927                                                  
ISYSN   =                    3                                                  
FID     =                65809                                                  
INSTRUME= 'SJI'                                                                 
IMG_PATH= 'SJI_1400'                                                            
IMG_TYPE= 'LIGHT'                                                               
CAMERA  =                    2                                                  
SUMSPTRL=                    1                                                  
SUMSPAT =                    1                                                  
EXPTIME = 29.999630                                                             
EXPSDEV = 0.000022                                                              
INT_TIME= 30.984375                                                             
QUALITY =                    0                                                  
QUALLEV0=                    0                                                  
CROPID  =                 1637                                                  
LUTID   =                    4                                                  
TOTVALS =              1048000                                                  
DATAVALS=              1048000                                                  
MISSVALS=                    0                                                  
PERCENTD= 100.000000                                                            
DATAMIN =                   99                                                  
DATAMAX =                16358                                                  
DATAMEDN=                  565                                                  
DATAMEAN= 886.766724                                                            
DATARMS = 1037.907104                                                           
DATASKEW= 6.097356                                                              
DATAKURT= 66.009224                                                             
DATAP01 = 170.00                                                                
DATAP10 = 245.00                                                                
DATAP25 = 333.00                                                                
DATAP75 = 1109.00                                                               
DATAP90 = 1846.00                                                               
DATAP95 = 2453.00                                                               
DATAP98 = 3443.00                                                               
DATAP99 = 4539.00                                                               
NSATPIX =                 1001                                                  
IICRSID =                 1637                                                  
CRS_DESC= 'FUV, 1x1, 0174'                                                      
CRS_TYPE= 'SJI'                                                                 
CRS_NREG=                    1                                                  
WIN_FLIP=                    2                                                  
TSR1    =                   25                                                  
TER1    =                 1072                                                  
TSC1    =                   37                                                  
TEC1    =                 1036                                                  
TSR2    =                    0                                                  
TER2    =                    0                                                  
TSC2    =                    0                                                  
TEC2    =                    0                                                  
TSR3    =                    0                                                  
TER3    =                    0                                                  
TSC3    =                    0                                                  
TEC3    =                    0                                                  
TSR4    =                    0                                                  
TER4    =                    0                                                  
TSC4    =                    0                                                  
TEC4    =                    0                                                  
TSR5    =                    0                                                  
TER5    =                    0                                                  
TSC5    =                    0                                                  
TEC5    =                    0                                                  
TSR6    =                    0                                                  
TER6    =                    0                                                  
TSC6    =                    0                                                  
TEC6    =                    0                                                  
TSR7    =                    0                                                  
TER7    =                    0                                                  
TSC7    =                    0                                                  
TEC7    =                    0                                                  
TSR8    =                    0                                                  
TER8    =                    0                                                  
TSC8    =                    0                                                  
TEC8    =                    0                                                  
WCSDBVER=                    2                                                  
WCSAXES =                    2                                                  
LONPOLE = 180.000000                                                            
SPECSYS = 'HELIOCEN'                                                            
XCEN    = 163.234451                                                            
YCEN    = -281.407898                                                           
CRPIX1  = 529.320007                                                            
CRPIX2  = 510.459991                                                            
CRVAL1  = 79.159531                                                             
CRVAL2  = -286.432220                                                           
CRVAL3  = 0.000000                                                              
CDELT1  = 0.165600                                                              
CDELT2  = 0.165600                                                              
CDELT3  = 0.000000                                                              
CTYPE1  = 'HPLN-TAN'                                                            
CTYPE2  = 'HPLT-TAN'                                                            
CTYPE3  = 'none'                                                                
CUNIT1  = 'arcsec'                                                              
CUNIT2  = 'arcsec'                                                              
CUNIT3  = 'none'                                                                
PC1_1   = 0.999885                                                              
PC1_2   = 0.015173                                                              
PC2_1   = -0.015173                                                             
PC2_2   = 0.999885                                                              
PC3_1   = 0.000000                                                              
PC3_2   = 0.000000                                                              
CRPIX1A = 529.320007                                                            
CRPIX2A = 510.459991                                                            
CRVAL1A = 79.159531                                                             
CRVAL2A = -286.432220                                                           
CRVAL3A = 0.000000                                                              
CDELT1A = 0.165600                                                              
CDELT2A = 0.165600                                                              
CDELT3A = 0.000000                                                              
CTYPE1A = 'HPLN-TAN'                                                            
CTYPE2A = 'HPLT-TAN'                                                            
CTYPE3A = 'none'                                                                
CUNIT1A = 'arcsec'                                                              
CUNIT2A = 'arcsec'                                                              
CUNIT3A = 'none'                                                                
PC1_1A  = 0.999885                                                              
PC1_2A  = 0.015173                                                              
PC2_1A  = -0.015173                                                             
PC2_2A  = 0.999885                                                              
PC3_1A  = 0.000000                                                              
PC3_2A  = 0.000000                                                              
POINTREC= 'iris.pointing_data[:#1097137]'                                       
TIME_QBI= '2013-10-25T05:06:45Z'                                                
AEULRBRX= 0.021705                                                              
AEULRBRY= -0.049784                                                             
AEULRBRZ= -0.000609                                                             
ACG_ROLL= 0.000000                                                              
OPHASE  = 0.393240                                                              
SAT_ROT = -0.000609                                                             
FLAT_REC= 'iris.flatfield_prelim[:#14]'                                         
ORB_REC = 'iris.orbit_vectors[2013.10.25_05:06:00_UTC]'                         
RSUN_OBS= 964.530029                                                            
DSUN_OBS= 148756329485.7                                                        
GEIX_OBS= 3631508.85                                                            
GEIY_OBS= -4500380.59                                                           
GEIZ_OBS= 3940149.93                                                            
HEIX_OBS= -126493634595.32                                                      
HEIY_OBS= -71819471447.61                                                       
HEIZ_OBS= -31141122191.90                                                       
OBS_VR  = -2297.6551                                                            
HLZ     =                    0                                                  
SAA     =                    0                                                  
BTYPE   = 'Intensity'                                                           
BUNIT   = 'Corrected DN'                                                        
TEMP_REC= 'iris.temperatures_60s[:#195505]'                                     
ITF1CCD1= -62.000000                                                            
ITF2CCD2= -61.250000                                                            
ITNUCCD3= -61.000000                                                            
ITSJCCD4= -62.000000                                                            
BT06CBPX= 0.970000                                                              
BT07CBNX= 1.700000                                                              
BT15IEB = 33.029999                                                             
IT08GTWM= 27.629999                                                             
IT14SPPX= 19.040001                                                             
IT16SPNX= 18.980000                                                             
ISPSNAME= 'iris.isp'                                                            
ISPPKTIM= '2013-10-25T05:07:05.82Z'                                             
ISPPKTVN= '010.058'                                                             
ISQISYSN=                    2                                                  
ISQFSN  =              2932927                                                  
IIFRMTYP=                    1                                                  
IIOBSLID=                20103                                                  
IIFRMLID=                20103                                                  
ISQOLTID=           3880013447                                                  
ISQFLTID=           3880013447                                                  
IIFDBID =           3808401392                                                  
IIFUVFDB=           3808400048                                                  
IINUVFDB=           3808400720                                                  
IISJIFDB=           3808401392                                                  
IIOLRPT =                    0                                                  
IIOLNRPT=                    1                                                  
IIFLRPT =                    1                                                  
IIFLNRPT=                   48                                                  
ISQOLTDX=                    0                                                  
ISQOLTNX=                    1                                                  
ISQFLTDX=                    0                                                  
ISQFLTNX=                    2                                                  
IISSLOOP= 'CLOSED'                                                              
IISSDIOD=                    1                                                  
IISSOFFR=                    0                                                  
IISS_SRC=                    1                                                  
IISSCTRL=                    7                                                  
IFMCPOS =                 -115                                                  
IFMPOS  =                 -115                                                  
IFWCTGT =                   91                                                  
IFWENC  =                   92                                                  
IFWPOS  =                   91                                                  
IWM1CPOS=                   43                                                  
IWM1CTGT=                   41                                                  
IWM1ENC =                   43                                                  
IWM2CPOS=                  145                                                  
IWM2CTGT=                  143                                                  
IWM2ENC =                  145                                                  
IIMGSHCE=                30000                                                  
IIMGCFD1=                   38                                                  
IIMGCFD2=                   41                                                  
IIMGCFD3=                 3901                                                  
IIMGCFD4=                 4004                                                  
IFUVCEXP=                29296                                                  
INUVCEXP=                29296                                                  
ISJICEXP=                29296                                                  
IIMGOTS =           1761368859                                                  
ISQORBPD=                 5856                                                  
ISQORBSE=           1761366485                                                  
ISQORBSU=                    0                                                  
ISQOWTID=                   22                                                  
ISQSRTID=                13298                                                  
ISQPZTA =                 -323                                                  
ISQPZTB =                 -520                                                  
ISQPZTC =                   94                                                  
IISSPZTA=                 -323                                                  
IISSPZTB=                 -520                                                  
IISSPZTC=                   94                                                  
IRTPZTA =                  -98                                                  
IRTPZTB =                   84                                                  
IRTPZTC =                   15                                                  
IWBPZTA =                   25                                                  
IWBPZTB =                  -35                                                  
IWBPZTC =                   10                                                  
ISXER   =                 2047                                                  
ISXERAVG=                -2047                                                  
ISXERMAX=                -2041                                                  
ISXERMIN=                 2046                                                  
ISYER   =                -2048                                                  
ISYERAVG=                 2047                                                  
ISYERMAX=                -2046                                                  
ISYERMIN=                 2044                                                  
IGTPOFFX=                    0                                                  
IGTPOFFY=                    0                                                  
IGTPSVX =                    6                                                  
IGTPSVY =                    0                                                  
ITACSSTS=                20521                                                  
IAECTID =                    5                                                  
IAECENAM=                65535                                                  
IAECEVFL= 'NO'                                                                  
IAECFLAG= 'YES'                                                                 
IAECFLFL= 'YES'                                                                 
IAECLTIM=                 3600                                                  
IAECEVLT=                 1200                                                  
IIHIS1  =                    0                                                  
IIHIS2  =                    0                                                  
IIHIS3  =                    0                                                  
IIHIS4  =                    0                                                  
IIHIS5  =                    0                                                  
IIHISFSN=              2932921                                                  
KEYWDDOC= 'http://www.lmsal.com/irisdocs/irisfitskeywords.pdf'                  
RECNUM  =               429147                                                  
BLANK   =               -32768                                                  
CHECKSUM= 'bcTiecQfbcQfbcQf'   / HDU checksum updated 2013-10-29T12:44:32       
DATASUM = '361830536'          / data unit checksum updated 2013-10-29T12:44:32 

In [39]:
np.shape(ff[1].data)


Out[39]:
(1096, 2072)

In [40]:
num_plots = 2
fig, ax = plt.subplots(1, 1, figsize=(15, 10))
ax.imshow(f[1].data)


Out[40]:
<matplotlib.image.AxesImage at 0x108785d50>

Not sure what that is!

IRIS Raster


In [6]:
file = '/Users/schriste/Downloads/iris_l2_20131025_050530_3880013447_raster_t000_r00000.fits'

In [401]:
import astropy.units as u
import astropy.nddata
from sunpy.time import TimeRange, parse_time
from astropy.wcs import WCS
from astropy.units import Quantity
from astropy.io import fits as pyfits
import matplotlib.pyplot as plt
import matplotlib.colors as mcolors

class IRISRaster(astropy.nddata.NDData):
    """A Custom class to handle IRIS Raster data"""
    def __init__(self, filename):
        fits = pyfits.open(filename)
        
        self.meta = fits[0].header
        self.nlines = self.meta['NWIN']
        self._fits = fits
        self.wavelength_range = [Quantity([self.meta['TWMIN' + str(i+1)], self.meta['TWMAX' + str(i+1)]], 'Angstrom') for i in range(self.nlines)]
        self.wavelength = Quantity([self.meta['TWAVE' + str(i+1)] for i in range(self.nlines)], 'Angstrom')
        self.lines = [self.meta['TDESC' + str(i+1)] for i in range(self.nlines)]
        self.description = self.meta['OBS_DESC']
        self.observation_id = self.meta['OBSID']
        self.timerange = TimeRange(self.meta['STARTOBS'], self.meta['ENDOBS'])
        self.observation_time = parse_time(self.meta['DATE_OBS'])
        self.dsun = Quantity(self.meta['DSUN_OBS'], 'm')
        self.telescope = self.meta['TELESCOP']
        self.data_level = self.meta['DATA_LEV']
        self.exposure_time = Quantity(self.meta['EXPTIME'], 's')
        self.exposure_number = self.meta['NEXP']
        self.times = np.shape(fits[4].data[:, fits[4].header['TIME']])
        
        from datetime import timedelta
        time_offset = [timedelta(seconds=dt) for dt in raster[4].data[:,0]]
        dt = raster[4].data[:,3]
        import dateutil.parser
        base_date_obs = dateutil.parser.parse(raster[0].header.get('DATE_OBS'))
        date_obs = [base_date_obs + t for t in time_offset]
        
        base_date_obs = parse_time(self._fits[0].header.get('DATE_OBS'))
        self.time = [timedelta(seconds=dt) + base_date_obs for dt in self._fits[4].data[:,0]]

    def get_axis(self, axis_index, wave_index):
        header = self._fits[wave_index+1].header
        axis = Quantity(header.get('CRVAL'+str(axis_index+1)) + 
                         header.get('CDELT'+str(axis_index+1)) * np.arange(0, header.get('NAXIS'+str(axis_index+1)))
                                 , header.get('CUNIT'+str(axis_index+1)))
        return axis
    
    def imshow(self, wave_index, exp_index, axes=None, worldcoord=True, **imshow_args):
        #Get current axes
        if not axes:
            axes = plt.gca()

        ax1 = self.get_axis(0, wave_index)
        ax2 = self.get_axis(1, wave_index)
        if worldcoord:

            extent = [np.min(ax1.value), np.max(ax1.value), np.min(ax2.value), np.max(ax2.value)]
            axes.set_ylabel(ax2[0].unit)
            axes.set_xlabel(ax1[0].unit)
        else:
            xrange = [0, len(ax1)]
            yrange = [0, len(ax2)]
            extent = xrange + yrange
            axes.set_ylabel('Slit Position [pixels]')
            axes.set_xlabel('Lambda [pixels]')

            data = self._fits[wave_index+1].data[exp_index, :, :]
    
        kwargs = {'origin':'lower',
                  'interpolation':'nearest',
                  'extent':extent,
                  'norm': mcolors.PowerNorm(0.3)}
        
        ret = axes.imshow(data, aspect='auto', **kwargs)

        #Set current image (makes colorbar work)
        plt.sci(ret)
        return ret

In [403]:
iris = IRISRaster(file)
plt.figure(figsize=(20, 10))
iris.imshow(0, 0, worldcoord=False)
plt.colorbar()
plt.show()


---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-403-4bb757ed7b92> in <module>()
      2 plt.figure(figsize=(20, 10))
      3 iris.imshow(0, 0, worldcoord=False)
----> 4 plt.colorbar()
      5 plt.show()

/Users/schriste/anaconda/lib/python2.7/site-packages/matplotlib/pyplot.pyc in colorbar(mappable, cax, ax, **kw)
   2145         mappable = gci()
   2146         if mappable is None:
-> 2147             raise RuntimeError('No mappable was found to use for colorbar '
   2148                                'creation. First define a mappable such as '
   2149                                'an image (with imshow) or a contour set ('

RuntimeError: No mappable was found to use for colorbar creation. First define a mappable such as an image (with imshow) or a contour set (with contourf).

In [329]:
np.shape(iris._fits[1].data)


Out[329]:
(96, 1093, 2059)

In [357]:
iris.get_axis(0,0)


Out[357]:
<Quantity [ 1331.68   , 1331.69298, 1331.70596,...,  1358.36688,
            1358.37986, 1358.39284] Angstrom>

In [150]:
raster = pyfits.open(file)

In [220]:
raster[1].header


Out[220]:
XTENSION= 'IMAGE   '           / IMAGE extension                                
BITPIX  =                   16 / Number of bits per data pixel                  
NAXIS   =                    3 / Number of data axes                            
NAXIS1  =                 2059 /                                                
NAXIS2  =                 1093 /                                                
NAXIS3  =                   96 /                                                
PCOUNT  =                    0 / No Group Parameters                            
GCOUNT  =                    1 / One Data Group                                 
BSCALE  =                 0.25 /                                                
BZERO   =                 7992 /                                                
CDELT1  =            0.0129800 /                                                
CDELT2  =             0.166350 /                                                
CDELT3  =       0.349202074903 /                                                
CRPIX1  =              1.00000 /                                                
CRPIX2  =              547.000 /                                                
CRPIX3  =              48.0000 /                                                
CRVAL1  =              1331.68 /                                                
CRVAL2  =             -270.534 /                                                
CRVAL3  =              99.2920 /                                                
CTYPE1  = 'WAVE    '           /                                                
CTYPE2  = 'HPLT-TAN'           /                                                
CTYPE3  = 'HPLN-TAN'           /                                                
CUNIT1  = 'Angstrom'           /                                                
CUNIT2  = 'arcsec  '           /                                                
CUNIT3  = 'arcsec  '           /                                                

In [152]:
wcs = WCS(raster[0].header)
index = np.arange(raster[1].header['NAXIS1'])
wcs.all_pix2world(index, [0], [0], 0)


WARNING: VerifyWarning: Verification reported errors: [astropy.io.fits.verify]
WARNING:astropy:VerifyWarning: Verification reported errors:
WARNING: VerifyWarning: Card 'CADPL_DV' is not FITS standard (invalid value string: 'NAN /').  Fixed 'CADPL_DV' card to meet the FITS standard. [astropy.io.fits.verify]
WARNING:astropy:VerifyWarning: Card 'CADPL_DV' is not FITS standard (invalid value string: 'NAN /').  Fixed 'CADPL_DV' card to meet the FITS standard.
WARNING: VerifyWarning: Note: PyFITS uses zero-based indexing.
 [astropy.io.fits.verify]
WARNING:astropy:VerifyWarning: Note: PyFITS uses zero-based indexing.

WARNING: VerifyWarning: Card 'CADEX_DV' is not FITS standard (invalid value string: 'NAN /').  Fixed 'CADEX_DV' card to meet the FITS standard. [astropy.io.fits.verify]
WARNING:astropy:VerifyWarning: Card 'CADEX_DV' is not FITS standard (invalid value string: 'NAN /').  Fixed 'CADEX_DV' card to meet the FITS standard.
WARNING: FITSFixedWarning: The WCS transformation has more axes (3) than the image it is associated with (0) [astropy.wcs.wcs]
WARNING:astropy:FITSFixedWarning: The WCS transformation has more axes (3) than the image it is associated with (0)
Out[152]:
[array([  1.00000000e+00,   2.00000000e+00,   3.00000000e+00, ...,
          2.05700000e+03,   2.05800000e+03,   2.05900000e+03]),
 array([ 0.99993789,  0.99993789,  0.99993789, ...,  0.99993789,
         0.99993789,  0.99993789]),
 array([ 1.01127443,  1.01127443,  1.01127443, ...,  1.01127443,
         1.01127443,  1.01127443])]

In [47]:
np.shape(raster[1].data)


Out[47]:
(96, 1093, 2059)

In [48]:
wcs = WCS(raster[1].header)
index = [np.arange(raster[1].header['NAXIS1']), np.arange(raster[1].header['NAXIS2']), np.arange(raster[1].header['NAXIS3'])]
wcs.all_pix2world(index[0], index[1], index[2], 0)


---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-48-434c9576e55e> in <module>()
      1 wcs = WCS(raster[1].header)
      2 index = [np.arange(raster[1].header['NAXIS1']), np.arange(raster[1].header['NAXIS2']), np.arange(raster[1].header['NAXIS3'])]
----> 3 wcs.all_pix2world(index[0], index[1], index[2], 0)

/Users/schriste/anaconda/lib/python2.7/site-packages/astropy/wcs/wcs.pyc in all_pix2world(self, *args, **kwargs)
   1097     def all_pix2world(self, *args, **kwargs):
   1098         return self._array_converter(
-> 1099             self._all_pix2world, 'output', *args, **kwargs)
   1100     all_pix2world.__doc__ = """
   1101         Transforms pixel coordinates to world coordinates.

/Users/schriste/anaconda/lib/python2.7/site-packages/astropy/wcs/wcs.pyc in _array_converter(self, func, sky, *args, **kwargs)
   1086                     "a 1-D array for each axis, followed by an origin.")
   1087 
-> 1088             return _return_list_of_arrays(axes, origin)
   1089 
   1090         raise TypeError(

/Users/schriste/anaconda/lib/python2.7/site-packages/astropy/wcs/wcs.pyc in _return_list_of_arrays(axes, origin)
   1036             except ValueError:
   1037                 raise ValueError(
-> 1038                     "Coordinate arrays are not broadcastable to each other")
   1039 
   1040             xy = np.hstack([x.reshape((x.size, 1)) for x in axes])

ValueError: Coordinate arrays are not broadcastable to each other

Get the times of all of the exposures


In [166]:
raster[4].header


Out[166]:
XTENSION= 'IMAGE   '           / IMAGE extension                                
BITPIX  =                  -64 / Number of bits per data pixel                  
NAXIS   =                    2 / Number of data axes                            
NAXIS1  =                   23 /                                                
NAXIS2  =                   96 /                                                
PCOUNT  =                    0 / No Group Parameters                            
GCOUNT  =                    1 / One Data Group                                 
TIME    =                    0 /time of each exposure in s after start of OBS (r
PZTX    =                    1 /PZTX of each exposure in arcsec (rowindex)      
PZTY    =                    2 /PZTY of each exposure in arcsec (rowindex)      
EXPTIMEF=                    3 /FUV Exposure duration of each exposure in s (row
EXPTIMEN=                    4 /NUV Exposure duration of each exposure in s (row
SUMSPTRF=                    5 /FUV spectral summing (rowindex)                 
SUMSPATF=                    6 /FUV spatial summing (rowindex)                  
SUMSPTRN=                    7 /NUV spectral summing (rowindex)                 
SUMSPATN=                    8 /NUV spatial summing (rowindex)                  
DSRCFIX =                    9 /FUV data source level (rowindex)                
DSRCNIX =                   10 /NUV data source level (rowindex)                
LUTIDF  =                   11 /FUV LUT ID (rowindex)                           
LUTIDN  =                   12 /NUV LUT ID (rowindex)                           
XCENIX  =                   13 /XCEN (rowindex)                                 
YCENIX  =                   14 /YCEN (rowindex)                                 
OBS_VRIX=                   15 /Speed of observer in radial direction (rowindex)
OPHASEIX=                   16 /Orbital phase (rowindex)                        
PC1_1IX =                   17 /PC1_1 (rowindex)                                
PC1_2IX =                   18 /PC1_2 (rowindex)                                
PC2_1IX =                   19 /PC2_1 (rowindex)                                
PC2_2IX =                   20 /PC2_2 (rowindex)                                
PC3_1IX =                   21 /PC3_1 (rowindex)                                
PC3_2IX =                   22 /PC3_2 (rowindex)                                

In [170]:
header = raster[1].header
def get_axis(header):
    axis = header.get('CRVAL1') + np.arange(0, header.get('NAXIS1'), 1) * header.get('CDELT1')
    return axis

In [171]:
get_axis(header)


Out[171]:
array([ 1331.68   ,  1331.69298,  1331.70596, ...,  1358.36688,
        1358.37986,  1358.39284])

In [149]:
fits[0]


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-149-750cb68ea8ec> in <module>()
----> 1 fits[0]

NameError: name 'fits' is not defined

Not sure why this has twice the amount of exposures as expected


In [50]:
plt.imshow(raster[1].data[0,:,:])
plt.xlabel('Wavelength [pixels]')
plt.ylabel('Slit Position [pixels]')
title = raster[0].header.get('TDESC1') + ' ' + str(raster[0].header.get('TWMIN1')) + '-' + str(raster[0].header.get('TWMAX1')) + ' Ang'
title = title + ' ' + date_obs[0].strftime("%Y-%m-%d %H:%M:%S")
plt.title(title)


Out[50]:
<matplotlib.text.Text at 0x108bda250>

In [119]:
wav = get_axis(raster[1].header)
plt.plot(wavelength.to('Angstrom'), raster[1].data[0,310,:])
plt.ylabel('Intensity')
title = raster[0].header.get('TDESC1') + ' ' + str(raster[0].header.get('TWMIN1')) + '-' + str(raster[0].header.get('TWMAX1')) + ' Ang'
plt.title(title)
plt.ylim(0)


Out[119]:
(0, 700.0)

In [52]:
plt.imshow(raster[2].data[0,:,:])
plt.xlabel('Wavelength [pixels]')
plt.ylabel('Slit Position [pixels]')
title = raster[0].header.get('TDESC2') + ' ' + str(raster[0].header.get('TWMIN2')) + '-' + str(raster[0].header.get('TWMAX2')) + ' Ang'
plt.title(title)


Out[52]:
<matplotlib.text.Text at 0x108d29510>

In [53]:
wav = get_axis(raster[2].header)
plt.plot(wav, raster[2].data[0,1021,:])
plt.xlabel('Wavelength [Angstrom]')
plt.ylabel('Intensity')
title = raster[0].header.get('TDESC2') + ' ' + str(raster[0].header.get('TWMIN2')) + '-' + str(raster[0].header.get('TWMAX2')) + ' Ang'
plt.title(title)
plt.ylim(0)


Out[53]:
(0, 50.0)

In [54]:
plt.imshow(raster[3].data[0,:,:])
plt.xlabel('Wavelength [pixels]')
plt.ylabel('Slit Position [pixels]')
title = raster[0].header.get('TDESC3') + ' ' + str(raster[0].header.get('TWMIN3')) + '-' + str(raster[0].header.get('TWMAX3')) + ' Ang'
plt.title(title)


Out[54]:
<matplotlib.text.Text at 0x107be3050>

In [55]:
wav = get_axis(raster[3].header)
plt.plot(wav, raster[3].data[0,516,:])
plt.xlabel('Wavelength [Angstrom]')
plt.ylabel('Intensity')
title = raster[0].header.get('TDESC3') + ' ' + str(raster[0].header.get('TWMIN3')) + '-' + str(raster[0].header.get('TWMAX3')) + ' Ang'
plt.title(title)


Out[55]:
<matplotlib.text.Text at 0x10906aa90>

In [56]:
raster[4].header


Out[56]:
XTENSION= 'IMAGE   '           / IMAGE extension                                
BITPIX  =                  -64 / Number of bits per data pixel                  
NAXIS   =                    2 / Number of data axes                            
NAXIS1  =                   23 /                                                
NAXIS2  =                   96 /                                                
PCOUNT  =                    0 / No Group Parameters                            
GCOUNT  =                    1 / One Data Group                                 
TIME    =                    0 /time of each exposure in s after start of OBS (r
PZTX    =                    1 /PZTX of each exposure in arcsec (rowindex)      
PZTY    =                    2 /PZTY of each exposure in arcsec (rowindex)      
EXPTIMEF=                    3 /FUV Exposure duration of each exposure in s (row
EXPTIMEN=                    4 /NUV Exposure duration of each exposure in s (row
SUMSPTRF=                    5 /FUV spectral summing (rowindex)                 
SUMSPATF=                    6 /FUV spatial summing (rowindex)                  
SUMSPTRN=                    7 /NUV spectral summing (rowindex)                 
SUMSPATN=                    8 /NUV spatial summing (rowindex)                  
DSRCFIX =                    9 /FUV data source level (rowindex)                
DSRCNIX =                   10 /NUV data source level (rowindex)                
LUTIDF  =                   11 /FUV LUT ID (rowindex)                           
LUTIDN  =                   12 /NUV LUT ID (rowindex)                           
XCENIX  =                   13 /XCEN (rowindex)                                 
YCENIX  =                   14 /YCEN (rowindex)                                 
OBS_VRIX=                   15 /Speed of observer in radial direction (rowindex)
OPHASEIX=                   16 /Orbital phase (rowindex)                        
PC1_1IX =                   17 /PC1_1 (rowindex)                                
PC1_2IX =                   18 /PC1_2 (rowindex)                                
PC2_1IX =                   19 /PC2_1 (rowindex)                                
PC2_2IX =                   20 /PC2_2 (rowindex)                                
PC3_1IX =                   21 /PC3_1 (rowindex)                                
PC3_2IX =                   22 /PC3_2 (rowindex)                                

In [57]:
raster[5].header


Out[57]:
XTENSION= 'TABLE   '           / ASCII table extension                          
BITPIX  =                    8 / 8 bit bytes                                    
NAXIS   =                    2 / 2-dimensional ASCII table                      
NAXIS1  =                  170 /Number of positions along axis 1                
NAXIS2  =                   96 /Number of positions along axis 2                
PCOUNT  =                    0 / Size of special data area                      
GCOUNT  =                    1 / one data group (required keyword)              
TFIELDS =                    7 / Number of fields in each row                   
TBCOL1  =                    1 /                                                
TFORM1  = 'A10     '           /                                                
TTYPE1  = 'FRMID   '           /                                                
FRMID   =                    0 /FRM ID of each exposure (rowindex)              
LFRMID  =                   10 /Length of FRM ID (rows)                         
TBCOL2  =                   11 /                                                
TFORM2  = 'A10     '           /                                                
TTYPE2  = 'FUVFDBID'           /                                                
FDBIDF  =                   10 /FUV FDB ID of each exposure (rowindex)          
LFDBIDF =                   10 /Length of FUV FDB ID (rows)                     
TBCOL3  =                   21 /                                                
TFORM3  = 'A4      '           /                                                
TTYPE3  = 'FUVCRSID'           /                                                
CRSIDF  =                   20 /FUV CRS ID of each exposure (rowindex)          
LCRSIDF =                    4 /Length of FUV CRS ID (rows)                     
TBCOL4  =                   25 /                                                
TFORM4  = 'A10     '           /                                                
TTYPE4  = 'NUVFDBID'           /                                                
FDBIDN  =                   24 /NUV FDB ID of each exposure (rowindex)          
LFDBIDN =                   10 /Length of NUV FDB ID (rows)                     
TBCOL5  =                   35 /                                                
TFORM5  = 'A4      '           /                                                
TTYPE5  = 'NUVCRSID'           /                                                
CRSIDN  =                   34 /NUV CRS ID of each exposure (rowindex)          
LCRSIDN =                    4 /Length of NUV CRS ID (rows)                     
TBCOL6  =                   39 /                                                
TFORM6  = 'A66     '           /                                                
TTYPE6  = 'FUVfilename'        /                                                
FILEF   =                   38 /FUV Filename of each exposure (rowindex)        
LFILEF  =                   66 /Length of FUV Filename (rows)                   
TBCOL7  =                  105 /                                                
TFORM7  = 'A66     '           /                                                
TTYPE7  = 'NUVfilename'        /                                                
FILEN   =                  104 /NUV Filename of each exposure (rowindex)        
LFILEN  =                   66 /Length of NUV Filename (rows)                   

In [58]:
np.shape(raster[5].data)


Out[58]:
(96,)

In [ ]:


In [ ]: