Error running tardis_kromer_plotter.generate_plot()
Closed this issue · 11 comments
Following instructions.md:
import tardis
import tardis_kromer_plot as tkp
import tardis_minimal_model as tmm
config = tardis.yaml_load("tardis_example_carsus.yml")
mdl = tardis.run_tardis(config)
minmodel = tmm.minimal_model(mode="virtual")
minmodel.from_interactive(mdl)
# initialise the plotting tool
plotter = tkp.tardis_kromer_plotter(minmodel, mode="virtual")
# generate plot
plotter.generate_plot(xlim=(3000,1e4), twinx=True)
The last statement results in the following error:
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
File "/Users/lshingles/Dropbox/GitHub/tardisanalysis/tardis_kromer_plot.py", line 364, in generate_plot
self._generate_emission_part()
File "/Users/lshingles/Dropbox/GitHub/tardisanalysis/tardis_kromer_plot.py", line 408, in _generate_emission_part
histtype="stepfilled", normed=True, weights=weights)
File "/usr/local/lib/python2.7/site-packages/matplotlib/__init__.py", line 1898, in inner
return func(ax, *args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/matplotlib/axes/_axes.py", line 6156, in hist
raise ValueError('weights should have the same shape as x')
ValueError: weights should have the same shape as x
The config file should match the example config, except that the atomic database points to a database I've made with carsus.
@lukeshingles we updated and fixed several problems. Are you using the newest versions of both analysis and tardis
Yes, latest master branch of both. Can you reproduce the error?
Here's the atomic database (23MB):
https://www.dropbox.com/s/bwffn033offnmjq/kurucz_latest_o_to_ni.h5.zip?dl=0
@lukeshingles Can you reproduce the error with tardis example or is it only with your database?
The atomic database in tardis_example.tar.gz doesn't run with the latest version of tardis. Is there a new example database for me to use?
The latest version is in tardis-refdata
@lukeshingles this is seemingly the problem
[<Quantity [] Angstrom>, <Quantity [] Angstrom>, <Quantity [] Angstrom>, <Quantity [] Angstrom>, <Quantity [] Angstrom>, <Quantity [] Angstrom>, <Quantity [] Angstrom>, <Quantity [] Angstrom>, <Quantity [] Angstrom>, <Quantity [] Angstrom>, <Quantity [] Angstrom>, <Quantity [] Angstrom>, <Quantity [] Angstrom>, <Quantity [] Angstrom>, <Quantity [] Angstrom>, <Quantity [] Angstrom>, <Quantity [] Angstrom>
I'm looking further into it - any idea why it would find no non-interacting packets?
the problem is in tardis_minimal_model
@lukeshingles @yeganer mode='real' works. The capturing of the precise information for virtual was disabled as it lead to a memory leak for large numbers of virtual packages. I think it should be able to enable this.
So compiling with enabled virtual logging solved the issue?
If that is the case, there should be a warning, at least when trying to access model.runner.virtual_packet_energies
because I made a safeguard there.
Ok, once I reverted my astropy version from 2 to 1.3 and used mode='real', it runs without error. Thanks!