Hi,
I am trying to get multiple profile plots of density pdf for ramses data and I encounter the following error:
/home/samvad/yt-conda/lib/python3.6/site-packages/h5py/__init__.py:36:
FutureWarning: Conversion of the second argument of issubdtype from float
to np.floating
is deprecated. In future, it will be treated as
np.float64 == np.dtype(float).type
.
from ._conv import register_converters as _register_converters
Traceback (most recent call last):
File "pdf.py", line 8, in <module>
sim = yt.simulation(filename, "Ramses")
File "/home/samvad/yt-conda/lib/python3.6/site-packages/yt/convenience.py", line 112, in simulation
raise YTSimulationNotIdentified(simulation_type)
yt.utilities.exceptions.YTSimulationNotIdentified: Simulation time-series type ramses not defined.
and the following is the code I am using to do so:
import yt
from yt.units import kpc
import matplotlib.pyplot as plt
import numpy as np
import yt.visualization.eps_writer as eps
filename="/lunarc/nobackup/users/samvad/BIG-12-new/output/" sim = yt.simulation(filename, "Ramses") sim.get_time_series(time=[0,50,100,150,200,250,300]) profiles=[] labels=[] plot_specs=[] for ds in sim: ds.define_unit("hpc", (1.674*10(-24), "g/cm3")) ad=ds.all_data() dens=ad.cut_region(["obj['density'].in_units('hpc') > 0"]) profiles.append(yt.create_profile(dens, "density", "cell_mass", weight_field=None, fractional=True)) labels.append("time=%.2f" % ds.current_time.in_units('Myr')) plot_specs.append(dict(linewidth=2, alpha=0.7)) plot = yt.ProfilePlot.from_profiles(profiles, labels=labels, plot_specs=plot_specs) plot.set_log("density", True) plot.set_unit("density", "hpc") plot.set_xlim(1e-7, 1e7)
plot.save(name='density-pdf', suffix='eps')
could someone please let me know how I can get the simulation_type for ramses? Thanks.
Hi,
This will work if you load your data as a time series and find the outputs that correspond to the times you would like pick out manually.
In particular, if you pass yt.load() a list of filenames or a glob pattern, yt will return a DatasetSeries instance that you can iterate over to analyze a series of datasets.
See http://yt-project.org/doc/analyzing/time_series_analysis.html for more detail.
As the error message suggests, the yt.simulation()
functionality only
currently for a few simulation codes (Enzo and Gadget) and does not work
with RAMSES data yet. In principle support for RAMSES data could be added
but that would take some code development work from an interested
contributor.
Best,
Nathan
On Tue, Oct 16, 2018 at 11:28 AM Vadlamani Samhitha vadlamani.samhitha@gmail.com wrote:
Hi,
I am trying to get multiple profile plots of density pdf for ramses data and I encounter the following error:
/home/samvad/yt-conda/lib/python3.6/site-packages/h5py/__init__.py:36:
FutureWarning: Conversion of the second argument of issubdtype from float
to np.floating
is deprecated. In future, it will be treated as
np.float64 == np.dtype(float).type
.
from ._conv import register_converters as _register_converters
Traceback (most recent call last):
File "pdf.py", line 8, in <module>
sim = yt.simulation(filename, "Ramses")
File "/home/samvad/yt-conda/lib/python3.6/site-packages/yt/convenience.py", line 112, in simulation
raise YTSimulationNotIdentified(simulation_type)
yt.utilities.exceptions.YTSimulationNotIdentified: Simulation time-series type ramses not defined.
and the following is the code I am using to do so:
import yt
from yt.units import kpc
import matplotlib.pyplot as plt
import numpy as np
import yt.visualization.eps_writer as eps
filename="/lunarc/nobackup/users/samvad/BIG-12-new/output/" sim = yt.simulation(filename, "Ramses") sim.get_time_series(time=[0,50,100,150,200,250,300]) profiles=[] labels=[] plot_specs=[] for ds in sim: ds.define_unit("hpc", (1.674*10(-24), "g/cm3")) ad=ds.all_data() dens=ad.cut_region(["obj['density'].in_units('hpc') > 0"]) profiles.append(yt.create_profile(dens, "density", "cell_mass", weight_field=None, fractional=True)) labels.append("time=%.2f" % ds.current_time.in_units('Myr')) plot_specs.append(dict(linewidth=2, alpha=0.7)) plot = yt.ProfilePlot.from_profiles(profiles, labels=labels, plot_specs=plot_specs) plot.set_log("density", True) plot.set_unit("density", "hpc") plot.set_xlim(1e-7, 1e7)
plot.save(name='density-pdf', suffix='eps')
could someone please let me know how I can get the simulation_type for ramses? Thanks.
yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
Hi, Thanks. The suggestion worked. However, is it possible to annotate lines on profile plots yet?
On Tue, 16 Oct 2018 at 6:38 PM, Nathan Goldbaum nathan12343@gmail.com wrote:
Hi,
This will work if you load your data as a time series and find the outputs that correspond to the times you would like pick out manually.
In particular, if you pass yt.load() a list of filenames or a glob pattern, yt will return a DatasetSeries instance that you can iterate over to analyze a series of datasets.
See http://yt-project.org/doc/analyzing/time_series_analysis.html for more detail.
As the error message suggests, the yt.simulation()
functionality only
currently for a few simulation codes (Enzo and Gadget) and does not work
with RAMSES data yet. In principle support for RAMSES data could be added
but that would take some code development work from an interested
contributor.
Best,
Nathan
On Tue, Oct 16, 2018 at 11:28 AM Vadlamani Samhitha vadlamani.samhitha@gmail.com wrote:
Hi,
I am trying to get multiple profile plots of density pdf for ramses data and I encounter the following error:
/home/samvad/yt-conda/lib/python3.6/site-packages/h5py/__init__.py:36:
FutureWarning: Conversion of the second argument of issubdtype from float
to np.floating
is deprecated. In future, it will be treated as
np.float64 == np.dtype(float).type
.
from ._conv import register_converters as _register_converters
Traceback (most recent call last):
File "pdf.py", line 8, in <module>
sim = yt.simulation(filename, "Ramses")
File "/home/samvad/yt-conda/lib/python3.6/site-packages/yt/convenience.py", line 112, in simulation
raise YTSimulationNotIdentified(simulation_type)
yt.utilities.exceptions.YTSimulationNotIdentified: Simulation time-series type ramses not defined.
and the following is the code I am using to do so:
import yt
from yt.units import kpc
import matplotlib.pyplot as plt
import numpy as np
import yt.visualization.eps_writer as eps
filename="/lunarc/nobackup/users/samvad/BIG-12-new/output/" sim = yt.simulation(filename, "Ramses") sim.get_time_series(time=[0,50,100,150,200,250,300]) profiles=[] labels=[] plot_specs=[] for ds in sim: ds.define_unit("hpc", (1.674*10(-24), "g/cm3")) ad=ds.all_data() dens=ad.cut_region(["obj['density'].in_units('hpc') > 0"]) profiles.append(yt.create_profile(dens, "density", "cell_mass", weight_field=None, fractional=True)) labels.append("time=%.2f" % ds.current_time.in_units('Myr')) plot_specs.append(dict(linewidth=2, alpha=0.7)) plot = yt.ProfilePlot.from_profiles(profiles, labels=labels, plot_specs=plot_specs) plot.set_log("density", True) plot.set_unit("density", "hpc") plot.set_xlim(1e-7, 1e7)
plot.save(name='density-pdf', suffix='eps')
could someone please let me know how I can get the simulation_type for ramses? Thanks.
yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
Take a look at this example:
http://nbviewer.jupyter.org/urls/gist.githubusercontent.com/ngoldbaum/5251f3...
On Tue, Oct 16, 2018 at 5:11 PM Vadlamani Samhitha vadlamani.samhitha@gmail.com wrote:
Hi, Thanks. The suggestion worked. However, is it possible to annotate lines on profile plots yet?
On Tue, 16 Oct 2018 at 6:38 PM, Nathan Goldbaum nathan12343@gmail.com wrote:
Hi,
This will work if you load your data as a time series and find the outputs that correspond to the times you would like pick out manually.
In particular, if you pass yt.load() a list of filenames or a glob pattern, yt will return a DatasetSeries instance that you can iterate over to analyze a series of datasets.
See http://yt-project.org/doc/analyzing/time_series_analysis.html for more detail.
As the error message suggests, the yt.simulation()
functionality only
currently for a few simulation codes (Enzo and Gadget) and does not work
with RAMSES data yet. In principle support for RAMSES data could be added
but that would take some code development work from an interested
contributor.
Best,
Nathan
On Tue, Oct 16, 2018 at 11:28 AM Vadlamani Samhitha vadlamani.samhitha@gmail.com wrote:
Hi,
I am trying to get multiple profile plots of density pdf for ramses data and I encounter the following error:
/home/samvad/yt-conda/lib/python3.6/site-packages/h5py/__init__.py:36:
FutureWarning: Conversion of the second argument of issubdtype from float
to np.floating
is deprecated. In future, it will be treated as
np.float64 == np.dtype(float).type
.
from ._conv import register_converters as _register_converters
Traceback (most recent call last):
File "pdf.py", line 8, in <module>
sim = yt.simulation(filename, "Ramses")
File "/home/samvad/yt-conda/lib/python3.6/site-packages/yt/convenience.py", line 112, in simulation
raise YTSimulationNotIdentified(simulation_type)
yt.utilities.exceptions.YTSimulationNotIdentified: Simulation time-series type ramses not defined.
and the following is the code I am using to do so:
import yt
from yt.units import kpc
import matplotlib.pyplot as plt
import numpy as np
import yt.visualization.eps_writer as eps
filename="/lunarc/nobackup/users/samvad/BIG-12-new/output/" sim = yt.simulation(filename, "Ramses") sim.get_time_series(time=[0,50,100,150,200,250,300]) profiles=[] labels=[] plot_specs=[] for ds in sim: ds.define_unit("hpc", (1.674*10(-24), "g/cm3")) ad=ds.all_data() dens=ad.cut_region(["obj['density'].in_units('hpc') > 0"]) profiles.append(yt.create_profile(dens, "density", "cell_mass", weight_field=None, fractional=True)) labels.append("time=%.2f" % ds.current_time.in_units('Myr')) plot_specs.append(dict(linewidth=2, alpha=0.7)) plot = yt.ProfilePlot.from_profiles(profiles, labels=labels, plot_specs=plot_specs) plot.set_log("density", True) plot.set_unit("density", "hpc") plot.set_xlim(1e-7, 1e7)
plot.save(name='density-pdf', suffix='eps')
could someone please let me know how I can get the simulation_type for ramses? Thanks.
yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org