Skip to content

With the nwcsaf-geo reader, loading an extra file leads to a product becoming unloadable #3210

@gerritholl

Description

@gerritholl

Describe the bug

When I pass only "S_NWC_CT_MSG2_MSG-N-VISIR_20220124T094500Z.nc" to Scene(...), I can load ct. When I pass both "S_NWC_CT_MSG2_MSG-N-VISIR_20220124T094500Z.nc" and "S_NWC_HRW_MSG2_MSG-N-VISIR_20220124T094500Z.nc", I cannot load ct.

To Reproduce

from satpy import Scene
from satpy.utils import debug_on; debug_on()

files_l2 = ["/media/nas/x21308/scratch/NWCSAF/20220124T094500Z/S_NWC_CT_MSG2_MSG-N-VISIR_20220124T094500Z.nc", "/media/nas/x21308/scratch/NWCSAF/20220124T094500Z/S_NWC_HRW_MSG2_MSG-N-VISIR_20220124T094500Z.nc"]
sc = Scene({"nwcsaf-geo": files_l2[0:1]})  # success
sc.load(["ct"])
sc = Scene({"nwcsaf-geo": files_l2[0:2]})  # failure
sc.load(["ct"])

Expected behavior

I expect that adding extra files for the same timeslot should lead to zero or more loadable datasets, but not make previously loadable datasets unloadable.

Actual results

[DEBUG: 2025-08-21 15:28:41 : satpy.readers.core.yaml_reader] Reading ('/home/gholl/checkouts/satpy/satpy/etc/readers/nwcsaf-geo.yaml', '/home/gholl/checkouts/pytroll-dwd-config/oper/readers/nwcsaf-geo.yaml')
[DEBUG: 2025-08-21 15:28:41 : h5py._conv] Creating converter from 7 to 5
[DEBUG: 2025-08-21 15:28:41 : h5py._conv] Creating converter from 5 to 7
[DEBUG: 2025-08-21 15:28:41 : h5py._conv] Creating converter from 7 to 5
[DEBUG: 2025-08-21 15:28:41 : h5py._conv] Creating converter from 5 to 7
/home/gholl/miniforge3/envs/py313/lib/python3.13/site-packages/yaml/constructor.py:559: UserWarning: 'satpy.readers.yaml_reader.FileYAMLReader' has been moved to 'satpy.readers.core.yaml_reader.FileYAMLReader'. Import from the new location instead (ex. 'from satpy.readers.core.yaml_reader import FileYAMLReader'). The old import paths will be removed in Satpy 1.0
  if not hasattr(module, object_name):
/home/gholl/miniforge3/envs/py313/lib/python3.13/site-packages/yaml/constructor.py:563: UserWarning: 'satpy.readers.yaml_reader.FileYAMLReader' has been moved to 'satpy.readers.core.yaml_reader.FileYAMLReader'. Import from the new location instead (ex. 'from satpy.readers.core.yaml_reader import FileYAMLReader'). The old import paths will be removed in Satpy 1.0
  return getattr(module, object_name)
[DEBUG: 2025-08-21 15:28:42 : satpy.readers.core.yaml_reader] Assigning to nwcsaf-geo: ['/media/nas/x21308/scratch/NWCSAF/20220124T094500Z/S_NWC_CT_MSG2_MSG-N-VISIR_20220124T094500Z.nc']
[DEBUG: 2025-08-21 15:28:42 : rasterio.session] Could not import boto3, continuing with reduced functionality.
[DEBUG: 2025-08-21 15:28:42 : satpy.composites.config_loader] Looking for composites config file seviri.yaml
[DEBUG: 2025-08-21 15:28:42 : pyorbital.tlefile] Path to the Pyorbital configuration (where e.g. platforms.txt is found): /home/gholl/miniforge3/envs/py313/lib/python3.13/site-packages/pyorbital/etc
/home/gholl/miniforge3/envs/py313/lib/python3.13/site-packages/yaml/constructor.py:559: UserWarning: 'satpy.composites.SingleBandCompositor' has been moved to 'satpy.composites.core.SingleBandCompositor'. Import from the new location instead (ex. 'from satpy.composites.core import SingleBandCompositor'). The old import paths will be removed in Satpy 1.0
  if not hasattr(module, object_name):
/home/gholl/miniforge3/envs/py313/lib/python3.13/site-packages/yaml/constructor.py:563: UserWarning: 'satpy.composites.SingleBandCompositor' has been moved to 'satpy.composites.core.SingleBandCompositor'. Import from the new location instead (ex. 'from satpy.composites.core import SingleBandCompositor'). The old import paths will be removed in Satpy 1.0
  return getattr(module, object_name)
/home/gholl/miniforge3/envs/py313/lib/python3.13/site-packages/yaml/constructor.py:559: UserWarning: 'satpy.composites.DayNightCompositor' has been moved to 'satpy.composites.fill.DayNightCompositor'. Import from the new location instead (ex. 'from satpy.composites.fill import DayNightCompositor'). The old import paths will be removed in Satpy 1.0
  if not hasattr(module, object_name):
/home/gholl/miniforge3/envs/py313/lib/python3.13/site-packages/yaml/constructor.py:563: UserWarning: 'satpy.composites.DayNightCompositor' has been moved to 'satpy.composites.fill.DayNightCompositor'. Import from the new location instead (ex. 'from satpy.composites.fill import DayNightCompositor'). The old import paths will be removed in Satpy 1.0
  return getattr(module, object_name)
/home/gholl/miniforge3/envs/py313/lib/python3.13/site-packages/yaml/constructor.py:559: UserWarning: 'satpy.composites.GenericCompositor' has been moved to 'satpy.composites.core.GenericCompositor'. Import from the new location instead (ex. 'from satpy.composites.core import GenericCompositor'). The old import paths will be removed in Satpy 1.0
  if not hasattr(module, object_name):
/home/gholl/miniforge3/envs/py313/lib/python3.13/site-packages/yaml/constructor.py:563: UserWarning: 'satpy.composites.GenericCompositor' has been moved to 'satpy.composites.core.GenericCompositor'. Import from the new location instead (ex. 'from satpy.composites.core import GenericCompositor'). The old import paths will be removed in Satpy 1.0
  return getattr(module, object_name)
/home/gholl/miniforge3/envs/py313/lib/python3.13/site-packages/yaml/constructor.py:559: UserWarning: 'satpy.composites.Filler' has been moved to 'satpy.composites.fill.Filler'. Import from the new location instead (ex. 'from satpy.composites.fill import Filler'). The old import paths will be removed in Satpy 1.0
  if not hasattr(module, object_name):
/home/gholl/miniforge3/envs/py313/lib/python3.13/site-packages/yaml/constructor.py:563: UserWarning: 'satpy.composites.Filler' has been moved to 'satpy.composites.fill.Filler'. Import from the new location instead (ex. 'from satpy.composites.fill import Filler'). The old import paths will be removed in Satpy 1.0
  return getattr(module, object_name)
/home/gholl/miniforge3/envs/py313/lib/python3.13/site-packages/yaml/constructor.py:559: UserWarning: 'satpy.composites.MaskingCompositor' has been moved to 'satpy.composites.mask.MaskingCompositor'. Import from the new location instead (ex. 'from satpy.composites.mask import MaskingCompositor'). The old import paths will be removed in Satpy 1.0
  if not hasattr(module, object_name):
/home/gholl/miniforge3/envs/py313/lib/python3.13/site-packages/yaml/constructor.py:563: UserWarning: 'satpy.composites.MaskingCompositor' has been moved to 'satpy.composites.mask.MaskingCompositor'. Import from the new location instead (ex. 'from satpy.composites.mask import MaskingCompositor'). The old import paths will be removed in Satpy 1.0
  return getattr(module, object_name)
[DEBUG: 2025-08-21 15:28:42 : satpy.composites.config_loader] Looking for composites config file visir.yaml
/home/gholl/miniforge3/envs/py313/lib/python3.13/site-packages/yaml/constructor.py:559: UserWarning: 'satpy.composites.LongitudeMaskingCompositor' has been moved to 'satpy.composites.mask.LongitudeMaskingCompositor'. Import from the new location instead (ex. 'from satpy.composites.mask import LongitudeMaskingCompositor'). The old import paths will be removed in Satpy 1.0
  if not hasattr(module, object_name):
/home/gholl/miniforge3/envs/py313/lib/python3.13/site-packages/yaml/constructor.py:563: UserWarning: 'satpy.composites.LongitudeMaskingCompositor' has been moved to 'satpy.composites.mask.LongitudeMaskingCompositor'. Import from the new location instead (ex. 'from satpy.composites.mask import LongitudeMaskingCompositor'). The old import paths will be removed in Satpy 1.0
  return getattr(module, object_name)
