本文整理汇总了Python中astrodata.AstroData.descriptorFormat方法的典型用法代码示例。如果您正苦于以下问题:Python AstroData.descriptorFormat方法的具体用法?Python AstroData.descriptorFormat怎么用?Python AstroData.descriptorFormat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类astrodata.AstroData
的用法示例。
在下文中一共展示了AstroData.descriptorFormat方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: AstroData
# 需要导入模块: from astrodata import AstroData [as 别名]
# 或者: from astrodata.AstroData import descriptorFormat [as 别名]
from astrodata import AstroData
ad = AstroData("../../../test_data/recipedata/N20091027S0141.fits")
# this is a developer script, the way it works is you can set a small bank of variables
# to various descriptor return values (ones that return DescriptorValues!)
# and a series of automated printouts can help you inspect the value and probe its
# behavior
ad.descriptorFormat = "as_dict"
g = ad.detector_x_bin()
h = ad.detector_x_bin()
i = ad.detector_x_bin()
j = ad.detector_x_bin(format="as_dict")
dvsnames = ["g","h","i","j"]
dvs = []
for dvname in dvsnames:
dv = eval(dvname)
dv.myname = dvname
dvs.append(dv)
for dv in dvs:
print 'dv "%s" (%s)' % ( dv.myname,dv.name)
print dv.info()
import math
print "using DescriptorValue as a float"
a = math.sin(h)
print "math.sin(h) =",a