gdal_write_rgb.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:mapnik-forest-change-tiles 作者: wri 项目源码 文件源码
def remap_band1(layer_type, date_conf_array, lookup_dict):

    band1_array = np.copy(date_conf_array)

    # Remap the band1_array to reflect int( total_days / 255 )
    if layer_type == 'glad':

        # create an empty array for our offsets
        offset = np.empty_like(band1_array)

        # populate it with the proper offset value depending on band1_array values
        offset[np.logical_and(band1_array >= 20000, band1_array < 30000)] = 20000
        offset[np.logical_and(a >= 30000, a < 40000)] = 30000

        # subtract them to remove the confidence digit (ten thousandths place)
        # and divide by 255
        band1_array = (band1_array - offset) / 255

    else:
        for k, v in lookup_dict.iteritems():
            band1_array[band1_array == k] = v[0]

    return band1_array
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号