当前位置: 首页>>代码示例>>Python>>正文


Python AstroData.insert方法代码示例

本文整理汇总了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
开发者ID:mmorage,项目名称:DRAGONS,代码行数:11,代码来源:test_AstroDataAPI.py

示例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
开发者ID:pyrrho314,项目名称:recipesystem,代码行数:14,代码来源:testutil.py

示例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)
开发者ID:mmorage,项目名称:DRAGONS,代码行数:8,代码来源:test_AstroDataAPI.py

示例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)
开发者ID:mmorage,项目名称:DRAGONS,代码行数:8,代码来源:test_AstroDataAPI.py

示例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'
开发者ID:mmorage,项目名称:DRAGONS,代码行数:8,代码来源:test_AstroDataAPI.py

示例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"
开发者ID:mmorage,项目名称:DRAGONS,代码行数:8,代码来源:test_AstroDataAPI.py

示例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)
开发者ID:mmorage,项目名称:DRAGONS,代码行数:7,代码来源:test_AstroDataAPI.py

示例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
开发者ID:mmorage,项目名称:DRAGONS,代码行数:7,代码来源:test_AstroDataAPI.py

示例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']
开发者ID:mmorage,项目名称:DRAGONS,代码行数:8,代码来源:test_AstroDataAPI.py

示例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
开发者ID:mmorage,项目名称:DRAGONS,代码行数:8,代码来源:test_AstroDataAPI.py


注:本文中的astrodata.AstroData.insert方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。