Skip to content

Commit

Permalink
Fill out M07 masked values with M06, to partly mitigate missing
Browse files Browse the repository at this point in the history
reflectance data inside VIIRS swath (increasing problem with later
CSPP versions)

Signed-off-by: Adam.Dybbroe <a000680@c20671.ad.smhi.se>
  • Loading branch information
Adam.Dybbroe committed Jul 12, 2017
1 parent 76873ca commit 85580c8
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions mpop/instruments/viirs.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2010, 2011, 2012, 2013, 2014, 2015, 2016.
# Copyright (c) 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017.

# Author(s):

Expand Down Expand Up @@ -165,12 +165,21 @@ def natural(self):
"""Make a Natural Colors RGB image composite from
M-bands only.
"""
self.check_channels('M05', 'M07', 'M10')
self.check_channels('M05', 'M06', 'M07', 'M10')

ch1 = self['M10'].check_range()
ch2 = self['M07'].check_range()
ch3 = self['M05'].check_range()

ch2b = self['M06'].check_range()
ch2 = np.ma.where(ch2.mask, ch2b, ch2)

common_mask = np.logical_or(ch1.mask, ch2.mask)
common_mask = np.logical_or(common_mask, ch3.mask)
ch1.mask = common_mask
ch2.mask = common_mask
ch3.mask = common_mask

img = geo_image.GeoImage((ch1, ch2, ch3),
self.area,
self.time_slot,
Expand All @@ -184,7 +193,7 @@ def natural(self):

return img

natural.prerequisites = set(['M05', 'M07', 'M10'])
natural.prerequisites = set(['M05', 'M06', 'M07', 'M10'])

def hr_natural(self):
"""Make a high resolution Day Natural Colors RGB image
Expand Down

0 comments on commit 85580c8

Please sign in to comment.