本文整理汇总了Python中astrodata.AstroData.insert方法的典型用法代码示例。如果您正苦于以下问题:Python AstroData.insert方法的具体用法?Python AstroData.insert怎么用?Python AstroData.insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类astrodata.AstroData
的用法示例。
在下文中一共展示了AstroData.insert方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_method_insert_7
# 需要导入模块: from astrodata import AstroData [as 别名]
# 或者: from astrodata.AstroData import insert [as 别名]
def test_method_insert_7():
ad = AstroData(TESTFILE)
xname = "TEST"
xver = 99
del header1['EXTNAME']
ad.insert(1, header=header1, data=data1, extname=xname,
extver=xver, auto_number=True)
assert ad[1].header.get("EXTNAME") == xname
assert ad[1].header.get("EXTVER") == xver
示例2: runinsert
# 需要导入模块: from astrodata import AstroData [as 别名]
# 或者: from astrodata.AstroData import insert [as 别名]
def runinsert(index=None, f1=None, f2=None, auto=False):
ad = AstroData(f1)
md = AstroData(f2)
pstr = "\n\n >>>>>>> AD <<<<<<<<\n"
pstr += str(ad.infostr())
pstr += "\n\n >>>>>>> AD APPEND <<<<<<<<\n"
pstr += str(md.infostr())
ad.insert(index=index, moredata=md, auto_number=auto)
pstr +="\n\n >>>>>>> NEW AD <<<<<<<<\n"
pstr += str(ad.infostr())
print(pstr)
return ad
示例3: test_method_insert_10
# 需要导入模块: from astrodata import AstroData [as 别名]
# 或者: from astrodata.AstroData import insert [as 别名]
def test_method_insert_10():
ad = AstroData(TESTFILE)
initial_len = len(ad)
del header1['EXTNAME']
with pytest.raises(AstroDataError):
ad.insert(1, data=data1, auto_number=True)
示例4: test_method_insert_9
# 需要导入模块: from astrodata import AstroData [as 别名]
# 或者: from astrodata.AstroData import insert [as 别名]
def test_method_insert_9():
ad = AstroData(TESTFILE)
initial_len = len(ad)
header1['EXTNAME'] = "TEST"
with pytest.raises(AstroDataError):
ad.insert(1, header=header1, auto_number=True)
示例5: test_method_insert_8
# 需要导入模块: from astrodata import AstroData [as 别名]
# 或者: from astrodata.AstroData import insert [as 别名]
def test_method_insert_8():
ad = AstroData(TESTFILE)
initial_len = len(ad)
header1['EXTNAME'] = 'TEST'
ad.insert(1, header=header1, data=data1, auto_number=True)
assert ad[1].header['EXTNAME'] == 'TEST'
示例6: test_method_insert_6
# 需要导入模块: from astrodata import AstroData [as 别名]
# 或者: from astrodata.AstroData import insert [as 别名]
def test_method_insert_6():
ad = AstroData(TESTFILE)
del header1['EXTNAME']
ad.insert(1, header=header1, data=data1, extname="TEST",
auto_number=True)
assert ad[1].header.get("EXTNAME") == "TEST"
示例7: test_method_insert_5
# 需要导入模块: from astrodata import AstroData [as 别名]
# 或者: from astrodata.AstroData import insert [as 别名]
def test_method_insert_5():
ad = AstroData(TESTFILE)
del header1['EXTNAME']
with pytest.raises(KeyError):
ad.insert(1, header=header1, data=data1, auto_number=True)
示例8: test_method_insert_4
# 需要导入模块: from astrodata import AstroData [as 别名]
# 或者: from astrodata.AstroData import insert [as 别名]
def test_method_insert_4():
ad = AstroData(TESTFILE)
initial_len = len(ad)
ad.insert(1, moredata=pfob, auto_number=True)
assert len(ad) == initial_len + len(pfob) - 1
示例9: test_method_insert_3
# 需要导入模块: from astrodata import AstroData [as 别名]
# 或者: from astrodata.AstroData import insert [as 别名]
def test_method_insert_3():
ad = AstroData(TESTFILE)
initial_len = len(ad)
ad.insert(1, moredata=hdu1, extname='TEST', auto_number=True)
with pytest.raises(KeyError):
assert ad[1].header['TEST']
示例10: test_method_insert_1
# 需要导入模块: from astrodata import AstroData [as 别名]
# 或者: from astrodata.AstroData import insert [as 别名]
def test_method_insert_1():
ad = AstroData(TESTFILE)
ad2 = AstroData(TESTFILE2)
initial_len = len(ad)
ad.insert(1, moredata=ad2, auto_number=True)
assert len(ad) == initial_len + 1