本文整理匯總了Python中MCUtils.get_fits_header方法的典型用法代碼示例。如果您正苦於以下問題:Python MCUtils.get_fits_header方法的具體用法?Python MCUtils.get_fits_header怎麽用?Python MCUtils.get_fits_header使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類MCUtils
的用法示例。
在下文中一共展示了MCUtils.get_fits_header方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: xieta2colrow
# 需要導入模塊: import MCUtils [as 別名]
# 或者: from MCUtils import get_fits_header [as 別名]
def xieta2colrow(xi, eta, calfile, detsize=1.25):
"""Convert detector xi, eta into col, row."""
flat = mc.get_fits_data(calfile)
flatinfo = mc.get_fits_header(calfile)
# should be able to get npix from the header...
npixx = flat.shape[0]
npixy = flat.shape[1]
pixsz = flatinfo['CDELT2']
flatfill = detsize/(npixx*pixsz)
col = ((( xi/36000.)/(detsize/2.)*flatfill + 1.)/2. * npixx)
row = (((eta/36000.)/(detsize/2.)*flatfill + 1.)/2. * npixy)
# You could theoretically drop a cut on detector position / detsize here...
# Also, is this cut absolutely necessary? I think it's already been taken
# care of by the flag==0 assertion in the SQL query.
#cut = ((col > 0.) & (col < flat.shape[0]-1) &
# (row > 0.) & (row < flat.shape[1]-1))
#cut = np.where(ix == True)
return col, row