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

Cannot plot pressure level charts #3

Open
meteo1987 opened this issue Jan 16, 2024 · 1 comment
Open

Cannot plot pressure level charts #3

meteo1987 opened this issue Jan 16, 2024 · 1 comment

Comments

@meteo1987
Copy link

I am testing your scripts but fail to plot any kind of pressure level charts. The clouds, precipitation, MSL, and wind 10m charts are generated successfully. However, when I try to plot charts for, example gph 50mb, this error occurs:

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "plot_geop_50_remap.py", line 132, in <module>
    main()
  File "plot_geop_50_remap.py", line 63, in main
    p.map(plot_files_param, dss)
  File "/home/model/miniconda3/envs/global/lib/python3.7/multiprocessing/pool.py", line 268, in map
    return self._map_async(func, iterable, mapstar, chunksize).get()
  File "/home/model/miniconda3/envs/global/lib/python3.7/multiprocessing/pool.py", line 657, in get
    raise self._value
KeyError: 'run'
plot_geop_50_remap.py : Starting script to plot gpt_50
plot_geop_50_remap.py : Pre-processing finished, launching plotting scripts
multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/home/model/miniconda3/envs/global/lib/python3.7/multiprocessing/pool.py", line 121, in worker
    result = (True, func(*args, **kwds))
  File "/home/model/miniconda3/envs/global/lib/python3.7/multiprocessing/pool.py", line 44, in mapstar
    return list(map(*args))
  File "plot_geop_50_remap.py", line 72, in plot_files
    time, run, cum_hour = utils.get_time_run_cum(data)
  File "/tmp/icon-globe/utils.py", line 263, in get_time_run_cum
    run = dset.attrs['run']
KeyError: 'run'
"""
@guidocioni
Copy link
Owner

guidocioni commented Feb 1, 2024

I'm not sure how this could happen because, as you're seeing in this line

dset.attrs['run'] = run

The run variable is added whenever the netcdfs file are read, which is handled by the same function regardless of the plot type.
Also, I haven't seen this error popping up in my production pipeline so I'm not sure why it would only happen to you.

You'll have to follow the chain and see where (and why) the run variable is appearing from the dataset in your case.

BTW this is an helper variable I save in the dataset and use to annotate the plots with the current run, but nothing forces you to use it :)

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

2 participants