developmentseed / landsat-util

A utility to search, download and process Landsat 8 satellite imagery
Creative Commons Zero v1.0 Universal
690 stars 147 forks source link

Image data labelled as no data #64

Open kamicut opened 9 years ago

kamicut commented 9 years ago

8yrchpn

After processing, certain data pixels in a scene can be labelled as no data. This is probably due to the color correction algorithm labelling very dark pixels as no data.

To reproduce:

landsat process ./LC81990332014251LGN00.tar.bz -b 432 --pansharpen

QGIS inspection tool can be used to find that the pixel values at the white value points are actually no data.

cf. this tweet

cc @drewbo @scisco

alexkapps commented 9 years ago

@kamicut @drewbo @scisco I fixed this in v 1.0 by scaling values to a condensed range with an output minimum set just above the lowest 8-bit value (1-255? look at the old code for reference) and reserving that zero value for the no-data value. Then a followup gdal utility would use a mask generated by a value reclassification (0 for no-data, 1 for Landsat scene area) that was multiplied (gdal_calc) with the final image product.

Of course, to avoid these gdal dependencies this could all be done in numpy (or something faster, idk).