Playing with NH Ralph MVIC TDI data

This is really just an exercise in figuring out this is not the data I want to try and make pretty pictures to spectral analysis with. It's useful to see the process for initially poking at FITS data, but a lot of work could have been avoided if I had RTFD here.


In [14]:
# our routine imports
import pyfits
import numpy as np
from matplotlib import pyplot as plt

In [3]:
# hooray for invoking shell comands
!ls data/20070131_003252/


mc0_0032528036_0x536_sci_1.fit	mc2_0032528036_0x536_sci_1.fit
mc0_0032528036_0x536_sci_1.lbl	mc2_0032528036_0x536_sci_1.lbl
mc1_0032528036_0x536_sci_1.fit	mc3_0032528036_0x536_sci_1.fit
mc1_0032528036_0x536_sci_1.lbl	mc3_0032528036_0x536_sci_1.lbl

In [8]:
# long, narrow swaths -- this matches 
fits_file = 'data/20070131_003252/mc0_0032528036_0x536_sci_1.fit'
pyfits.info(fits_file)


Filename: data/20070131_003252/mc0_0032528036_0x536_sci_1.fit
No.    Name         Type      Cards   Dimensions   Format
0    PRIMARY     PrimaryHDU     294   (5024, 57)   float32   
1                ImageHDU         7   (5024, 57)   float64   
2                ImageHDU         8   (5024, 57)   float32   
3                ImageHDU        15   (5024, 57)   int16   

In [ ]:
# From info below and http://new-pds-rings-2.seti.org/newhorizons/SOC_INST_ICD.PDF we can
# see that this is really a time delay integrat mode capture. Not going to be fun, spectrally.

In [10]:
hdr = pyfits.getheader(fits_file)
hdr


