本文整理汇总了Python中astrodata.AstroData.write方法的典型用法代码示例。如果您正苦于以下问题:Python AstroData.write方法的具体用法?Python AstroData.write怎么用?Python AstroData.write使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类astrodata.AstroData
的用法示例。
在下文中一共展示了AstroData.write方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: write_new_table
# 需要导入模块: from astrodata import AstroData [as 别名]
# 或者: from astrodata.AstroData import write [as 别名]
def write_new_table(self, fname):
cols = list(self.get_columns())
cols.extend(self.get_fiber_positions_columns())
# Create the table HDU
tablehdu = pf.new_table(cols)
# Create an AstroData object to contain the table
# and write to disk.
new_ad = AstroData(tablehdu)
new_ad.rename_ext('SCI', 1)
new_ad.write(fname, clobber=True)
示例2: test_method_write_4
# 需要导入模块: from astrodata import AstroData [as 别名]
# 或者: from astrodata.AstroData import write [as 别名]
def test_method_write_4():
ad = AstroData(TESTFILE)
ad.write(filename="New_File.test", rename=True, clobber=True)
assert os.path.isfile("New_File.test")
os.remove("New_File.test") # Clean it up for next run.
示例3: test_method_write_3
# 需要导入模块: from astrodata import AstroData [as 别名]
# 或者: from astrodata.AstroData import write [as 别名]
def test_method_write_3():
ad = AstroData(TESTFILE)
assert os.path.isfile("New_File.test")
ad.write(filename="New_File.test", rename=True)
assert os.path.isfile("New_File.test")
示例4: test_method_write_1
# 需要导入模块: from astrodata import AstroData [as 别名]
# 或者: from astrodata.AstroData import write [as 别名]
def test_method_write_1():
ad = AstroData(TESTFILE)
os.remove(TESTFILE)
ad.write()
assert os.path.isfile(TESTFILE)
示例5: lineno
# 需要导入模块: from astrodata import AstroData [as 别名]
# 或者: from astrodata.AstroData import write [as 别名]
mem.memtrack("testmemprofile", lineno()); line += 1
ad = AstroData("data/N20131223S0243.fits")
mem.memtrack("testmemprofile", lineno()); line += 1
if True:
datas = []
for ext in ad:
mem.memtrack("data pull in %s,%d" % (ext.extname(), ext.extver()), line); line += 1
#print np.median(ext.data)
#malloc = np.ones((2000,2000), dtype = np.float32)
datas.append(ext.data)
mem.memtrack("before ad.write(..)", lineno());
ad.write("tmp.fits", clobber = True)
mem.memtrack("before ad.close()", lineno());
ad.close()
mem.memtrack("before del(ad)", lineno());
del(ad)
mem.memtrack("sleep .25 seconds", lineno());
time.sleep(.25)
mem.memtrack("end sleep .25 seconds", lineno());