當前位置: 首頁>>代碼示例>>Python>>正文


Python MCUtils.get_fits_header方法代碼示例

本文整理匯總了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
開發者ID:sarallelagram,項目名稱:gPhoton,代碼行數:20,代碼來源:curvetools.py


注:本文中的MCUtils.get_fits_header方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。