Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix VIIRS HNCC composite passing xarray objects to dask #633

Merged
merged 2 commits into from
Feb 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ deploy:
user: dhoese
password:
secure: frK+0k1STeTM7SizRseP0qdTfOVz9ZMIra+3qEytPdxCLceXAH8LxPU16zj5rdNQxasF1hZ6rAd952fly+ypw2TEf5r2WnStrt7G5QlyE7VB6XGSDpIUxKF1FYccLvYs0/R6Y35MTEPqdM51PM5yEBjoY5b4tA3RF3fDq11cqc/SiWr6DgSLB1WJZULOdtCzBbfGbm5LyJ7yeNbISASSAwVvZTGWw7kJDgi0W5zxwEX82N5tBGbfKIu59qmxyj8FxmcrUwKZ4P3rQNg1kN1utzAB+PSf3GAVvbZfWJQuAKwMqpZgaV9lX0V7eUd/AxPobzEk9WyoNBMIdrSPej5BKWTDiYvaeRTOsggoUCSQJJA/SITEvkJgLWXoKKX2OWrM8RBUO4MoZJpPGXN42PRtMJkV2sx6ZigkpJlHdn39SsIRZX31zsfv8bBhclb70bt1Ts0fDd0rVdZAI6gMI+sgUePwEUn+XbWrvI0sMfDX3QsXDMV393RHgaIPxd+lRqUlYsNOxjsWpsbsvX55ePLxYHsNrv11KKyL/iGjGotVeVUO5D78qvfd4JrsUnMalQyZfW8NTEKa5Ebcs7gYJTwYEOTCQU12BkHOv1zFkjZG5RdGwkEvG3pykLhx+qDyYEd7pKB3TvhzLPqZPSrPxirwcoc0UzCc6ocYdzpqVuViFuk=
distributions: sdist bdist_wheel
distributions: sdist
skip_existing: true
on:
tags: true
Expand Down
5 changes: 2 additions & 3 deletions satpy/composites/viirs.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import dask
import dask.array as da
import xarray as xr
import xarray.ufuncs as xu

from satpy.composites import CompositeBase, GenericCompositor
from satpy.config import get_environ_ancpath
Expand Down Expand Up @@ -481,7 +480,7 @@ def __call__(self, datasets, **info):
inner_sqrt = (output_dataset - min_val) / (max_val - min_val)
# clip negative values to 0 before the sqrt
inner_sqrt = inner_sqrt.where(inner_sqrt > 0, 0)
output_dataset.data = xu.sqrt(inner_sqrt).data
output_dataset.data = np.sqrt(inner_sqrt).data

info = dnb_data.attrs.copy()
info.update(self.attrs)
Expand Down Expand Up @@ -1039,7 +1038,7 @@ def __call__(self, datasets, **info):
dnb_data = dnb_data.copy() / unit_factor

# convert to decimal instead of %
moon_illum_fraction = da.mean(datasets[3]) * 0.01
moon_illum_fraction = da.mean(datasets[3].data) * 0.01

phi = da.rad2deg(da.arccos(2. * moon_illum_fraction - 1))

Expand Down
1 change: 0 additions & 1 deletion satpy/tests/compositor_tests/test_viirs.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ def test_hncc_dnb(self):
'ncc_radiance')
data = res.compute()
unique = np.unique(data)
print(repr(unique))
np.testing.assert_allclose(
unique, [3.48479712e-04, 6.96955799e-04, 1.04543189e-03, 4.75394738e-03,
9.50784532e-03, 1.42617433e-02, 1.50001560e+03, 3.00001560e+03,
Expand Down