Skip to content

Commit

Permalink
Adapt to pillow
Browse files Browse the repository at this point in the history
Signed-off-by: Adam.Dybbroe <a000680@c20671.ad.smhi.se>
  • Loading branch information
Adam.Dybbroe committed Sep 15, 2016
1 parent d07f8dd commit 40f7028
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mpop/satin/aapp1b.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Copyright (c) 2012, 2013, 2014, 2015 SMHI
# Copyright (c) 2012, 2013, 2014, 2015, 2016 SMHI

# Author(s):

Expand Down Expand Up @@ -755,12 +755,12 @@ def _ir_calibrate(header, data, irchn, calib_type):
def show(data, negate=False):
"""Show the stetched data.
"""
import Image as pil
from PIL import Image
data = np.array((data - data.min()) * 255.0 /
(data.max() - data.min()), np.uint8)
if negate:
data = 255 - data
img = pil.fromarray(data)
img = Image.fromarray(data)
img.show()

CASES = {
Expand Down Expand Up @@ -798,7 +798,7 @@ def show(data, negate=False):
SCENE.navigate()
for i__ in AVHRR_CHANNEL_NAMES:
data_ = SCENE.channels[i__]
print >> sys.stderr, "%-3s" % i_, \
print >> sys.stderr, "%-3s" % i__, \
"%6.2f%%" % (100. * (float(np.ma.count(data_)) / data_.size)), \
"%6.2f, %6.2f, %6.2f" % (data_.min(), data_.mean(), data_.max())
show(SCENE.channels['2'], negate=False)

0 comments on commit 40f7028

Please sign in to comment.