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


Python OCO_Matrix.units[column2]方法代碼示例

本文整理匯總了Python中OCO_Matrix.OCO_Matrix.units[column2]方法的典型用法代碼示例。如果您正苦於以下問題:Python OCO_Matrix.units[column2]方法的具體用法?Python OCO_Matrix.units[column2]怎麽用?Python OCO_Matrix.units[column2]使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在OCO_Matrix.OCO_Matrix的用法示例。


在下文中一共展示了OCO_Matrix.units[column2]方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: fix_fts_radmeas

# 需要導入模塊: from OCO_Matrix import OCO_Matrix [as 別名]
# 或者: from OCO_Matrix.OCO_Matrix import units[column2] [as 別名]
def fix_fts_radmeas(input_file, output_file, scale, which_band=None):

    # Load existing file
    matrix_obj = OCO_Matrix(input_file)

    radiance_col = matrix_obj.labels_lower.index("radiance")

    # Swap wavelength and wavenumber column headers and units
    # since are reversed in FTS file output
    column1 = matrix_obj.labels_lower.index("wavelength")
    column2 = matrix_obj.labels_lower.index("wavenumber")

    labels_tmp = matrix_obj.labels[column2]
    units_tmp   = matrix_obj.units[column2]

    matrix_obj.labels[column2] = matrix_obj.labels[column1]
    matrix_obj.units[column2]  = matrix_obj.units[column1]
    
    matrix_obj.labels[column1] = labels_tmp
    matrix_obj.units[column1]  = units_tmp

    # Fix start pixels for individual band files
    if which_band != None:
        print "Fixing band pixel indexes"
        matrix_obj.pixels = [-2, -2, -2]

        matrix_obj.pixels[int(which_band)] = 0
        if(int(which_band) < 2):
            matrix_obj.pixels[int(which_band)+1] = matrix_obj.dims[0]-1

    # Scale radiance by specified amount
    if scale != None:
        print "Scaling radiances by %s" % scale
        for row_idx in range(matrix_obj.dims[0]):
            matrix_obj.data[row_idx][radiance_col] = matrix_obj.data[row_idx][radiance_col] * float(scale)

    print "Writing file: %s" % output_file
    matrix_obj.write(output_file,  auto_size_cols=False, verbose=True)
開發者ID:E-LLP,項目名稱:RtRetrievalFramework,代碼行數:40,代碼來源:fix_fts_radmeas.py


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