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

SDEC plot from saved TARDIS simulation #2526

Open
achillefiore opened this issue Feb 29, 2024 · 0 comments
Open

SDEC plot from saved TARDIS simulation #2526

achillefiore opened this issue Feb 29, 2024 · 0 comments

Comments

@achillefiore
Copy link

Describe the bug
I cannot produce a static SDECplot in matplotlib using a saved TARDIS simulation (I can it in runtime though).

To Reproduce
once a TARDIS simulation 'sim' is saved in a hdf file doing:
sim.to_hdf( "filename.hdf", overwrite=True )
hdf_plotter = SDECPlotter.from_hdf( "filename.hdf" )
hdf_plotter.generate_plot_mpl()

File "/Users/achillefiore/Library/Mobile Documents/comappleCloudDocs/2021bnw/spectra/NIR/sdec_plotter.py", line 6, in SDEC
hdf_plotter = SDECPlotter.from_hdf( simulation )
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/achillefiore/miniconda3/envs/tardis/lib/python3.11/site-packages/tardis/visualization/tools/sdec_plot.py", line 482, in from_hdf
"virtual": SDECData.from_hdf(hdf_fpath, "virtual"),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/achillefiore/miniconda3/envs/tardis/lib/python3.11/site-packages/tardis/visualization/tools/sdec_plot.py", line 263, in from_hdf
hdf["/simulation/transport/scalars"].time_of_simulation, "s"

File "/Users/achillefiore/miniconda3/envs/tardis/lib/python3.11/site-packages/pandas/io/pytables.py", line 602, in getitem
return self.get(key)
^^^^^^^^^^^^^
File "/Users/achillefiore/miniconda3/envs/tardis/lib/python3.11/site-packages/pandas/io/pytables.py", line 812, in get
raise KeyError(f"No object named {key} in the file")
KeyError: 'No object named /simulation/transport/scalars in the file'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants