Hi, Everybody!
Does anyone out there have a technique for getting the variance out of
a profile object? A profile object is good at getting <X> vs. B, I'd
then like to get < (X - <X>)^2 > vs B. Matt and I had spittballed the
possibility some time ago, but I was wondering if anyone out there had
successfully done it.
Thanks,
d.
--
Sent from my computer.
Hi guys,
I am very new to Ytini's mailing list, mailing lists as well as Houdini.
So please bear with me while I pick up the etiquette around this medium.
With that out of the way here's my first question:
After having succeeded installing Ytini for Houdini on a Mac OS X 10.14 I
would now like to achieve the same with my Houdini install on a Windows 10
OS.
I have tried to somewhat reproduce all steps described here
http://www.ytini.com/getstarted.html#collapseTwoOut (Houdini 17.5 Tested on
Mac OS X) on my Windows machine but wasn't surprised to learn that of
course Houdini could not find the ytini module when I tried to import it in
the python shell.
Is there somebody, that could point me . in the right direction of how to
install Ytini for Houdini on a Windows 10 OS environment?
Not afraid of reading so even hints a re more than welcome.
Many Thanks in advance
Ur4n
I'm working with a dataset from a particle-based simulation with 64^3 particles and am trying to create a covering grid so that I can create a 3D visualization (using volume rendering). I have a problem with the dimensions of that covering grid. A ProjectionPlot from the covering grid dataset only produces a 2x2x2 pixel plot even though the original dataset ProjectionPlot is a 64x64x64 plot. I tried defining the dimensions of the covering grid to be [64,64,64], which results in a 64 pixel wide plot however data is only present in the first 2x2x2 pixels and the rest of the plot is blank. The way I define my covering grid is shown below. Could someone please suggest a solution to this problem?
cov_grid = ds.covering_grid(level=0, left_edge=[-1,-1,-1], dims=ds.domain_dimensions, fields=('deposit','PartType1_density'))
#alternate version
cov_grid = ds.covering_grid(level=32, left_edge=[-1,-1,-1], dims=[64,64,64], fields=('deposit','PartType1_density'))
ds_new = cov_grid.save_as_dataset()
grid_ds = yt.load(ds_new)
Hi all,
I am having some trouble figuring out how to calculate the mass flux as a
function of z-position in a wind-tunnel simulation. I am running Enzo with
5 AMR levels.
If I trying and make a 1d-profile with create_profile, I would have to make
my bin sizes as small as the highest level of refinement, which means I
have plenty of z values with zeros.
I tried to make a covering_grid, thinking I could just deal with everything
as arrays, but as I expected I run out of memory if I make a covering grid
of the whole domain at max resolution. When I create a YTdisk region, I
get an error when trying to make a covering_grid:
AttributeError: 'YTDisk' object has no attribute 'covering_grid'
I then tried to use the surface and calculate_flux commands:
surf3 = ds.disk([0.5,0.5,0.5],[0., 0., 1.],(30,'kpc'),(100,'kpc'))
surfu = ds.surface(surf3,"z",(54,"kpc"))
fluxu =
surfu.calculate_flux("x-velocity","y-velocity","z-velocity","density")
at which point I get this error:
____________________________________________________
Traceback (most recent call last):
File "yt_surface_flux.py", line 85, in <module>
fluxu =
surfu.calculate_flux("x-velocity","y-velocity","z-velocity","density")
File
"/mnt/home/stonnesen/yt-conda/yt/yt/data_objects/construction_data_containers.py",
line 1269, in calculate_flux
field_x, field_y, field_z, fluxing_field)
File
"/mnt/home/stonnesen/yt-conda/yt/yt/data_objects/construction_data_containers.py",
line 1280, in _calculate_flux_in_grid
vc_data = grid.get_vertex_centered_data(vc_fields)
File "/mnt/home/stonnesen/yt-conda/yt/yt/data_objects/grid_patch.py",
line 310, in get_vertex_centered_data
cg = self.retrieve_ghost_zones(1, fields, smoothed=smoothed)
File "/mnt/home/stonnesen/yt-conda/yt/yt/data_objects/grid_patch.py",
line 272, in retrieve_ghost_zones
**kwargs)
File
"/mnt/home/stonnesen/yt-conda/yt/yt/data_objects/construction_data_containers.py",
line 927, in __init__
YTCoveringGrid.__init__(self, *args, **kwargs)
File
"/mnt/home/stonnesen/yt-conda/yt/yt/data_objects/construction_data_containers.py",
line 555, in __init__
self.get_data(fields)
File
"/mnt/home/stonnesen/yt-conda/yt/yt/data_objects/construction_data_containers.py",
line 642, in get_data
if len(fill) > 0: self._fill_fields(fill)
File
"/mnt/home/stonnesen/yt-conda/yt/yt/data_objects/construction_data_containers.py",
line 1003, in _fill_fields
for chunk in ls.data_source.chunks(fields, "io"):
File
"/mnt/home/stonnesen/yt-conda/yt/yt/data_objects/data_containers.py", line
1263, in chunks
self.get_data() # Ensure we have built ourselves
File
"/mnt/home/stonnesen/yt-conda/yt/yt/data_objects/data_containers.py", line
1306, in get_data
self.index._identify_base_chunk(self)
File
"/mnt/home/stonnesen/yt-conda/yt/yt/geometry/grid_geometry_handler.py",
line 289, in _identify_base_chunk
gi = dobj.selector.select_grids(self.grid_left_edge,
File
"/mnt/home/stonnesen/yt-conda/yt/yt/data_objects/data_containers.py", line
1258, in selector
self._selector = sclass(self)
File "yt/geometry/selection_routines.pyx", line 860, in
yt.geometry.selection_routines.RegionSelector.__init__
RuntimeError: Error: yt attempted to read outside the boundaries of a
non-periodic domain along dimension 0.
Region left edge = -0.0078125 code_length, Region right edge = 1.0078125
code_length
Dataset left edge = 0.0 code_length, Dataset right edge = 1.0 code_length
This commonly happens when trying to compute ghost cells up to the domain
boundary. Two possible solutions are to load a smaller regi
on that does not border the edge or override the periodicity for this
dataset.
___________________________________________
However, my simulated region is 300 kpc across, so I am not at the edge in
any axis.
I suppose I have 2 questions: can I make a covering_grid of a region of a
simulation, or can I have some guidance on making the calculate_flux
command work?
Thanks in advance!!
Best,
Stephanie
--
Dr. Stephanie Tonnesen
Associate Research Scientist
CCA, Flatiron Institute
New York, NY
stonnes(a)gmail.com
Hello,
I'm trying to create a radial profile of the gas density using the
create_profile function. Even with the extrema explicitly specified the
binning does not take these values. I was wondering whether there was a
simple way to work around this? My script and output are bellow:
ds = yt.load("DD0077/output_0077")
val, loc = ds.find_max('density')
sp = ds.sphere(loc, (10.0, 'pc'))
rp = yt.create_profile(sp, 'radius', ('gas', 'density'), n_bins= 10,
extrema= {'radius':((1e-2, 'pc'), (10.0, 'pc'))}, logs= {'radius':True})
rp.x.in_units('pc')
>>>YTArray([0.01497631, 0.02988167, 0.05962177, 0.11896107, 0.23735854,
0.47359256, 0.94494138, 1.88540592, 3.76187938,
7.50593617]) pc
(where 0.01 and 10 are expected to be the first and last values)
Many thanks,
Sam Patrick
Hi all,
Recently I have seen this error more often:
>> raise RuntimeError("YTQuantity values must be numeric”)
I have been able to solve most of the problems which were related with units (some packages behave differently if I do units*array or array*unit).
However, I’m getting an error when I’m trying to project a field, and I don’t know how to solve that
Code:
.
.
def _Disk_H(field, data):
center = data.get_field_parameter('center')
z = data["z"] - center[2]
return np.abs(z)
yt.add_field("Disk_H",
function=_Disk_H,
units="pc",
take_log=False,
validators=[ValidateParameter('center')])
.
.
.
disk_dd = dd.cut_region(["obj['Disk_H'].in_units('pc') < 1.0e3"])
proj = ds.proj('density', 2,data_source=disk_dd,weight_field='density’)
Saludos!
José Utreras
Error:
proj = ds.proj('density', 2,data_source=disk_dd,weight_field='density')
File "/home/jutreras/miniconda3/lib/python3.5/site-packages/yt/data_objects/construction_data_containers.py", line 262, in __init__
self.get_data(field)
File "/home/jutreras/miniconda3/lib/python3.5/site-packages/yt/data_objects/construction_data_containers.py", line 336, in get_data
self._handle_chunk(chunk, fields, tree)
File "/home/jutreras/miniconda3/lib/python3.5/contextlib.py", line 77, in __exit__
self.gen.throw(type, value, traceback)
File "/home/jutreras/miniconda3/lib/python3.5/site-packages/yt/data_objects/data_containers.py", line 960, in _field_parameter_state
yield
File "/home/jutreras/miniconda3/lib/python3.5/site-packages/yt/data_objects/construction_data_containers.py", line 330, in get_data
[], "io", local_only = True)):
File "/home/jutreras/miniconda3/lib/python3.5/site-packages/yt/utilities/parallel_tools/parallel_analysis_interface.py", line 508, in parallel_objects
for result_id, obj in oiter:
File "/home/jutreras/miniconda3/lib/python3.5/site-packages/yt/data_objects/selection_data_containers.py", line 800, in chunks
yield self
File "/home/jutreras/miniconda3/lib/python3.5/contextlib.py", line 77, in __exit__
self.gen.throw(type, value, traceback)
File "/home/jutreras/miniconda3/lib/python3.5/site-packages/yt/data_objects/data_containers.py", line 1265, in _chunked_read
yield
File "/home/jutreras/miniconda3/lib/python3.5/site-packages/yt/data_objects/selection_data_containers.py", line 800, in chunks
yield self
File "/home/jutreras/miniconda3/lib/python3.5/contextlib.py", line 77, in __exit__
self.gen.throw(type, value, traceback)
File "/home/jutreras/miniconda3/lib/python3.5/site-packages/yt/data_objects/data_containers.py", line 1265, in _chunked_read
yield
File "/home/jutreras/miniconda3/lib/python3.5/site-packages/yt/data_objects/selection_data_containers.py", line 799, in chunks
self.get_data(fields)
File "/home/jutreras/miniconda3/lib/python3.5/site-packages/yt/data_objects/selection_data_containers.py", line 805, in get_data
ind = self._cond_ind
File "/home/jutreras/miniconda3/lib/python3.5/site-packages/yt/data_objects/selection_data_containers.py", line 837, in _cond_ind
np.logical_and(res, ind, ind)
File "/home/jutreras/miniconda3/lib/python3.5/contextlib.py", line 77, in __exit__
self.gen.throw(type, value, traceback)
File "/home/jutreras/miniconda3/lib/python3.5/site-packages/yt/data_objects/data_containers.py", line 960, in _field_parameter_state
yield
File "/home/jutreras/miniconda3/lib/python3.5/site-packages/yt/data_objects/selection_data_containers.py", line 833, in _cond_ind
res = eval(cond)
File "<string>", line 1, in <module>
File "/home/jutreras/miniconda3/lib/python3.5/site-packages/yt/units/yt_array.py", line 1094, in __lt__
return super(YTArray, self).__lt__(oth)
File "/home/jutreras/miniconda3/lib/python3.5/site-packages/yt/units/yt_array.py", line 1215, in __array_wrap__
any_nonzero = [np.any(oper1), np.any(oper2)]
File "/home/jutreras/miniconda3/lib/python3.5/site-packages/numpy/core/fromnumeric.py", line 2164, in any
return _wrapreduction(a, np.logical_or, 'any', axis, None, out, keepdims=keepdims)
File "/home/jutreras/miniconda3/lib/python3.5/site-packages/numpy/core/fromnumeric.py", line 84, in _wrapreduction
return reduction(axis=axis, out=out, **passkwargs)
File "/home/jutreras/miniconda3/lib/python3.5/site-packages/numpy/core/_methods.py", line 43, in _any
return umr_any(a, axis, dtype, out, keepdims)
File "/home/jutreras/miniconda3/lib/python3.5/site-packages/yt/units/yt_array.py", line 1175, in __array_wrap__
return ret[()]
File "/home/jutreras/miniconda3/lib/python3.5/site-packages/yt/units/yt_array.py", line 1165, in __getitem__
return YTQuantity(ret, self.units, bypass_validation=True)
File "/home/jutreras/miniconda3/lib/python3.5/site-packages/yt/units/yt_array.py", line 1353, in __new__
raise RuntimeError("YTQuantity values must be numeric")
RuntimeError: YTQuantity values must be numeric
Hi all,
I'm trying to write a simple piece of code which produces a phase plot
of the entire dataset. I'm currently using yt version 3.5.0 and Python
version 3.7.1. Essentially what I have is:
val, loc = ds.find_max('density')
ad = ds.all_data()
plot = yt.PhasePlot(ad, "density", "temperature", "cell_mass",
weight_field=None)
plot.set_unit('cell_mass', 'Msun')
filename = "phase_plot_z={:.2f}.png".format(ds.current_redshift)
plot.save(filename)
However when I try running the code I get the following error:
Traceback (most recent call last):
File "phase_plot.py", line 14, in <module>
plot = yt.PhasePlot(ad, "density", "temperature", "cell_mass",
weight_field=None)
File
"/opt/apps/yt/jan19/lib/python3.7/site-packages/yt/visualization/profile_plotter.py",
line 931, in __init__
fractional=fractional)
File
"/opt/apps/yt/jan19/lib/python3.7/site-packages/yt/data_objects/profiles.py",
line 1207, in create_profile
obj.add_fields([field for field in fields])
File
"/opt/apps/yt/jan19/lib/python3.7/site-packages/yt/data_objects/profiles.py",
line 129, in add_fields
self._bin_chunk(chunk, fields, temp_storage)
File
"/opt/apps/yt/jan19/lib/python3.7/site-packages/yt/data_objects/profiles.py",
line 627, in _bin_chunk
bin_ind_y = np.digitize(bf_y, self.y_bins) - 1
ValueError: bins must be monotonically increasing or decreasing
I'm not entirely sure what's happening since there's no part of the code
which is interfacing with binning directly. Any light shed on this issue
would be much appreciated.
Many thanks,
Sam Patrick
Hello,
I have recently subscribed to the yt mailing list. However, I am having
problems signing into my account. Below are my account details:
E-mail address: damle(a)uni-potsdam.de
Username: Mitali
I would be very helpful if you could kindly look into this matter.
Regards,
Mitali Damle,
MSc Astrophysics,
University of Potsdam
Hello,
I have an enzo cosmology simulation which consists only baryonic matter and no dark matter and I'm trying to find halos on this baryonic field. but the HaloCatalog requests particle_mass and probably all other particle fields. is there any way to run HaloCatalog on baryonic fields without defining particle fields?
if not, is there any well-defined way to turn gas fields in particle fields in yt?
Thanks.
Dear yt
Can current yt calculate 3-D Mass power spectra? I checked the website but
I didn't find any information. I think calculating 3-D Mass power
spectra is a very useful for cosmological simulations. So I guess maybe yt
supports this function now....?
Thanks in advance