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 dask compatibility in blackbody functions #74

Merged
merged 1 commit into from
Jun 28, 2019

Conversation

djhoese
Copy link
Member

@djhoese djhoese commented May 3, 2019

I was writing the MERSI-2 L1B reader and needed to use the rad2temp function. I noticed that when dask arrays were passed they were being converted to a numpy array. This PR fixes the usage with the least amount of changes possible.

The biggest difference is that in the planck function a masked array was being used with -9 as the original sentinel value. As far as I could tell the masked array was being used for two reasons: to make min/max calls ignore the masked values and to later use the .mask to replace masked values with NaN. I switched this to use NaN right away instead of -9 and to only print out min/max debug information when the input is an numpy array.

I'm marking this as a bug fix because although its a feature, it is more about fixing a working function so it returns what I want.

@djhoese djhoese added the bug label May 3, 2019
@djhoese djhoese requested review from mraspaud, adybbroe and pnuu May 3, 2019 15:44
@djhoese djhoese self-assigned this May 3, 2019
@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 73.619% when pulling deb43c5 on djhoese:bugfix-blackbody-dask into fd296c0 on pytroll:master.

Copy link
Collaborator

@adybbroe adybbroe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@adybbroe
Copy link
Collaborator

@pnuu Can you have a look as well before I merge?

Copy link
Member

@pnuu pnuu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay. Looks good to me.

@djhoese djhoese merged commit 31d3dc2 into pytroll:master Jun 28, 2019
@djhoese djhoese deleted the bugfix-blackbody-dask branch June 28, 2019 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix blackbody code to work with dask arrays
4 participants