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: 'level' Not Found Despite Verification Using wgrib #23

Open
msli72 opened this issue Nov 5, 2024 · 0 comments
Open

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

msli72 opened this issue Nov 5, 2024 · 0 comments

Comments

@msli72
Copy link

msli72 commented Nov 5, 2024

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!

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

No branches or pull requests

1 participant