Skip to content

Instantly share code, notes, and snippets.

@mraspaud
Last active August 29, 2015 14:07
Show Gist options
  • Save mraspaud/e4a623e417d01970aacf to your computer and use it in GitHub Desktop.
Save mraspaud/e4a623e417d01970aacf to your computer and use it in GitHub Desktop.
def ir108_temp(self):
"""Make a black and white image of the IR 10.8um channel, with
information to retreive the brightnesse temperature.
"""
self.check_channels(10.8)
img = geo_image.GeoImage(self[10.8].data,
self.area,
self.time_slot,
fill_value=0,
mode="L")
img.crude_stretch(0)
offset = self[10.8].data.max()
scale = (self[10.8].data.min() - self[10.8].data.max()) / 255.0
img.invert()
tags = {"scale": str(scale), "offset": str(offset)}
img.tags.update(tags)
return img
ir108_temp.prerequisites = set([10.8])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment