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

KeyError 'v' using Scene(base_dir=, reader=) #167

Closed
howff opened this issue Jan 25, 2018 · 3 comments · Fixed by #325
Closed

KeyError 'v' using Scene(base_dir=, reader=) #167

howff opened this issue Jan 25, 2018 · 3 comments · Fixed by #325
Assignees
Milestone

Comments

@howff
Copy link

howff commented Jan 25, 2018

Code Sample, a minimal, complete, and verifiable piece of code

global_scene = Scene(reader='viirs_sdr', base_dir='/data/viirs1/201801241307')

Problem description

Gives an error

   File "/packages/pytroll/local/lib/python2.7/site-packages/satpy/readers/__init__.py", line 398, in load_readers
   readers_files = set(filenames[reader[idx]])
KeyError: 'v'

There are four ways to initialise a Scene

  1. base_dir='dir'
  2. filenames=glob('dir/*.h5')
  3. base_dir='dir, reader='viirs_sdr'
  4. filenames=glob('dir/*.h5'), reader='viirs_sdr'

Option 3 is the one which fails with KeyError.

Versions of Python, package at hand and relevant dependencies

satpy 0.8.0

@mraspaud
Copy link
Member

Yes, the basedir option is now removed since 0.8.0. I can't find a warning for this in the docs, so we have to fix this, and the error you get it not clear at all, but here is the recommended way of doing it now:
http://satpy.readthedocs.io/en/latest/readers.html#search-for-local-files

@mraspaud mraspaud added this to the v0.9 milestone Jan 25, 2018
@djhoese
Copy link
Member

djhoese commented Jan 25, 2018

The Scene.__init__ should have used the find_files_and_readers function internally along with a deprecation warning (agreed this is not documented well enough). My worry is that the find_files_and_readers function may be returning unexpected output (a single string when it should be a list of filenames).

@djhoese
Copy link
Member

djhoese commented Jun 14, 2018

Good news? I get this same error with current master. I'll work on this today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants