Skip to content

Commit

Permalink
Merge pull request #318 from pytroll/fix-nir-reflectance
Browse files Browse the repository at this point in the history
Fix nir reflectance to use XArray
  • Loading branch information
mraspaud authored Jun 5, 2018
2 parents e5949be + d7bc3e6 commit b626a9b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 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
4 changes: 2 additions & 2 deletions satpy/readers/hrit_msg.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"""

import logging
from datetime import datetime, timedelta
from datetime import datetime

import numpy as np

Expand Down Expand Up @@ -379,7 +379,7 @@ def calibrate(self, data, calibration):

elif calibration == 'brightness_temperature':
cal_type = self.prologue['ImageDescription'][
'Level1_5ImageProduction']['PlannedChanProcessing'][self.mda['spectral_channel_id']]
'Level15ImageProduction']['PlannedChanProcessing'][self.mda['spectral_channel_id']]
res = self._ir_calibrate(res, channel_name, cal_type)

logger.debug("Calibration time " + str(datetime.now() - tic))
Expand Down

0 comments on commit b626a9b

Please sign in to comment.