fogpy icon indicating copy to clipboard operation
fogpy copied to clipboard

fogpy can't implicitly load dependencies

Open gerritholl opened this issue 5 years ago • 0 comments

import glob
import sattools.ptc
from satpy import Scene
fn_sev = glob.glob("/media/nas/x21308/scratch/SEVIRI/2013/12/12/*")
fn_cmsaf = ["/media/nas/x20629/SEVIRI/repr2/level2/cpp/2013/12/12/CPPin20131212100000305SVMSG01MD.nc"]
reader_sev = "seviri_l1b_hrit"
reader_cmsaf = "cmsaf-claas2_l2_nc"
sc = Scene(filenames={
            reader_sev: fn_sev,
            reader_cmsaf: fn_cmsaf})
sattools.ptc.add_pkg_comps_mods(sc, "fogpy", sensors=["seviri"])
ls = sc.resample("germ2")
ls.load(["fls_day"])
ls.show("germ2")

fails with

  File "mwe53.py", line 13, in <module>
    ls.load(["fls_day"])
  File "/data/gholl/miniconda3/envs/py38/lib/python3.8/site-packages/satpy/scene.py", line 971, in load
    raise KeyError("Unknown datasets: {}".format(unknown_str))
KeyError: 'Unknown datasets: VIS006, IR_120, IR_087, VIS008, IR_108, IR_039, IR_016'

It works when adding

sc.load(["VIS006", "IR_120", "IR_087", "VIS008", "IR_108", "IR_039", "IR_016", "cot", "cwp", "reff"])

The need for explicit loading is partly an inevitable consequence of the workaround in https://github.com/pytroll/fogpy/commit/1e85cd3af3c0c9557b719c0702d839d335b242c7, but that doesn't explain why it also finds the datasets it can find with SEVIRI unknown. This may be an issue with satpy dependencies not found when having multiple readers?

gerritholl avatar May 15 '20 09:05 gerritholl