Hi all
I was wondering if there are certain presets or already made simulations or
tweak-able sims from yt that I could use to simulate the point where a star
and a protoplantary disk meet
I'm new to yt and was wondering how one would go about this.
Thanks, Steven
_______________________________________________
yt-users mailing list
yt-users(a)lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
Hi yt users and developer,
I tried to make a simple visualization for 244/h cMpc box with 512^3
DM and gas gadget simulation with following script
==================================
import matplotlib as matplotlib
matplotlib.use('Agg')
import matplotlib.pylab as pylab
import numpy as np
import yt
import yt.units as units
index = 0
text_dict = {'color':'white', 'size':20}
fname = ('../snap_vbc_%03d.hdf5' % index)
unit_base = {'UnitLength_in_cm' : 3.08568e+21, 'UnitMass_in_g'
: 1.989e+43, 'UnitVelocity_in_cm_per_s' : 100000}
bbox_lim = 244000 #kpc
bbox = [[0,bbox_lim], [0,bbox_lim], [0,bbox_lim]]
ds = yt.load(fname,unit_base=unit_base,bounding_box=bbox)
cen_center=np.array([122000,122000,122000])
pc = yt.ProjectionPlot(ds, "z", ('deposit', 'PartType0_density'),
width = (244.0, 'Mpccm/h'))
pc.annotate_text((0.8,0.9),'z=%4.2f' % ds.current_redshift,
data_coords=False, text_args = text_dict)
pc.save("all_view_%04d" % index)
pc = yt.ProjectionPlot(ds, "z", ('deposit', 'PartType1_density'),
width = (244.0, 'Mpccm/h'))
pc.annotate_text((0.8,0.9),'z=%4.2f' % ds.current_redshift,
data_coords=False, text_args = text_dict)
pc.save("all_view_%04d" % index)
pc = yt.ProjectionPlot(ds, "z", ('deposit', 'all_density'), width =
(244.0, 'Mpccm/h'))
pc.annotate_text((0.8,0.9),'z=%4.2f' % ds.current_redshift,
data_coords=False, text_args = text_dict)
pc.save("all_view_%04d" % index)
pc = yt.ProjectionPlot(ds, "z", ('gas', 'density'), width = (244.0, 'Mpccm/h'))
pc.annotate_text((0.8,0.9),'z=%4.2f' % ds.current_redshift,
data_coords=False, text_args = text_dict)
pc.save("all_view_%04d" % index)
===================================
It initially works an make couple figures but it crash with following
error message:
.......
Traceback (most recent call last):
File "viz.py", line 56, in <module>
viz4(index)
File "viz.py", line 50, in viz4
pc = yt.ProjectionPlot(ds, "z", ('gas', 'density'), width =
(244.0, 'Mpccm/h'))
File "/work/00916/tg459470/common/anaconda/lib/python2.7/site-packages/yt-3.2dev-py2.7-linux-x86_64.egg/yt/visualization/plot_window.py",
line 1228, in __init__
field_parameters = field_parameters, method = method)
File "/work/00916/tg459470/common/anaconda/lib/python2.7/site-packages/yt-3.2dev-py2.7-linux-x86_64.egg/yt/data_objects/construction_data_containers.py",
line 250, in __init__
self.get_data(field)
File "/work/00916/tg459470/common/anaconda/lib/python2.7/site-packages/yt-3.2dev-py2.7-linux-x86_64.egg/yt/data_objects/construction_data_containers.py",
line 295, in get_data
chunk_fields, "io", local_only = True)):
File "/work/00916/tg459470/common/anaconda/lib/python2.7/site-packages/yt-3.2dev-py2.7-linux-x86_64.egg/yt/utilities/parallel_tools/parallel_analysis_interface.py",
line 507, in para
llel_objects
for obj_id, obj in oiter:
File "/work/00916/tg459470/common/anaconda/lib/python2.7/site-packages/yt-3.2dev-py2.7-linux-x86_64.egg/yt/data_objects/data_containers.py",
line 592, in chunks
self.get_data(fields)
File "/work/00916/tg459470/common/anaconda/lib/python2.7/site-packages/yt-3.2dev-py2.7-linux-x86_64.egg/yt/data_objects/data_containers.py",
line 693, in get_data
self._generate_fields(fields_to_generate)
File "/work/00916/tg459470/common/anaconda/lib/python2.7/site-packages/yt-3.2dev-py2.7-linux-x86_64.egg/yt/data_objects/data_containers.py",
line 713, in _generate_fields
fd = self._generate_field(field)
File "/work/00916/tg459470/common/anaconda/lib/python2.7/site-packages/yt-3.2dev-py2.7-linux-x86_64.egg/yt/data_objects/data_containers.py",
line 285, in _generate_field
tr = self._generate_fluid_field(field)
File "/work/00916/tg459470/common/anaconda/lib/python2.7/site-packages/yt-3.2dev-py2.7-linux-x86_64.egg/yt/data_objects/data_containers.py",
line 303, in _generate_fluid_field
rv = self._generate_spatial_fluid(field, ngt_exception.ghost_zones)
File "/work/00916/tg459470/common/anaconda/lib/python2.7/site-packages/yt-3.2dev-py2.7-linux-x86_64.egg/yt/data_objects/data_containers.py",
line 319, in _generate_spatial_fluid
ind += o.select(self.selector, self[field], rv, ind)
File "/work/00916/tg459470/common/anaconda/lib/python2.7/site-packages/yt-3.2dev-py2.7-linux-x86_64.egg/yt/data_objects/data_containers.py",
line 248, in __getitem__
self.get_data(f)
File "/work/00916/tg459470/common/anaconda/lib/python2.7/site-packages/yt-3.2dev-py2.7-linux-x86_64.egg/yt/data_objects/data_containers.py",
line 693, in get_data
self._generate_fields(fields_to_generate)
File "/work/00916/tg459470/common/anaconda/lib/python2.7/site-packages/yt-3.2dev-py2.7-linux-x86_64.egg/yt/data_objects/data_containers.py",
line 713, in _generate_fields
fd = self._generate_field(field)
File "/work/00916/tg459470/common/anaconda/lib/python2.7/site-packages/yt-3.2dev-py2.7-linux-x86_64.egg/yt/data_objects/data_containers.py",
line 285, in _generate_field
tr = self._generate_fluid_field(field)
File "/work/00916/tg459470/common/anaconda/lib/python2.7/site-packages/yt-3.2dev-py2.7-linux-x86_64.egg/yt/data_objects/data_containers.py",
line 305, in _generate_fluid_field
rv = finfo(gen_obj)
File "/work/00916/tg459470/common/anaconda/lib/python2.7/site-packages/yt-3.2dev-py2.7-linux-x86_64.egg/yt/fields/derived_field.py",
line 184, in __call__
dd = self._function(self, data)
File "/work/00916/tg459470/common/anaconda/lib/python2.7/site-packages/yt-3.2dev-py2.7-linux-x86_64.egg/yt/fields/particle_fields.py",
line 958, in _vol_weight
dens = data[ptype, density_name].in_cgs()
File "/work/00916/tg459470/common/anaconda/lib/python2.7/site-packages/yt-3.2dev-py2.7-linux-x86_64.egg/yt/data_objects/octree_subset.py",
line 77, in __getitem__
tr = super(OctreeSubset, self).__getitem__(key)
File "/work/00916/tg459470/common/anaconda/lib/python2.7/site-packages/yt-3.2dev-py2.7-linux-x86_64.egg/yt/data_objects/data_containers.py",
line 248, in __getitem__
self.get_data(f)
File "/work/00916/tg459470/common/anaconda/lib/python2.7/site-packages/yt-3.2dev-py2.7-linux-x86_64.egg/yt/data_objects/data_containers.py",
line 687, in get_data
particles, self, self._current_chunk)
File "/work/00916/tg459470/common/anaconda/lib/python2.7/site-packages/yt-3.2dev-py2.7-linux-x86_64.egg/yt/geometry/geometry_handler.py",
line 234, in _read_particle_fields
fields_to_read)
File "/work/00916/tg459470/common/anaconda/lib/python2.7/site-packages/yt-3.2dev-py2.7-linux-x86_64.egg/yt/utilities/io_handler.py",
line 177, in _read_particle_selection
for field_r, vals in self._read_particle_fields(chunks, ptf, selector):
File "/work/00916/tg459470/common/anaconda/lib/python2.7/site-packages/yt-3.2dev-py2.7-linux-x86_64.egg/yt/frontends/owls/io.py",
line 97, in _read_particle_fields
coords = g["Coordinates"][:].astype("float64")
MemoryError
It looks there is a memory shortage.
I use the stampede normal node which has ~32GB and I do not think
512^3 gas and DM particles require this amount memory.
[But, I successfully made a visualization with 256^3 in 100/h cMpc run.]
Is there any my possible mistake that leaks the memory?
If so, could you inform me to overcome this memory issue.
Thank you in advance,
Junhwan Choi
_______________________________________________
yt-users mailing list
yt-users(a)lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
Hello everyone,
In general, is there any way to suppress the messages that yt prints to
screen?
Specifically, I am looping through many datasets in an ipython notebook and
would like to stop the yt printout that happens with every "yt.load()"
call. This ends up slowing down and occasionally crashing my notebook.
I've tried normal means of suppressing stdout and stderr, but they don't
seem to be working. Adding ";" at the end of the yt.load call doesn't work,
and adding "%%capture" in the cell in the ipython notebook also does not
work.
Thanks,
Andrew E.
--
Graduate Student
Columbia University
Department of Astronomy
_______________________________________________
yt-users mailing list
yt-users(a)lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
Dear yt-users,
I am trying to calculate the total HI mass within a sphere. I have a field
called 'HI_Density'. And I tried to use the script
HI_Mass = sphere['enzo','HI_Density'].in_units('Msun').sum()
But I got an error that says the unit code_mass/code_length**3 cannot be
converted to code_mass.
So I thought I might need to create a derived_field called 'HI_Mass' which
mutiplies the HI_Density with code_length**3. But I don't see that there is
any existing field of cell length/volume. So how should I do this? Or is
there an easier way to compute the total HI mass without deriving a field?
Thanks,
Jingjing
--
Jingjing Chen [ chenjj235(a)gmail.com ]
Department of Astronomy
Columbia University
550 West 120th Street
New York, New York 10027
Cell Phone: +1(347)5746709
_______________________________________________
yt-users mailing list
yt-users(a)lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
Dear yt-users,
I was trying to calculate only the total mass of cold gas(<1e4.5) within a
sphere and I tried the following script:
ds=yt.load('RedshiftOutputxxxx')
sp = ds.sphere(center,radius)
*spcut = sp.cut_region(["obj['temperature']<1e4.5"])*
*spcut.quantities.total_mass()*
But I got an error that says:
yt.utilities.exceptions.YTMixedCutRegion: Can't mix particle/discrete and
fluid/mesh conditions or
quantities. Field: ('all', 'particle_mass') and Conditions specified:
obj['temperature']<1e4.5
Does anyone know how to fix it?
Thanks,
Jingjing
--
Jingjing Chen [ chenjj235(a)gmail.com ]
Department of Astronomy
Columbia University
550 West 120th Street
New York, New York 10027
Cell Phone: +1(347)5746709
_______________________________________________
yt-users mailing list
yt-users(a)lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
Hi, I *think* I introduced this problem when switching from version 2 to
version 3...I am currently running version 3.1.
I define a derived field, number density, from the original density field,
but something seems to be wrong with the units. I cannot make a sliceplot
(as I used to be able to, in the old version), and I get other "unit
conversion errors".
thanks,
kathy
This cell works ok:
def _numdens(field, data):
return data["dens"]/(2.36*10**(-24))
ds.add_field("numdens", function=_numdens, units="1/cm**3")
This cell does NOT work, and I get a very similar error when trying to do a
sliceplot:
maxval_numdens, maxloc_numdens = ds.find_max('numdens')
print maxval_numdens
print maxloc_numdens
YTUnitConversionError Traceback (most recent call
last)<ipython-input-12-8b3af9af1cf1> in <module>()----> 1
maxval_numdens, maxloc_numdens = ds.find_max('numdens') 2 print
maxval_numdens 3 print maxloc_numdens
/home/kde/yt-x86_64/src/yt-hg/yt/data_objects/static_output.pyc in
find_max(self, field) 524 source = self.all_data() 525
max_val, maxi, mx, my, mz = \--> 526
source.quantities.max_location(field) 527 mylog.info("Max
Value is %0.5e at %0.16f %0.16f %0.16f", 528 max_val,
mx, my, mz)
/home/kde/yt-x86_64/src/yt-hg/yt/data_objects/derived_quantities.pyc
in __call__(self, field) 524 525 def __call__(self,
field):--> 526 rv = super(MaxLocation, self).__call__(field)
527 if len(rv) == 1: rv = rv[0] 528 return rv
/home/kde/yt-x86_64/src/yt-hg/yt/data_objects/derived_quantities.pyc
in __call__(self, *args, **kwargs) 54 storage = {} 55
for sto, ds in parallel_objects(chunks, -1, storage =
storage):---> 56 sto.result = self.process_chunk(ds,
*args, **kwargs) 57 # Now storage will have everything,
and will be done via pickling, so 58 # the units will be
preserved. (Credit to Nathan for this
/home/kde/yt-x86_64/src/yt-hg/yt/data_objects/derived_quantities.pyc
in process_chunk(self, data, field) 535 mz =
array_like_field(data, -1, "z") 536 maxi = -1--> 537
if data[field].size > 0: 538 maxi =
np.argmax(data[field]) 539 ma = data[field][maxi]
/home/kde/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.pyc in
__getitem__(self, key) 246 return
self.field_data[f] 247 else:--> 248
self.get_data(f) 249 # fi.units is the unit expression
string. We depend on the registry 250 # hanging off the
dataset to define this unit object.
/home/kde/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.pyc in
get_data(self, fields) 691 692 fields_to_generate +=
gen_fluids + gen_particles--> 693
self._generate_fields(fields_to_generate) 694 for field in
self.field_data.keys(): 695 if field not in ofields:
/home/kde/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.pyc in
_generate_fields(self, fields_to_generate) 717
raise RuntimeError 718
self.field_data[field] = fd--> 719
fd.convert_to_units(fi.units) 720 except
GenerationInProgress as gip: 721 for f in
gip.fields:
/home/kde/yt-x86_64/src/yt-hg/yt/units/yt_array.pyc in
convert_to_units(self, units) 387 388 """--> 389
new_units = self._unit_repr_check_same(units) 390
(conversion_factor, offset) =
self.units.get_conversion_factor(new_units) 391
/home/kde/yt-x86_64/src/yt-hg/yt/units/yt_array.pyc in
_unit_repr_check_same(self, units) 373 if not
self.units.same_dimensions_as(units): 374 raise
YTUnitConversionError(--> 375 self.units,
self.units.dimensions, units, units.dimensions) 376 377
return units
YTUnitConversionError: Unit dimensionalities do not match. Tried to
convert between code_mass/code_length**3 (dim (mass)/(length)**3) and
cm**(-3) (dim (length)**(-3)).
--
Kathy DeGioia Eastwood, Ph.D.
Professor of Physics and Astronomy
Northern Arizona University
Flagstaff, AZ 86011-6010
Ph: 928-523-7159 FX: 928-523-1371
Kathy.Eastwood(a)nau.edu
deliveries: 602 S. Humphreys St., Bldg 19 Rm 209
_______________________________________________
yt-users mailing list
yt-users(a)lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
Hello,
I am getting an error when I am trying to run examples given in darkskysims/darksky_tour.
The examples uses yt to load the data. The script looks like this :
import sys
import matplotlib; matplotlib.use('Agg')
from dark_loader import load_halo, prefix
import yt
if __name__ == "__main__":
root_dir = prefix + 'ds14_a/'
particles = root_dir + "ds14_a_1.0000"
halos = root_dir + "halos/ds14_a_halos_1.0000"
halo_num = 0
if len(sys.argv) > 1:
halo_num = int(sys.argv[-1])
pds, halo, center, radius = load_halo(particles, halos, halo_num)
p = yt.ProjectionPlot(pds, 0, "dark_matter_density",
weight_field=None)
p.annotate_sphere(center, radius, circle_args={'color':'r'})
p.annotate_title(r"$M_{200b} = %0.2e \mathrm{M_{\odot}/h}$" % halo['m200b'])
p.set_cmap("all", "RdGy_r")
p.set_axes_unit("Mpccm/h")
p.set_zlim('all', 1.0e-3, 1.0)
p.save('halo_%04i' % halo_num)
And it gives me the following output:
...
File "//anaconda/lib/python2.7/site-packages/yt/visualization/plot_window.py", line 1227, in __init__
field_parameters = field_parameters, method = method)
File "//anaconda/lib/python2.7/site-packages/yt/data_objects/construction_data_containers.py", line 250, in __init__
self.get_data(field)
File "//anaconda/lib/python2.7/site-packages/yt/data_objects/construction_data_containers.py", line 295, in get_data
chunk_fields, "io", local_only = True)):
File "//anaconda/lib/python2.7/site-packages/yt/utilities/parallel_tools/parallel_analysis_interface.py", line 506, in parallel_objects
for obj_id, obj in oiter:
File "//anaconda/lib/python2.7/site-packages/yt/data_objects/data_containers.py", line 588, in chunks
self.get_data() # Ensure we have built ourselves
File "//anaconda/lib/python2.7/site-packages/yt/data_objects/data_containers.py", line 622, in get_data
self.index._identify_base_chunk(self)
File "//anaconda/lib/python2.7/site-packages/yt/geometry/particle_geometry_handler.py", line 140, in _identify_base_chunk
self.regions.identify_data_files(dobj.selector)]
File "//anaconda/lib/python2.7/site-packages/yt/data_objects/data_containers.py", line 583, in selector
self._selector = sclass(self)
File "yt/geometry/selection_routines.pyx", line 721, in yt.geometry.selection_routines.RegionSelector.__init__ (build/src.macosx-10.5-x86_64-2.7/yt/geometry/selection_routines.c:14458)
ValueError: Buffer dtype mismatch, expected 'float64_t' but got 'float'
Can anyone please help me. I will really appreciate it.
_______________________________________________
yt-users mailing list
yt-users(a)lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
anybody else having this problem? for example, I am trying to look at
http://lists.spacepope.org/pipermail/yt-users-spacepope.org/2013-October/01…
and get the response
Forbidden
You don't have permission to access /pipermail/
yt-users-spacepope.org/2013-October/019534.html on this server.
Additionally, a 404 Not Found error was encountered while trying to use an
ErrorDocument to handle the request.
thanks
kathy
--
Kathy DeGioia Eastwood, Ph.D.
Professor of Physics and Astronomy
Northern Arizona University
Flagstaff, AZ 86011-6010
Ph: 928-523-7159 FX: 928-523-1371
Kathy.Eastwood(a)nau.edu
deliveries: 602 S. Humphreys St., Bldg 19 Rm 209
_______________________________________________
yt-users mailing list
yt-users(a)lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
Dear yt-users,
I am having a little problem on finding the exact center of a halo. I used
to do
"hc = HaloCatalog(data_ds=data_ds, finder_method='hop')"
to create a halo catalog. But I think the position in the catalog is a
little bit off the exact center judging from the plots I made. I need the
exact center to compute the angular momentum so the off-center result could
cause some problem. I tried to recenter at the maximum gas density by
adding this line
"hc.sphere_field_max_recenter('density')"
But I got an error, AttributeError: 'HaloCatalog' object has no attribute
'sphere_field_max_recenter'.
Can anyone tell me what is the right way to find the center as the location
of maximum gas density?
Thanks,
Jingjing
--
Jingjing Chen [ chenjj235(a)gmail.com ]
Department of Astronomy
Columbia University
550 West 120th Street
New York, New York 10027
Cell Phone: +1(347)5746709
_______________________________________________
yt-users mailing list
yt-users(a)lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org