/home/gholl/miniforge3/envs/py313/lib/python3.13/site-packages/yaml/constructor.py:559: UserWarning: 'satpy.composites.MultiFiller' has been moved to 'satpy.composites.fill.MultiFiller'. Import from the new location instead (ex. 'from satpy.composites.fill import MultiFiller'). The old import paths will be removed in Satpy 1.0
  if not hasattr(module, object_name):
/home/gholl/miniforge3/envs/py313/lib/python3.13/site-packages/yaml/constructor.py:563: UserWarning: 'satpy.composites.MultiFiller' has been moved to 'satpy.composites.fill.MultiFiller'. Import from the new location instead (ex. 'from satpy.composites.fill import MultiFiller'). The old import paths will be removed in Satpy 1.0
  return getattr(module, object_name)
[DEBUG: 2025-08-21 15:28:42 : satpy.readers.nwcsaf_nc] Reading ct.
[DEBUG: 2025-08-21 15:28:42 : satpy.readers.nwcsaf_nc] Reading ct_pal.
[DEBUG: 2025-08-21 15:28:42 : satpy.readers.core.yaml_reader] No coordinates found for DataID(name='ct_pal', resolution=3000, modifiers=())
[DEBUG: 2025-08-21 15:28:42 : satpy.readers.nwcsaf_nc] Reading ct_status_flag.
[DEBUG: 2025-08-21 15:28:42 : satpy.readers.nwcsaf_nc] Reading ct_quality.
[DEBUG: 2025-08-21 15:28:42 : satpy.readers.nwcsaf_nc] Reading ct_conditions.
[DEBUG: 2025-08-21 15:28:42 : satpy.readers.core.yaml_reader] Reading ('/home/gholl/checkouts/satpy/satpy/etc/readers/nwcsaf-geo.yaml', '/home/gholl/checkouts/pytroll-dwd-config/oper/readers/nwcsaf-geo.yaml')
/home/gholl/miniforge3/envs/py313/lib/python3.13/site-packages/yaml/constructor.py:559: UserWarning: 'satpy.readers.yaml_reader.FileYAMLReader' has been moved to 'satpy.readers.core.yaml_reader.FileYAMLReader'. Import from the new location instead (ex. 'from satpy.readers.core.yaml_reader import FileYAMLReader'). The old import paths will be removed in Satpy 1.0
  if not hasattr(module, object_name):
/home/gholl/miniforge3/envs/py313/lib/python3.13/site-packages/yaml/constructor.py:563: UserWarning: 'satpy.readers.yaml_reader.FileYAMLReader' has been moved to 'satpy.readers.core.yaml_reader.FileYAMLReader'. Import from the new location instead (ex. 'from satpy.readers.core.yaml_reader import FileYAMLReader'). The old import paths will be removed in Satpy 1.0
  return getattr(module, object_name)
[DEBUG: 2025-08-21 15:28:42 : satpy.readers.core.yaml_reader] Assigning to nwcsaf-geo: ['/media/nas/x21308/scratch/NWCSAF/20220124T094500Z/S_NWC_CT_MSG2_MSG-N-VISIR_20220124T094500Z.nc', '/media/nas/x21308/scratch/NWCSAF/20220124T094500Z/S_NWC_HRW_MSG2_MSG-N-VISIR_20220124T094500Z.nc']
Traceback (most recent call last):
  File "/home/gholl/checkouts/satpy/satpy/scene.py", line 1482, in _update_dependency_tree
    self._dependency_tree.populate_with_keys(needed_datasets, query)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/gholl/checkouts/satpy/satpy/dependency_tree.py", line 265, in populate_with_keys
    raise MissingDependencies(unknown_datasets, "Unknown datasets:")
satpy.node.MissingDependencies: Unknown datasets: {DataQuery(name='ct')}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/gholl/checkouts/protocode/mwe/nwcsaf-ct-not-found.py", line 8, in <module>
    sc.load(["ct"])
    ~~~~~~~^^^^^^^^
  File "/home/gholl/checkouts/satpy/satpy/scene.py", line 1470, in load
    self._update_dependency_tree(needed_datasets, query)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/gholl/checkouts/satpy/satpy/scene.py", line 1484, in _update_dependency_tree
    raise KeyError(str(err))
KeyError: "Unknown datasets: {DataQuery(name='ct')}"

Environment Info:

  • OS: openSUSE Leap 15.6
  • Satpy Version: v0.58.0-44-g9030005a1

Additional context

I seem to recall having seen this before, but I cannot find a corresponding issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions