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

group_files function returns only one dictionary #850

Closed
BENR0 opened this issue Jul 9, 2019 · 3 comments · Fixed by #855
Closed

group_files function returns only one dictionary #850

BENR0 opened this issue Jul 9, 2019 · 3 comments · Fixed by #855

Comments

@BENR0
Copy link
Collaborator

BENR0 commented Jul 9, 2019

Describe the bug
The group_files function used in the from_files class method of MultiScene returns only one dictionary and therefore the only a single Scene is loaded in the MultiScene.
Maybe this bug is specific to my files: I want to load multiple MSG Seviri slots with the seviri_l1b_nc reader (files from one month but only the 12:00 slots of each day).

To Reproduce

from satpy import Scene, MultiScene
from satpy.multiscene import timeseries
from pathlib import Path

file_dir = Path("data/msg")
files = file_dir.glob("*1200*.nc")

mscn = MultiScene.from_files(files, reader="seviri_l1b_nc")
mscn.load(["IR_108", "IR_039"])

Expected behavior
Each file should be loaded into a Scene. Specifically for the group_files function a list with multiple dictionaries, one for each file, should be returned.

Actual results
The returned list only contains one dictionary where the value is a list of all files.

Environment Info:

  • Linux
  • Satpy Version: 0.16.1
  • PyResample Version: 1.12.3

Additional context
From a first look my guess would be that somehow the time difference threshold here https://github.com/pytroll/satpy/blob/master/satpy/readers/__init__.py#L463-L465 somehow fails.

@djhoese
Copy link
Member

djhoese commented Jul 9, 2019

The group_files function needs at least a start_time from the filename patterns to be able to group files; it doesn't look like seviri_l1b_nc has that: https://github.com/pytroll/satpy/blob/master/satpy/etc/readers/seviri_l1b_nc.yaml.

If the pattern involves more fields that should be sorted by then they need to be configured in the reader like: https://github.com/pytroll/satpy/blob/master/satpy/etc/readers/abi_l1b.yaml#L14

@BENR0
Copy link
Collaborator Author

BENR0 commented Jul 10, 2019

Fell kind of foolish that I didn't think about that, but that makes sense. I guess then that should be added to the readers yaml file. Should I do a PR for that?

@djhoese
Copy link
Member

djhoese commented Jul 10, 2019

kind of foolish

Well it isn't heavily documented and is relatively new so I wouldn't feel too bad. A PR would be great. I didn't know enough about all the other readers when I made the feature so I didn't take the time to update every YAML file that required customization. I planned on doing it on a case by case basis like this.

"Pull requests are welcome" -Dave

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

Successfully merging a pull request may close this issue.

2 participants