import pyfits
#from numarray import * ## Changed to numpy Aug 2007
from numpy import *
from ez_fits_to_ascii import *

infile_list = [('NewSumPoisDatonPaddedIntTime22.0.060604.fits','NewSumPoisDatonPaddedIntTime22.0.060604.txt'),
('NewSumPoisDatonPaddedIntTime242.0.060604.fits','NewSumPoisDatonPaddedIntTime242.0.060604.txt'),
('NewSumPoisDatonPaddedIntTime7.0.060604.fits','NewSumPoisDatonPaddedIntTime7.0.060604.txt'),
('NewSumPoisDatonPaddedIntTime73.0.060604.fits','NewSumPoisDatonPaddedIntTime73.0.060604.txt'),
('NewSumPoisDatonPaddedIntTime806.0.060604.fits','NewSumPoisDatonPaddedIntTime806.0.060604.txt')]
infile_list = [
('ModelData8by8IntTime7.0.060529.fits','ModelData8by8IntTime7.0.060529.txt'),
('ModelData8by8IntTime22.0.060529.fits', 'ModelData8by8IntTime22.0.060529.txt'),
('ModelData8by8IntTime73.0.060529.fits', 'ModelData8by8IntTime73.0.060529.txt'),
('ModelData8by8IntTime242.0.060529.fits', 'ModelData8by8IntTime242.0.060529.txt'),
('ModelData8by8IntTime806.0.060529.fits', 'ModelData8by8IntTime806.0.060529.txt')
]

infile_list = [
('NewCompData8by8IntTime22.0.060604.fits', 'NewCompData8by8IntTime22.0.060604.txt'),
('NewCompData8by8IntTime242.0.060604.fits', 'NewCompData8by8IntTime242.0.060604.txt'),
('NewCompData8by8IntTime7.0.060604.fits', 'NewCompData8by8IntTime7.0.060604.txt'),
('NewCompData8by8IntTime73.0.060604.fits', 'NewCompData8by8IntTime73.0.060604.txt'),
('NewCompData8by8IntTime806.0.060604.fits', 'NewCompData8by8IntTime806.0.060604.txt'),
('NewCompPoisDaton8by8IntTime22.0.060604.fits', 'NewCompPoisDaton8by8IntTime22.0.060604.txt'),
('NewCompPoisDaton8by8IntTime242.0.060604.fits', 'NewCompPoisDaton8by8IntTime242.0.060604.txt'),
('NewCompPoisDaton8by8IntTime7.0.060604.fits', 'NewCompPoisDaton8by8IntTime7.0.060604.txt'),
('NewCompPoisDaton8by8IntTime73.0.060604.fits', 'NewCompPoisDaton8by8IntTime73.0.060604.txt'),
('NewCompPoisDaton8by8IntTime806.0.060604.fits', 'NewCompPoisDaton8by8IntTime806.0.060604.txt'),
('NewSumPoisDaton8by8IntTime22.0.060604.fits', 'NewSumPoisDaton8by8IntTime22.0.060604.txt'),
('NewSumPoisDaton8by8IntTime242.0.060604.fits', 'NewSumPoisDaton8by8IntTime242.0.060604.txt'),
('NewSumPoisDaton8by8IntTime7.0.060604.fits', 'NewSumPoisDaton8by8IntTime7.0.060604.txt'),
('NewSumPoisDaton8by8IntTime73.0.060604.fits', 'NewSumPoisDaton8by8IntTime73.0.060604.txt'),
('NewSumPoisDaton8by8IntTime806.0.060604.fits', 'NewSumPoisDaton8by8IntTime806.0.060604.txt'),
('PoisDaton8by8IntTime22.0.060604.fits', 'PoisDaton8by8IntTime22.0.060604.txt'),
('PoisDaton8by8IntTime242.0.060604.fits', 'PoisDaton8by8IntTime242.0.060604.txt'),
('PoisDaton8by8IntTime7.0.060604.fits', 'PoisDaton8by8IntTime7.0.060604.txt'),
('PoisDaton8by8IntTime73.0.060604.fits', 'PoisDaton8by8IntTime73.0.060604.txt'),
('PoisDaton8by8IntTime806.0.060604.fits', 'PoisDaton8by8IntTime806.0.060604.txt'),
]
infile_list = [('counts_g1-9_g004gt1GeVpadded.fits', 'counts_g1-9_g004gt1GeVpadded.txt'),
                      ('counts_g1-9_g004gt1GeV8by8.fits', 'counts_g1-9_g004gt1GeV8by8.txt')]

infile_list = [
('ModelFluxPaddedICPion1-1000GeV.060529.fits','ModelFluxPaddedICPion1-1000GeV.060529.txt')
]

infile_list = [
('ModelFluxPaddedBremICPion1-1000GeV.060529.fits', 'ModelFluxPaddedBremICPion1-1000GeV.060529.txt')]

infile_list =[
('ExposrTimPaddedIntTime806.0.060529.fits', 'ExposrTimPaddedIntTime806.0.060529.txt')]


infile_list = [
('ModelFluxPadRS8BremICPion1-1000GeV.060529.fits', 'ModelFluxPadRS8BremICPion1-1000GeV.060529.txt'),
('ExposrTimPadRS8IntTime539.0.060529.fits', 'ExposrTimPadRS8IntTime539.0.060529.txt'),
('ModelDataPaddedIntTime539.0.060529.fits', 'ModelDataPaddedIntTime539.0.060529.txt')
]


