Skip to content

Commit

Permalink
Use builtin sunzen_corr for overview_sun.
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Raspaud <martin.raspaud@smhi.se>
  • Loading branch information
mraspaud committed Oct 13, 2015
1 parent 1cecdb0 commit 9ca3572
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions mpop/instruments/visir.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@

import numpy as np

try:
from pyorbital.astronomy import sun_zenith_angle as sza
except ImportError:
sza = None

# pylint: disable=W0612
# remove warnings for unused prerequisites

Expand Down Expand Up @@ -152,15 +147,8 @@ def overview_sun(self, stretch='linear', gamma=1.6):

lonlats = self[10.8].area.get_lonlats()

sunz = sza(self.time_slot, lonlats[0], lonlats[1])
sunz = np.ma.masked_outside(sunz, 0.0, 88.0)
sunzmask = sunz.mask
sunz = sunz.filled(88.)

costheta = np.cos(np.deg2rad(sunz))

red = np.ma.masked_where(sunzmask, self[0.635].data / costheta)
green = np.ma.masked_where(sunzmask, self[0.85].data / costheta)
red = self[0.635].sunzen_corr(self.time_slot, lonlats, limit=88.)
green = self[0.85].sunzen_corr(self.time_slot, lonlats, limit=88.)
blue = -self[10.8].data

img = geo_image.GeoImage((red, green, blue),
Expand Down

0 comments on commit 9ca3572

Please sign in to comment.