本文整理汇总了Python中asdf.AsdfFile.tree['wavelengthrange']方法的典型用法代码示例。如果您正苦于以下问题:Python AsdfFile.tree['wavelengthrange']方法的具体用法?Python AsdfFile.tree['wavelengthrange']怎么用?Python AsdfFile.tree['wavelengthrange']使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类asdf.AsdfFile
的用法示例。
在下文中一共展示了AsdfFile.tree['wavelengthrange']方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_wavelengthrange_file
# 需要导入模块: from asdf import AsdfFile [as 别名]
# 或者: from asdf.AsdfFile import tree['wavelengthrange'] [as 别名]
def create_wavelengthrange_file(name):
f = AsdfFile()
#wavelengthrange = {'1SHORT': (4.88, 5.77),
#'1MEDIUM': (5.64, 6.67),
#'1LONG': (6.50, 7.70),
#'2SHORT': (7.47, 8.83),
#'2MEDIUM': (8.63, 10.19),
#'2LONG': (9.96, 11.77),
#'3SHORT': (11.49, 13.55),
#'3MEDIUM': (13.28, 15.66),
#'3LONG': (15.34, 18.09),
#'4SHORT': (17.60, 21.00),
#'4MEDIUM': (20.51, 24.48),
#'4LONG': (23.92, 28.55)
#}
# Relaxing the range to match the distortion. The table above
# comes from the report and is "as designed".
wavelengthrange = {'1SHORT': (4.68, 5.97),
'1MEDIUM': (5.24, 6.87),
'1LONG': (6.2, 7.90),
'2SHORT': (7.27, 9.03),
'2MEDIUM': (8.43, 10.39),
'2LONG': (9.76, 11.97),
'3SHORT': (11.29, 13.75),
'3MEDIUM': (13.08, 15.86),
'3LONG': (15.14, 18.29),
'4SHORT': (17.40, 21.20),
'4MEDIUM': (20.31, 24.68),
'4LONG': (23.72, 28.75)
}
channels = ['1SHORT', '1MEDIUM', '1LONG', '2SHORT', '2MEDIUM', '2LONG',
'3SHORT', '3MEDIUM', '3LONG', '4SHORT', '4MEDIUM', '4LONG']
tree = {
"instrument": "MIRI",
"exp_type": "MIR_MRS",
"pedigree": "GROUND",
"title": "MIRI IFU model - based on CDP-4",
"reftype": "WAVELENGTHRANGE",
"author": "N. Dencheva"
}
tree['channels'] = channels
f.tree = tree
vr = np.empty((12, 2), dtype=np.float)
for i, ch in enumerate(channels):
vr[i] = wavelengthrange[ch]
f.tree['wavelengthrange'] = vr
f.write_to(name)