pytroll / satpy

Python package for earth-observing satellite data processing
http://satpy.readthedocs.org/en/latest/
GNU General Public License v3.0
1.07k stars 295 forks source link

Proposal: Give warning when sensor is not implemented #32

Closed mitkin closed 7 years ago

mitkin commented 7 years ago

When constructing an empty Scene for unknown sensor, there is no warning that sensor reader could not be found in the ppp_config_dir.

Considering adding a warning like: scn = Scene(sensor='foo') produces a debug message "No reader config found called foo.yaml"

This would be very similar to the composites, where exactly such logic already exists.

if i call sensor foo then there is a debug message No composite config found called foo.yaml

djhoese commented 7 years ago

@mraspaud @mitkin Is this good enough:

WARNING:satpy.readers:Sensor 'fake' not supported by any readers
WARNING:satpy.readers:Don't know how to open the following files: set(['/data/data/viirs_l1b/20160525/VGEOI_snpp_d20160525_t164200_c20161104034631.nc', '/data/data/viirs_l1b/20160525/VL1BD_snpp_d20160525_t164200_c20161019063503.nc', '/data/data/viirs_l1b/20160525/VL1BM_snpp_d20160525_t164200_c20161019063503.nc', '/data/data/viirs_l1b/20160525/VGEOD_snpp_d20160525_t164200_c20161104034631.nc', '/data/data/viirs_l1b/20160525/VGEOM_snpp_d20160525_t164200_c20161104034631.nc', '/data/data/viirs_l1b/20160525/VL1BI_snpp_d20160525_t164200_c20161019063503.nc'])
Traceback (most recent call last):
  File "/Users/davidh/Library/Application Support/PyCharm2017.1/scratches/viirs_l1b_scene.py", line 23, in <module>
    scn = Scene(sensor='fake', filenames=filenames)
  File "/Users/davidh/repos/git/satpy/satpy/scene.py", line 101, in __init__
    reader_kwargs=reader_kwargs)
  File "/Users/davidh/repos/git/satpy/satpy/scene.py", line 147, in create_reader_instances
    reader_kwargs=reader_kwargs)
  File "/Users/davidh/repos/git/satpy/satpy/readers/__init__.py", line 356, in __call__
    raise ValueError("No supported files found")
ValueError: No supported files found
mraspaud commented 7 years ago

:+1: Looks good to me

mitkin commented 7 years ago

Great!

On Tue, Apr 18, 2017 at 9:28 PM, Martin Raspaud notifications@github.com wrote:

👍 Looks good to me

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pytroll/satpy/issues/32#issuecomment-294954020, or mute the thread https://github.com/notifications/unsubscribe-auth/ADvvKWabgMGXCb_glTBZ028iD957cuJVks5rxQ7DgaJpZM4MJwbY .