infile_list = [
('ExposrTim64x64RS8IntTime22.0.060529.fits', 'ExposrTim64x64RS8IntTime22.0.060529.txt'),
('ExposrTim64x64RS8IntTime242.0.060529.fits', 'ExposrTim64x64RS8IntTime242.0.060529.txt'),
('ExposrTim64x64RS8IntTime7.0.060529.fits', 'ExposrTim64x64RS8IntTime7.0.060529.txt'),
('ExposrTim64x64RS8IntTime73.0.060529.fits', 'ExposrTim64x64RS8IntTime73.0.060529.txt'),
('ExposrTim64x64RS8IntTime806.0.060529.fits', 'ExposrTim64x64RS8IntTime806.0.060529.txt'),
('ModelFlux64x64RS8BremICPion1-1000GeV.060529.fits', 'ModelFlux64x64RS8BremICPion1-1000GeV.060529.txt')
]

infile_list = [
('counts_g1-9_g004gt1GeV64x64.fits', 'counts_g1-9_g004gt1GeV64x64.txt')]

infile_list = [
('Nu2CompDataPaddedIntTime539.0.060529.fits', 'Nu2CompDataPaddedIntTime539.0.060529.txt'),
('Nu2SumPoisDatonPaddedIntTime539.0.060529.fits','Nu2SumPoisDatonPaddedIntTime539.0.060529.txt'),
('Nu2CompPoisDatonPaddedIntTime539.0.060529.fits', 'Nu2CompPoisDatonPaddedIntTime539.0.060529.fits')]

infile_list = [
    ('Nu2SumPoisDatonPaddedIntTime539.X.060529.fits',
     'Nu2SumPoisDatonPaddedIntTime539.X.060529.txt')
    ]

#('ModelDataPaddedIntTime7.0.060529.fits','ModelDataPaddedIntTime7.0.060529.txt'),
#('ModelDataPaddedIntTime22.0.060529.fits','ModelDataPaddedIntTime22.0.060529.txt'),
#('ModelDataPaddedIntTime73.0.060529.fits','ModelDataPaddedIntTime73.0.060529.txt'),
#('ModelDataPaddedIntTime242.0.060529.fits','ModelDataPaddedIntTime242.0.060529.txt'),
#('ModelDataPaddedIntTime806.0.060529.fits','ModelDataPaddedIntTime806.0.060529.txt'),
#]

#infile_list = [('PoisDatonPaddedIntTime7.0.060604.fits','PoisDatonPaddedIntTime7.0.060604.txt'),
#('PoisDatonPaddedIntTime22.0.060604.fits','PoisDatonPaddedIntTime22.0.060604.txt'),
#('PoisDatonPaddedIntTime73.0.060604.fits','PoisDatonPaddedIntTime73.0.060604.txt'),
#('PoisDatonPaddedIntTime242.0.060604.fits','PoisDatonPaddedIntTime242.0.060604.txt'),
#('PoisDatonPaddedIntTime806.0.060604.fits','PoisDatonPaddedIntTime806.0.060604.txt')
#]

infile_list = [
    ('ModelDataPaddedHlfSquishICSPionBremss1-1000GeVIntTime539.0.060912.fits',
     'ModelDataPaddedHlfSquishICSPionBremss1-1000GeVIntTime539.0.060912.txt')]

infile_list = [
    ('ModelData64x64IntTime806.0.060529.fits','ModelData64x64IntTime806.0.060529.txt'),
('counts_g1-9_g004gt1GeV64x64.fits','counts_g1-9_g004gt1GeV64x64.txt')
    ]
infile_list =[
    ('poiss_g1-9_g004gt1GeVpadded64x64b.fits','poiss_g1-9_g004gt1GeVpadded64x64b.txt')
    ]
infile_list=[
    ('ExposrTim64x64IntTime806.0.060529.fits','ExposrTim64x64IntTime806.0.060529.txt'),
    ('ModelFlux64x64BremICPion1-1000GeV.060529.fits','ModelFlux64x64BremICPion1-1000GeV.060529.txt')
    ]

infile_list=[
    ('ModelFlux64x64RSe8BremICPion1-1000GeV.060529.fits','ModelFlux64x64RSe8BremICPion1-1000GeV.060529.txt'),
('ExposrTim64x64RSe8IntTime806.0.060529.fits','ExposrTim64x64RSe8IntTime806.0.060529.txt')
]

infile_list=[
    ('ModelDataPaddedIntTime1.0.64sq.070130c.fits','ModelDataPaddedIntTime1.0.64sq.070130c.txt')
    ]

infile_list=[
    ('Pad128_002-004GeVcounts_vp0030_g001.fits','Pad128_002-004GeVcounts_vp0030_g001.txt'),
    ('Pad128ModelData.Av3C279_vp0030_g001_002-004GeV.070218b.fits','Pad128ModelData.Av3C279_vp0030_g001_002-004GeV.070218b.txt')
    ]
infile_list = [
    ('Pad128ModelData.PSFonVP113C279bandDiffFromVP3Mean_vp0110_g001_001-002GeV.070220b.fits','Pad128ModelData.PSFonVP113C279bandDiffFromVP3Mean_vp0110_g001_001-002GeV.070220b.txt')
    ]
infile_list = [
    ('Nu2Sum242PoisDatonPaddedIntTime539.X.060529.fits','Nu2Sum242PoisDatonPaddedIntTime539.X.060529.txt')
    ]

infile_list = [
    ('Nu3SumPoisDatonPaddedIntTime133.0.070905.fits','Nu3SumPoisDatonPaddedIntTime133.0.070905.txt')
    ]

for nametuple in infile_list:
    print ' File names:',nametuple
    tst = EZFitsImageToAscii(nametuple[0],nametuple[1])

