本文整理匯總了Python中MOSFIRE.IO.load_flat方法的典型用法代碼示例。如果您正苦於以下問題:Python IO.load_flat方法的具體用法?Python IO.load_flat怎麽用?Python IO.load_flat使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類MOSFIRE.IO
的用法示例。
在下文中一共展示了IO.load_flat方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: apply_flat
# 需要導入模塊: from MOSFIRE import IO [as 別名]
# 或者: from MOSFIRE.IO import load_flat [as 別名]
def apply_flat(scifilename, maskname, band):
''' Divides the contents of scifilename by the flat field and
overwrites scifilename with the same file divided by the flat
Args:
scifilename: Path to science file name.
maskname: The mask name
band: The filter bands
Results:
Overwrites scifilename where the data contents of the file
are divided by the pixel flat
'''
flat = IO.load_flat(maskname, band, {})
flat_data = flat[1].filled(1.0)
header, data = IO.readfits(scifilename)
print("Applying flat to file {0}".format(scifilename))
IO.writefits(data/flat_data, maskname, scifilename, {}, header=header,
overwrite=True)