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
评论列表
文章目录