Out[10]:
SIMPLE  =                    T / Written by IDL:  Wed Aug 27 09:59:15 2008      
BITPIX  =                  -32 / IEEE single precision floating point           
NAXIS   =                    2 / number of array dimensions                     
NAXIS1  =                 5024                                                  
NAXIS2  =                   57                                                  
EXTEND  =                    T                                                  
BZERO   =                    0 / no offset                                      
BSCALE  =                    1 / default scaling factor                         
MISSION = 'New Horizons'       / Mission name                                   
HOSTNAME= 'NEW HORIZONS'       / Host name (PDS terminology)                    
HOSTID  = 'NH      '           / Host ID (PDS terminology)                      
INSTRU  = 'mvi     '           / Instrument                                     
APID    = '0x536   '           / Application ID of science data                 
MET     =             32528036 / First packet MET (from instrument or HS bus)   
METEND  =             32528050 / Last packet MET (from instrument or HS bus)    
MET_HK  =             32528022 / MET from housekeeping used in header           
HSCOMPR = 'LOSSLESS'           / High-speed compression mode                    
OBSCOMPL= 'COMPLETE'           / Observation completion status                  
MISSPACK=                    0 / Missing CCSDS packets (-1 = N/A)               
STARTMET=         32528028.132 / Actual start time (in MET seconds)             
STOPMET =           32528050.0 / Actual stop time (in MET seconds)              
DURMET  =    21.86800000071526 / Observation duration (in MET seconds)          
METSRC  = 'HK_Info '           / Source of above three times                    
EXPTIME =                  8.0 / Exposure time                                  
ARCHDATE= '2007/031'           / Date of MOC archive file                       
GRT     =     17927.7184734551 / Ground receipt time from STP                   
DATE    = '2008-08-23T00:37:07' / Time file was created by SOC                  
SOCVER  =                  1.0 / SOC pipeline software version                  
SOCLOC  = 'TSOC    '           / SOC location where processed (TSOC or CSOC)    
REQID   = '---     '           / Request ID                                     
TARGET  = 'EARTH   '           / Target object                                  
TARGTYPE= 'Not defined'        / Target object type                             
CB1LOAD = 'JUPITER '           / Central Body 1 loaded                          
CB2LOAD = 'JUPITER '           / Central Body 2 loaded                          
CB3LOAD = 'JUPITER '           / Central Body 3 loaded                          
REQDESC = '---     '           / Sequence description / notes                   
REQCOMM = '---     '           / Sequence Comments                              
SPCSEP  = '***GEOMETRY SECTION*************************************'            
SPCQUAL = 'RECONSTRUCTED'      / QUALITY:  PREDICT (poor); RECONSTRUCTED        
SPCSTAT = 'OK      '           / SPICE status [OK or INCOMPLETE ...]            
SPCINST0= 'NH_RALPH_MVIC_RED'  / Starting SPICE Instrument or FRAME             
SPCINSTR= 'NH_RALPH_MVIC_RED'  / Final SPICE Instrument or FRAME                
SPCMET0 =         32528028.132 / RAW MET timestamp                              
SPCMETDL=    10.93400000035763 / [s] delta, (Mid-obs time) - (RAW MET)          
SPCCBTNM= 'EARTH   '           / [text] Target input name                       
SPCCB1NM= 'JUPITER '           / [text] CB1 input name                          
SPCCB2NM= 'JUPITER '           / [text] CB2 input name                          
SPCCB3NM= 'JUPITER '           / [text] CB3 input name                          
SPCCBTID=                  399 / [SPICE ID] Target                              
SPCCB1ID=                  599 / [SPICE ID] CB1                                 
SPCCB2ID=                  599 / [SPICE ID] CB2                                 
SPCCB3ID=                  599 / [SPICE ID] CB3                                 
SPCSCLK0= '1/0032528028:06600' / Spacecraft CLocK timestamp                     
SPCINSID=               -98206 / [SPICE ID] Instrument                          
SPCSCID =                  -98 / [SPICE ID] Spacecraft                          
SPCSCNAM= 'NH_SPACECRAFT'      / [SPICE Name] Spacecraft                        
SPCSCET =    223494186.6353685 / [s past J2000] Spacecraft mid-obs time, TDB    
SPCSCLK = '1/0032528039:03300' / Mid-obs Spacecraft CLocK                       
SPCSCDP =      1626401953300.0 / [SCLK milli-ticks] Spacecraft mid-obs time     
SPCUTCID= '2007-031T05:42:01.451' / [ISO DOY] Spacecraft mid-obs time, UTC      
SPCUTCAL= '2007-01-31T05:42:01.451' / [Cal d] Spacecraft mid-obs time, UTC      
SPCUTCJD= 'JD 2454131.7375168' / [Julian d] Spacecraft mid-obs time, UTC        
SPCPSEP = '******INSTRUMENT POINTING*******************************'            
SPCBRRA =    231.0687965094614 / [degrees] Boresight RA, EME J2000              
SPCBRDEC=    -23.0334747733602 / [degrees] Boresight DEC, EME J2000             
SPCEMEN =    289.1791277248273 / [degrees] EME J2k North Clk Angle, CW from UP  
SPCPAXIN=               -999.0 / [degrees] Instr +X Pos ang, E from EMEJ2k N    
SPCPAYIN=    289.1791277248273 / [degrees] Instr +Y Pos ang, E from EMEJ2k N    
SPCPAZIN=     19.1791277248273 / [degrees] Instr +Z Pos ang, E from EMEJ2k N    
SPCQA   =   0.8574677856562172 / cos(theta/2)     - Quaternion to transform     
SPCQX   =   0.2321503203618095 / sin(theta/2) * X -   instrument vectors        
SPCQY   =  -0.1072729330904568 / sin(theta/2) * Y -   to EME J2000 vectors      
SPCQZ   =     0.44648375462485 / sin(theta/2) * Z -   ***N.B. SPICE FORMAT      
SPCTSEP0= '******Target:  Target->S/C****************************'              
SPCTCB  = 'EARTH   '           / [SPICE name] Target name                       
SPCTSCX =   -217587062.2217285 / [km] S/C vec wrt Target, X, EMEJ2000           
SPCTSCY =   -737432076.0635854 / [km] S/C vec wrt Target, Y                     
SPCTSCZ =   -309513701.4856545 / [km] S/C vec wrt Target, Z                     
SPCTSCVX=    23.20784432214216 / [km/s] S/C vel vec wrt Target, X               
SPCTSCVY= -0.06681342505378041 / [km/s] S/C vel vec wrt Target, Y               
SPCTSCVZ=    0.130853872659074 / [km/s] S/C vel vec wrt Target, Z               
SPCTRANG=     828823821.967662 / [km] S/C range to Target center                
SPCTTGJD= 'JD 2454131.7055184' / [Julian d] Time at Target, UTC                 
SPCTSEP1= '******Target:  Target->Sun****************************'              
SPCTSOX =    96348757.15629457 / [km] Sun vec wrt Target, X, EMEJ2000           
SPCTSOY =   -102316768.1008205 / [km] Sun vec wrt Target, Y                     
SPCTSOZ =   -44357550.47467447 / [km] Sun vec wrt Target, Z                     
SPCTSOVX=    23.01240565680865 / [km/s] Sun vel vec wrt Target, X               
SPCTSOVY=    17.96958773900277 / [km/s] Sun vel vec wrt Target, Y               
SPCTSOVZ=    7.789831038970995 / [km/s] Sun vel vec wrt Target, Z               
SPCTSORN=    147375019.3359546 / [km] Sun range to Target center                
SPCTSEP2= '******Target:  Target->EarthObserver****************************'    
SPCTEOX =                  0.0 / [km] Earth observer vec wrt Target, X, EMEJ2000
SPCTEOY =                  0.0 / [km] Earth obs vec wrt Target, Y               
SPCTEOZ =                  0.0 / [km] Earth obs vec wrt Target, Z               
SPCTEOVX=                  0.0 / [km/s] Earth obs vel vec wrt Target, X         
SPCTEOVY=                  0.0 / [km/s] Earth obs vel vec wrt Target, Y         
SPCTEOVZ=                  0.0 / [km/s] Earth obs vel vec wrt Target, Z         
SPCTEORN=                  0.0 / [km] Earth observer range to Target center     
SPCTEOJD= 'JD 2454131.7055184' / [Julian d] Time at Earth observer              
SPCTSEPB= '******Target:  Body-fixed info****************************'          
SPCTSCLA=   -21.93888755977119 / [degrees] planetocentric Sub-S/C latitude      
SPCTSCLO=    49.69766138388881 / [degrees] planetocentric Sub-S/C EAST longitude
SPCTSOLA=   -17.48965728921794 / [degrees] planetocentric Sub-Solar latitude    
SPCTSOLO=    109.4100423162674 / [degrees] planetocentric Sub-Solar EAST long.  
SPCTNAZ =    289.1457562259169 / [degrees] Target North Azimuth, CW from UP     
SPC1SEP0= '******CB1:  CB1->S/C****************************'                    
SPC1CB  = 'JUPITER '           / [SPICE name] CB1 name                          
SPC1SCX =    26068505.38108211 / [km] S/C vec wrt CB1, X, EMEJ2000              
SPC1SCY =    34900363.88204587 / [km] S/C vec wrt CB1, Y                        
SPC1SCZ =     13754908.2215555 / [km] S/C vec wrt CB1, Z                        
SPC1SCVX=   -11.48599904632037 / [km/s] S/C vel vec wrt CB1, X                  
SPC1SCVY=   -13.60564937243695 / [km/s] S/C vel vec wrt CB1, Y                  
SPC1SCVZ=   -5.475454043520174 / [km/s] S/C vel vec wrt CB1, Z                  
SPC1RANG=    45681504.70470662 / [km] S/C range to CB1 center                   
SPC1TGJD= 'JD 2454131.7357532' / [Julian d] Time at CB1, UTC                    
SPC1SEP1= '******CB1:  CB1->Sun****************************'                    
SPC1SOX =    340033431.8300006 / [km] Sun vec wrt CB1, X, EMEJ2000              
SPC1SOY =    670014243.5278945 / [km] Sun vec wrt CB1, Y                        
SPC1SOZ =    278909904.9467361 / [km] Sun vec wrt CB1, Z                        
SPC1SOVX=   -11.68143866041252 / [km/s] Sun vel vec wrt CB1, X                  
SPC1SOVY=    4.430752702582324 / [km/s] Sun vel vec wrt CB1, Y                  
SPC1SOVZ=     2.18352351751698 / [km/s] Sun vel vec wrt CB1, Z                  
SPC1SORN=    801456521.8212038 / [km] Sun range to CB1 center                   
SPC1SEP2= '******CB1:  CB1->EarthObserver****************************'          
SPC1EOX =    243480620.8928861 / [km] Earth observer vec wrt CB1, X, EMEJ2000   
SPC1EOY =    772244879.9480498 / [km] Earth obs vec wrt CB1, Y                  
SPC1EOZ =    323231621.5743266 / [km] Earth obs vec wrt CB1, Z                  
SPC1EOVX=    -34.6718273933129 / [km/s] Earth obs vel vec wrt CB1, X            
SPC1EOVY=   -13.56208937236674 / [km/s] Earth obs vel vec wrt CB1, Y            
SPC1EOVZ=   -5.616373687575992 / [km/s] Earth obs vel vec wrt CB1, Z            
SPC1EORN=     871850703.126362 / [km] Earth observer range to CB1 center        
SPC1EOJD= 'JD 2454131.7694127' / [Julian d] Time at Earth observer              
SPC1SEPB= '******CB1:  Body-fixed info****************************'             
SPC1SCLA=   -3.752675717236304 / [degrees] planetocentric Sub-S/C latitude      
SPC1SCLO=    83.07865945751736 / [degrees] planetocentric Sub-S/C EAST longitude
SPC1SOLA=   -2.978868839905485 / [degrees] planetocentric Sub-Solar latitude    
SPC1SOLO=    92.80215425656682 / [degrees] planetocentric Sub-Solar EAST long.  
SPC1NAZ =    274.1543294167755 / [degrees] CB1 North Azimuth, CW from UP        
SPC2SEP0= '******CB2:  CB2->S/C****************************'                    
SPC2CB  = 'JUPITER '           / [SPICE name] CB2 name                          
SPC2SCX =    26068505.38108211 / [km] S/C vec wrt CB2, X, EMEJ2000              
SPC2SCY =    34900363.88204587 / [km] S/C vec wrt CB2, Y                        
SPC2SCZ =     13754908.2215555 / [km] S/C vec wrt CB2, Z                        
SPC2SCVX=   -11.48599904632037 / [km/s] S/C vel vec wrt CB2, X                  
SPC2SCVY=   -13.60564937243695 / [km/s] S/C vel vec wrt CB2, Y                  
SPC2SCVZ=   -5.475454043520174 / [km/s] S/C vel vec wrt CB2, Z                  
SPC2RANG=    45681504.70470662 / [km] S/C range to CB2 center                   
SPC2TGJD= 'JD 2454131.7357532' / [Julian d] Time at CB2, UTC                    
SPC2SEP1= '******CB2:  CB2->Sun****************************'                    
SPC2SOX =    340033431.8300006 / [km] Sun vec wrt CB2, X, EMEJ2000              
SPC2SOY =    670014243.5278945 / [km] Sun vec wrt CB2, Y                        
SPC2SOZ =    278909904.9467361 / [km] Sun vec wrt CB2, Z                        
SPC2SOVX=   -11.68143866041252 / [km/s] Sun vel vec wrt CB2, X                  
SPC2SOVY=    4.430752702582324 / [km/s] Sun vel vec wrt CB2, Y                  
SPC2SOVZ=     2.18352351751698 / [km/s] Sun vel vec wrt CB2, Z                  
SPC2SORN=    801456521.8212038 / [km] Sun range to CB2 center                   
SPC2SEP2= '******CB2:  CB2->EarthObserver****************************'          
SPC2EOX =    243480620.8928861 / [km] Earth observer vec wrt CB2, X, EMEJ2000   
SPC2EOY =    772244879.9480498 / [km] Earth obs vec wrt CB2, Y                  
SPC2EOZ =    323231621.5743266 / [km] Earth obs vec wrt CB2, Z                  
SPC2EOVX=    -34.6718273933129 / [km/s] Earth obs vel vec wrt CB2, X            
SPC2EOVY=   -13.56208937236674 / [km/s] Earth obs vel vec wrt CB2, Y            
SPC2EOVZ=   -5.616373687575992 / [km/s] Earth obs vel vec wrt CB2, Z            
SPC2EORN=     871850703.126362 / [km] Earth observer range to CB2 center        
SPC2EOJD= 'JD 2454131.7694127' / [Julian d] Time at Earth observer              
SPC2SEPB= '******CB2:  Body-fixed info****************************'             
SPC2SCLA=   -3.752675717236304 / [degrees] planetocentric Sub-S/C latitude      
SPC2SCLO=    83.07865945751736 / [degrees] planetocentric Sub-S/C EAST longitude
SPC2SOLA=   -2.978868839905485 / [degrees] planetocentric Sub-Solar latitude    
SPC2SOLO=    92.80215425656682 / [degrees] planetocentric Sub-Solar EAST long.  
SPC2NAZ =    274.1543294167755 / [degrees] CB2 North Azimuth, CW from UP        
SPC3SEP0= '******CB3:  CB3->S/C****************************'                    
SPC3CB  = 'JUPITER '           / [SPICE name] CB3 name                          
SPC3SCX =    26068505.38108211 / [km] S/C vec wrt CB3, X, EMEJ2000              
SPC3SCY =    34900363.88204587 / [km] S/C vec wrt CB3, Y                        
SPC3SCZ =     13754908.2215555 / [km] S/C vec wrt CB3, Z                        
SPC3SCVX=   -11.48599904632037 / [km/s] S/C vel vec wrt CB3, X                  
SPC3SCVY=   -13.60564937243695 / [km/s] S/C vel vec wrt CB3, Y                  
SPC3SCVZ=   -5.475454043520174 / [km/s] S/C vel vec wrt CB3, Z                  
SPC3RANG=    45681504.70470662 / [km] S/C range to CB3 center                   
SPC3TGJD= 'JD 2454131.7357532' / [Julian d] Time at CB3, UTC                    
SPC3SEP1= '******CB3:  CB3->Sun****************************'                    
SPC3SOX =    340033431.8300006 / [km] Sun vec wrt CB3, X, EMEJ2000              
SPC3SOY =    670014243.5278945 / [km] Sun vec wrt CB3, Y                        
SPC3SOZ =    278909904.9467361 / [km] Sun vec wrt CB3, Z                        
SPC3SOVX=   -11.68143866041252 / [km/s] Sun vel vec wrt CB3, X                  
SPC3SOVY=    4.430752702582324 / [km/s] Sun vel vec wrt CB3, Y                  
SPC3SOVZ=     2.18352351751698 / [km/s] Sun vel vec wrt CB3, Z                  
SPC3SORN=    801456521.8212038 / [km] Sun range to CB3 center                   
SPC3SEP2= '******CB3:  CB3->EarthObserver****************************'          
SPC3EOX =    243480620.8928861 / [km] Earth observer vec wrt CB3, X, EMEJ2000   
SPC3EOY =    772244879.9480498 / [km] Earth obs vec wrt CB3, Y                  
SPC3EOZ =    323231621.5743266 / [km] Earth obs vec wrt CB3, Z                  
SPC3EOVX=    -34.6718273933129 / [km/s] Earth obs vel vec wrt CB3, X            
SPC3EOVY=   -13.56208937236674 / [km/s] Earth obs vel vec wrt CB3, Y            
SPC3EOVZ=   -5.616373687575992 / [km/s] Earth obs vel vec wrt CB3, Z            
SPC3EORN=     871850703.126362 / [km] Earth observer range to CB3 center        
SPC3EOJD= 'JD 2454131.7694127' / [Julian d] Time at Earth observer              
SPC3SEPB= '******CB3:  Body-fixed info****************************'             
SPC3SCLA=   -3.752675717236304 / [degrees] planetocentric Sub-S/C latitude      
SPC3SCLO=    83.07865945751736 / [degrees] planetocentric Sub-S/C EAST longitude
SPC3SOLA=   -2.978868839905485 / [degrees] planetocentric Sub-Solar latitude    
SPC3SOLO=    92.80215425656682 / [degrees] planetocentric Sub-Solar EAST long.  
SPC3NAZ =    274.1543294167755 / [degrees] CB3 North Azimuth, CW from UP        
SPCSEPS = '******S/C->SUN****************************************'              
SPCSSCX =      313932862.32259 / [km] Sun vec wrt S/C observer, X, EMEJ2000     
SPCSSCY =    635127702.0038093 / [km] Sun vec wrt S/C obs, Y                    
SPCSSCZ =    265161720.8043077 / [km] Sun vec wrt S/C obs, Z                    
SPCSSCVX=  -0.1954396369588761 / [km/s] Sun obs vel vec wrt S/C obs, X          
SPCSSCVY=    18.03640203368642 / [km/s] Sun vel vec wrt S/C obs, Y              
SPCSSCVZ=    7.658977543426568 / [km/s] Sun vel vec wrt S/C obs, Z              
SPCSSCRN=    756473250.0747106 / [km] S/C observer range to sun center          
SPCSSCJD= 'JD 2454131.7083117' / [Julian d] Time at Sun                         
SPCSEPE = '******EARTH->S/C****************************************'            
SPCESCX =   -217572865.6626725 / [km] S/C observer vec wrt earth, X, EMEJ2000   
SPCESCY =   -737435550.0238118 / [km] S/C obs vec wrt earth, Y                  
SPCESCZ =    -309515404.381581 / [km] S/C obs vec wrt earth, Z                  
SPCESCVX=    23.20784432214216 / [km/s] S/C obs vel vec wrt earth, X            
SPCESCVY= -0.06681342505378041 / [km/s] S/C obs vel vec wrt earth, Y            
SPCESCVZ=    0.130853872659074 / [km/s] S/C obs vel vec wrt earth, Z            
SPCESCRN=    828823821.9676621 / [km] S/C observer range to earth center        
SPCESCJD= 'JD 2454131.7055184' / [Julian d] Time at Earth                       
SPCKSEP = '******SPICE KERNELS*************************************'            
SPCKNUM =                   26 / COUNT OF LOADED SPICE KERNELS:                 
SPCK0001= 'naif0008.tls'       / SPICE kernel 0001                              
SPCK0002= 'new-horizons_371.tsc' / SPICE kernel 0002                            
SPCK0003= 'pck00008.tpc'       / SPICE kernel 0003                              
SPCK0004= 'nh_v200.tf'         / SPICE kernel 0004                              
SPCK0005= 'nh_allinstruments_v001.ti' / SPICE kernel 0005                       
SPCK0006= 'nh_alice_v110.ti'   / SPICE kernel 0006                              
SPCK0007= 'nh_lorri_v100.ti'   / SPICE kernel 0007                              
SPCK0008= 'nh_pepssi_v110.ti'  / SPICE kernel 0008                              
SPCK0009= 'nh_ralph_v100.ti'   / SPICE kernel 0009                              
SPCK0010= 'nh_rex_v100.ti'     / SPICE kernel 0010                              
SPCK0011= 'nh_sdc_v101.ti'     / SPICE kernel 0011                              
SPCK0012= 'nh_swap_v100.ti'    / SPICE kernel 0012                              
SPCK0013= 'nh_soc_misc_v001.tf' / SPICE kernel 0013                             
SPCK0014= 'sb-2002jf56-2.bsp'  / SPICE kernel 0014                              
SPCK0015= 'jup260.bsp'         / SPICE kernel 0015                              
SPCK0016= 'plu013.bsp'         / SPICE kernel 0016                              
SPCK0017= 'nh_nep_ura_000.bsp' / SPICE kernel 0017                              
SPCK0018= 'de413.bsp'          / SPICE kernel 0018                              
SPCK0019= 'nh_recon_e2j_v1.bsp' / SPICE kernel 0019                             
SPCK0020= 'nh_recon_j2sep07_prelimv1.bsp' / SPICE kernel 0020                   
SPCK0021= 'merged_nhpc_2006_v011.bc' / SPICE kernel 0021                        
SPCK0022= 'merged_nhpc_2007_v006.bc' / SPICE kernel 0022                        
SPCK0023= 'merged_nhpc_2008_01_v007.bc' / SPICE kernel 0023                     
SPCK0024= 'merged_nhpc_2008_02_v003.bc' / SPICE kernel 0024                     
SPCK0025= 'merged_nhpc_2008_05_v007.bc' / SPICE kernel 0025                     
SPCK0026= 'merged_nhpc_2008_06_v001.bc' / SPICE kernel 0026                     
PACMMNT0= '*** Position angles (PAs):  XYZ axes, degrees east of EMEJ2k North'  
PACMMNT1= '***   on plane perpendicular to boresight; -999 => Boresight'        
PA_XINST=               -999.0 / [degrees] PA +X, East of EMEJ2k North          
PA_YINST=    289.1791277248273 / [degrees] PA +Y, East of EMEJ2k North          
PA_ZINST=     19.1791277248273 / [degrees] PA +Z, East of EMEJ2k North          
HIGHSSEP= '********************************************************'            
WINDOWX =                    0 / X origin of window                             
WINDOWY =                    0 / Y origin of window                             
WINDOWW =                 5024 / Window width                                   
WINDOWH =                   57 / Window height                                  
CPLANE  =                    0 / Color/plane number                             
RALPHSEP= '********************************************************'            
MET510  =             32528022 / MET of 0x510 packet marking acq start          
TRUE510 = 'YES     '           / Is the 0x510 real or assumed from a gap?       
RALPHEXP=                  8.0 / RALPH exposure time (s)                        
INSTSSEP= '********************************************************'            
MODE    =                    2 / Instrument mode                                
SIDE    =                    1 / Instrument HW side                             
DETECTOR= 'RED     '           / CCD detector used                              
FILTER  = 'RED     '           / CCD filter color                               
SCANTYPE= 'TDI     '           / Type of scan done                              
SOCL2VER= '1.0     '           /Version of Level 2 software                     
PIXSIZE =              13.0000 /Pixel size in microns                           
READNOI =              30.0000 /Readnoise in Electrons                          
GAIN    =              58.6000 /Gain in Electrons/DN                            
PIXFOV  =              19.8065 /Plate scale in microrad/pix                     
CALDIR  = 'cal/    '           /Directory for calibration files                 
PSOLAR  = '2.17E-11'           /(erg/cm^2/s)/(DN/s), Solar spectrum             
PJUPITER= '2.13E-11'           /(erg/cm^2/s)/(DN/s), Jupiter spectrum           
PPHOLUS = '2.21E-11'           /(erg/cm^2/s)/(DN/s), Pholus spectrum            
PPLUTO  = '2.17E-11'           /(erg/cm^2/s)/(DN/s), Pluto spectrum             
PCHARON = '2.17E-11'           /(erg/cm^2/s)/(DN/s), Charon spectrum            
RSOLAR  = '0.0555  '           /(erg/cm^2/s/sr)/(DN/s/pix), Solar spectrum      
RJUPITER= '0.0544  '           /(erg/cm^2/s/sr)/(DN/s/pix), Jupiter spectrum    
RPHOLUS = '0.0562  '           /(erg/cm^2/s/sr)/(DN/s/pix), Pholus spectrum     
RPLUTO  = '0.0553  '           /(erg/cm^2/s/sr)/(DN/s/pix), Pluto spectrum      
RCHARON = '0.0554  '           /(erg/cm^2/s/sr)/(DN/s/pix), Charon spectrum     
WSOLAR  = '6.12E-5 '           /Pivot Wavelength (cm), Solar spectrum           
WJUPITER= '6.12E-5 '           /Pivot Wavelength (cm), Jupiter spectrum         
WPHOLUS = '6.20E-5 '           /Pivot Wavelength (cm), Pholus spectrum          
WPLUTO  = '6.14E-5 '           /Pivot Wavelength (cm), Pluto spectrum           
WCHARON = '6.12E-5 '           /Pivot Wavelength (cm), Charon spectrum          
TDIRATE =              4.00000 /TDI RATE (Hz)                                   

