Skip to content

Commit

Permalink
Fix NIR reflectance computation to use XArray
Browse files Browse the repository at this point in the history
  • Loading branch information
mraspaud committed Jun 5, 2018
1 parent 14114a5 commit d7bc3e6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions satpy/composites/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,9 +469,11 @@ def __call__(self, projectables, optional_datasets=None, **info):
"""
self._init_refl3x(projectables)
_nir, _ = projectables
proj = Dataset(self._get_reflectance(projectables, optional_datasets) * 100, **_nir.info)
refl = self._get_reflectance(projectables, optional_datasets) * 100
proj = xr.DataArray(refl.filled(np.nan), dims=_nir.dims,
coords=_nir.coords, attrs=_nir.attrs)

proj.info['units'] = '%'
proj.attrs['units'] = '%'
self.apply_modifier_info(_nir, proj)

return proj
Expand Down

0 comments on commit d7bc3e6

Please sign in to comment.