当前位置: 首页>>代码示例>>Python>>正文


Python OCO_Matrix.pixels方法代码示例

本文整理汇总了Python中OCO_Matrix.OCO_Matrix.pixels方法的典型用法代码示例。如果您正苦于以下问题:Python OCO_Matrix.pixels方法的具体用法?Python OCO_Matrix.pixels怎么用?Python OCO_Matrix.pixels使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OCO_Matrix.OCO_Matrix的用法示例。


在下文中一共展示了OCO_Matrix.pixels方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: extract_sv_jacobians

# 需要导入模块: from OCO_Matrix import OCO_Matrix [as 别名]
# 或者: from OCO_Matrix.OCO_Matrix import pixels [as 别名]
def extract_sv_jacobians(pd_file, names_file, rad_conv_file):
    conv_obj = OCO_Matrix(rad_conv_file, read_data=False)
    
    names_obj = OCO_Matrix(names_file, as_strings=True)
    sv_names = names_obj['Element Name'][:,0]

    pd_obj = OCO_Matrix(pd_file)

    for name_re, output_filename in SV_NAMES_MATCH.items():
        file_indexes = []
        for curr_idx, curr_name in enumerate(sv_names):
            if re.search(name_re, curr_name):
                file_indexes.append(curr_idx)

        print output_filename, file_indexes

        out_obj = OCO_Matrix()
        out_obj.pixels = conv_obj.pixels
        out_obj.data = pd_obj.data[:,file_indexes]
        out_obj.write(output_filename)
开发者ID:E-LLP,项目名称:RtRetrievalFramework,代码行数:22,代码来源:extract_sv_jacobians.py

示例2: fix_fts_radmeas

# 需要导入模块: from OCO_Matrix import OCO_Matrix [as 别名]
# 或者: from OCO_Matrix.OCO_Matrix import pixels [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.pixels方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。