Skip to content

KeyError: 'level' Not Found Despite Verification Using wgrib #23

@msli72

Description

@msli72

I'm using the ai-models-graphcast command to download data from CDS. During execution, I encountered the following error:

Traceback (most recent call last):
File "/home/jhwang/test/ai/bin/ai-models", line 8, in
sys.exit(main())
File "/home/jhwang/test/ai/lib/python3.10/site-packages/ai_models/main.py", line 362, in main
_main(sys.argv[1:])
File "/home/jhwang/test/ai/lib/python3.10/site-packages/ai_models/main.py", line 310, in _main
run(vars(args), unknownargs)
File "/home/jhwang/test/ai/lib/python3.10/site-packages/ai_models/main.py", line 335, in run
model.run()
File "/home/jhwang/test/ai/lib/python3.10/site-packages/ai_models_graphcast/model.py", line 208, in run
) = data_utils.extract_inputs_targets_forcings(
File "/home/jhwang/test/ai/lib/python3.10/site-packages/graphcast/data_utils.py", line 330, in extract_inputs_targets_forcings
dataset = dataset.sel(level=list(pressure_levels))
File "/home/jhwang/test/ai/lib/python3.10/site-packages/xarray/core/dataset.py", line 3223, in sel
query_results = map_index_queries(
File "/home/jhwang/test/ai/lib/python3.10/site-packages/xarray/core/indexing.py", line 194, in map_index_queries
results.append(index.sel(labels, **options))
File "/home/jhwang/test/ai/lib/python3.10/site-packages/xarray/core/indexes.py", line 801, in sel
raise KeyError(f"not all values found in index {coord_name!r}")
KeyError: "not all values found in index 'level'"

It seems that the specified pressure levels are not found in the dataset. However, when I checked the data using wgrib, all the necessary pressure levels appeared to be present.

Could anyone provide guidance on why this discrepancy might be occurring,

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions