Пример #1
0
def test9():
    '''ASTRODATA-open TEST 9: Pass params header and data'''
    hdulist_sef = pyfits.open(sci1)
    header = hdulist_sef[1].header
    data = hdulist_sef[1].data
    ad = AstroData(header=header, data=data)
    checkad(ad)
    hdulist_sef.close()
Пример #2
0
def test8():
    '''ASTRODATA-open TEST 8: Pass params phu, header, and data'''
    hdulist_sef = pyfits.open(sci1)
    phu = hdulist_sef[0]
    header = hdulist_sef[1].header
    data = hdulist_sef[1].data
    ad = AstroData(phu=phu, header=header, data=data)
    checkad(ad)
    hdulist_sef.close()
Пример #3
0
def test4():
    '''ASTRODATA-single-extfuncs TEST 4: set_header()  
    '''
    print('\n\t* single ext fits testfile: %s' % sci1)
    hdulist = pyfits.open(sci1)
    print('\thdulist = pyfits.open(sci1)')
    ad = AstroData(sci123)
    print('\tad = AstroData(sci123)')
    ad[0].set_header(hdulist[1].header)
    print('\tad[0].set_header(hdulist[1].header)')
    eq_(ad[0].header, hdulist[1].header, msg='ext. header not set correctly')
Пример #4
0
def test7():
    '''ASTRODATA-single-extfuncs TEST 7: MEF exceptions  
    '''
    print('\n\t* MEF testfile: %s' % sci123)
    hdulist = pyfits.open(sci123)
    print('\thdulist = pyfits.open(sci123)')
    ad = AstroData(hdulist)
    print('\tad = AstroData(hdulist)  # 3 ext MEF hdulist')
    mes1 = 'This member or method can only be called for '
    mes1 += 'Single HDU AstroData instances'
    try:
        data = ad.get_data()
    except Errors.SingleHDUMemberExcept,s:
        pass
Пример #5
0
def test4():
    '''ASTRODATA-open TEST 4: Pass pyfits HDUList (SEF, SCI1)'''
    hdulist_sef = pyfits.open(sci1)
    ad = AstroData(hdulist_sef)
    checkad(ad)
    hdulist_sef.close()
Пример #6
0
def test7():
    '''ASTRODATA-open TEST 7: Pass param phu=pyfits header'''
    hdulist_sef = pyfits.open(sci1)
    ad = AstroData(phu=hdulist_sef[0].header)
    checkad(ad)
    hdulist_sef.close()
Пример #7
0
def test6():
    '''ASTRODATA-open TEST 6: Pass param phu=pyfits PHU'''
    hdulist_sef = pyfits.open(sci1)
    ad = AstroData(phu=hdulist_sef[0])
    checkad(ad)
    hdulist_sef.close()
Пример #8
0
def test3():
    '''ASTRODATA-open TEST 3: Pass pyfits HDUList (MEF, SCI123)'''
    hdulist_mef = pyfits.open(sci123)
    ad = AstroData(hdulist_mef)
    checkad(ad)
    hdulist_mef.close()