In [25]:
data = pyfits.getdata(fits_file, 0)
np.shape(data)


Out[25]:
(57, 5024)

In [29]:
%matplotlib inline
plt.figure(figsize=(9,9))
plt.hist(np.ravel(data))
plt.show()



In [26]:
plt.figure(figsize=(9,9))
plt.imshow(data[20:,:200], cmap='bone', clim=(0,160))
plt.show()



In [27]:
test = pyfits.getdata(fits_file, 1)
np.shape(test)


Out[27]:
(57, 5024)

In [35]:
plt.hist(np.ravel(test), bins=np.arange(0.0, 0.001, 0.0001))
plt.show()
x = np.unique(np.ravel(test))
len(x)


Out[35]:
1

In [38]:
x # ok, theis img is


Out[38]:
array([ 0.])

In [58]:
data2, hdr2 = pyfits.getdata(fits_file, 2, header=True)
hdr2


Out[58]:
XTENSION= 'IMAGE   '           / IMAGE extension                                
BITPIX  =                  -32 / Number of bits per data pixel                  
NAXIS   =                    2 / Number of data axes                            
NAXIS1  =                 5024 /                                                
NAXIS2  =                   57 /                                                
COMMENT  1-sigma error per pixel for the image in extension 1.                  
COMMENT  Units are in DN.                                                       
COMMENT  See the SOC Instrument ICD for more details.                           

In [40]:
np.shape(data2)


Out[40]:
(57, 5024)

In [46]:
plt.figure(figsize=(9,9))
plt.imshow(data2[:,:100], cmap='bone')
plt.show()



In [49]:
plt.hist(np.ravel(data2), bins=np.arange(0.0, 1.0, 0.001))
plt.show()



In [51]:
plt.hist(np.ravel(data2), bins=np.arange(0.9, 1.0, 0.005))
plt.show()



In [53]:
plt.imshow(data2[:,:100], cmap='bone', clim=(0.93, 0.96))


Out[53]:
<matplotlib.image.AxesImage at 0x10d72ff90>

In [56]:
img, hdr = pyfits.getdata(fits_file, 2, header=True)

In [57]:
hdr


Out[57]:
XTENSION= 'IMAGE   '           / IMAGE extension                                
BITPIX  =                  -32 / Number of bits per data pixel                  
NAXIS   =                    2 / Number of data axes                            
NAXIS1  =                 5024 /                                                
NAXIS2  =                   57 /                                                
COMMENT  1-sigma error per pixel for the image in extension 1.                  
COMMENT  Units are in DN.                                                       
COMMENT  See the SOC Instrument ICD for more details.