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

Warnings #106

Closed
howff opened this issue Nov 23, 2017 · 3 comments
Closed

Warnings #106

howff opened this issue Nov 23, 2017 · 3 comments
Labels

Comments

@howff
Copy link

howff commented Nov 23, 2017

Some warnings that I am not sure how to solve:

  1. global_scene = Scene
    No handlers could be found for logger "satpy.readers.yaml_reader"

  2. global_scene.load([band_name]) - for overview of HRV meteosat
    /packages/pytroll/local/lib/python2.7/site-packages/satpy/readers/hrit_msg.py:1000: RuntimeWarning: divide by zero encountered in reciprocal
    data.data[:] **= -1

  3. global_scene.save_dataset(band_name, 'my_nice_overview.png')
    /packages/pytroll/local/lib/python2.7/site-packages/trollimage/image.py:847: RuntimeWarning: invalid value encountered in power
    (1.0 / gamma),

@djhoese
Copy link
Member

djhoese commented Dec 4, 2017

Thanks for the bug report. Note that all of these are just warnings which means they aren't errors and the code is likely working fine even when these are encountered. I appreciate you bringing these issues up though since it is always good for us to reduce future users' confusion.

  1. This is due to some portions of the code using a python logger (via the builtin logging module). These could be fixed by running logging.basicConfig() by the user, but should probably be handled by satpy in some way (if possible).

  2. This is due to there being masked values (NaNs) in the data being processed so any operation will warn that a NaN value was being used in calculations. The code being used should probably be doing inplace operations on the entire data array and taking advantage of masked arrays. However, since we are switching to xarray in the semi-near future this code will be rewritten anyway so we'll have to tackle it if it comes up again.

  3. Same as 2 just in a different part of the code.

@djhoese
Copy link
Member

djhoese commented May 30, 2018

The first warning has now been fixed in master by adding a NullHandler to the base 'satpy' logger. This warning also only showed up in Python 2.7 from what I can tell.

The other warnings still exist and will always exist unless extra (and in my opinion redundant) checks are done. I'll leave this open to make sure we mention somewhere in the documentation that warnings like this are expected where input data are invalid/NaN.

@djhoese
Copy link
Member

djhoese commented Jan 13, 2019

I'm closing this as there isn't much we can do about NaN values causing warnings.

@djhoese djhoese closed this as completed Jan 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants