yt-users
Threads by month
- ----- 2025 -----
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
May 2019
- 19 participants
- 17 discussions

May 14, 2019
Hi,
Following the commit (https://github.com/yt-project/yt/pull/2259), I am
unable to access the field 'particle_age' which I was able to do before.
The list of fields I currently have for my RAMSES data is:
> ('all', 'mesh_id')
>
> ('all', 'particle_angular_momentum')
>
> ('all', 'particle_angular_momentum_magnitude')
>
> ('all', 'particle_angular_momentum_x')
>
> ('all', 'particle_angular_momentum_y')
>
> ('all', 'particle_angular_momentum_z')
>
> ('all', 'particle_cylindrical_velocity_theta')
>
> ('all', 'particle_cylindrical_velocity_z')
>
> ('all', 'particle_extra_field_1')
>
> ('all', 'particle_extra_field_2')
>
> ('all', 'particle_extra_field_3')
>
> ('all', 'particle_extra_field_4')
>
> ('all', 'particle_extra_field_5')
>
> ('all', 'particle_identity')
>
> ('all', 'particle_index')
>
> ('all', 'particle_mass')
>
> ('all', 'particle_ones')
>
> ('all', 'particle_position')
>
> ('all', 'particle_position_cylindrical_radius')
>
> ('all', 'particle_position_cylindrical_theta')
>
> ('all', 'particle_position_cylindrical_z')
>
> ('all', 'particle_position_relative')
>
> ('all', 'particle_position_relative_x')
>
> ('all', 'particle_position_relative_y')
>
> ('all', 'particle_position_relative_z')
>
> ('all', 'particle_position_spherical_phi')
>
> ('all', 'particle_position_spherical_radius')
>
> ('all', 'particle_position_spherical_theta')
>
> ('all', 'particle_position_x')
>
> ('all', 'particle_position_y')
>
> ('all', 'particle_position_z')
>
> ('all', 'particle_radial_velocity')
>
> ('all', 'particle_radius')
>
> ('all', 'particle_refinement_level')
>
> ('all', 'particle_specific_angular_momentum')
>
> ('all', 'particle_specific_angular_momentum_x')
>
> ('all', 'particle_specific_angular_momentum_y')
>
> ('all', 'particle_specific_angular_momentum_z')
>
> ('all', 'particle_spherical_position_phi')
>
> ('all', 'particle_spherical_position_radius')
>
> ('all', 'particle_spherical_position_theta')
>
> ('all', 'particle_spherical_velocity_phi')
>
> ('all', 'particle_spherical_velocity_radius')
>
> ('all', 'particle_spherical_velocity_theta')
>
> ('all', 'particle_velocity')
>
> ('all', 'particle_velocity_cylindrical_radius')
>
> ('all', 'particle_velocity_cylindrical_theta')
>
> ('all', 'particle_velocity_cylindrical_z')
>
> ('all', 'particle_velocity_magnitude')
>
> ('all', 'particle_velocity_relative')
>
> ('all', 'particle_velocity_relative_x')
>
> ('all', 'particle_velocity_relative_y')
>
> ('all', 'particle_velocity_relative_z')
>
> ('all', 'particle_velocity_spherical_phi')
>
> ('all', 'particle_velocity_spherical_radius')
>
> ('all', 'particle_velocity_spherical_theta')
>
> ('all', 'particle_velocity_x')
>
> ('all', 'particle_velocity_y')
>
> ('all', 'particle_velocity_z')
>
> ('all', 'relative_particle_position')
>
> ('all', 'relative_particle_position_x')
>
> ('all', 'relative_particle_position_y')
>
> ('all', 'relative_particle_position_z')
>
> ('all', 'relative_particle_velocity')
>
> ('all', 'relative_particle_velocity_x')
>
> ('all', 'relative_particle_velocity_y')
>
> ('all', 'relative_particle_velocity_z')
>
I tried the 'extra_fields_x' but none of them match with the dimensions of
time. Any help is appreciated and thanks.
3
5
Hi all,
I'm trying to find a way to access the gravitational field in an Enzo
2.5 simulation. I've tried creating a gradient field of ('gas',
'gravitational_potential') but I am unable to find this under the
ds.derived_field_list either. Has anybody else been successful in
extracting this information from an Enzo dataset? I'm currently running
version 3.7.1 of Python and 3.5.0 of yt.
Many thanks,
Sam Patrick
2
1
Hello all,
I am making some profile plot for Gadget simualtion using yt (Version = 3.5.dev0 Changeset = ba2b2efe8962),
but the resulting plot unit is mismatched with both yt-3 & 4.[The x-axis unit is extremly big 1e22kpc]
I tested my script with Gadget example file (http://yt-project.org/data/GadgetDiskGalaxy.tar.gz), but that has same problem.
The below is my script.
import numpy
import yt
bb=100000
pf=yt.load('snapshot_200.hdf5'
,bounding_box=[[-bb,bb], [-bb, bb], [-bb,bb]])
figure_width=100
def _particle_position_cylindrical_z_abs(field, data):
return numpy.abs(data[("PartType0", "particle_position_cylindrical_z")])
pf.add_field(("PartType0", "particle_position_cylindrical_z_abs"),
function=_particle_position_cylindrical_z_abs, take_log=False, particle_type=True, units="kpc")
v, cen = pf.h.find_max(("gas", "density"))
sp = pf.sphere(cen, (0.5*figure_width, "kpc"))
sp.set_field_parameter("normal", (0,0,1))
pf.field_info[("PartType0", "particle_position_cylindrical_z_abs")].take_log = False
p = yt.ProfilePlot(sp, ("PartType0", "particle_position_cylindrical_z_abs"), ("PartType0", "density"), weight_field=None, n_bins=80, x_log=False, accumulation=False)
p.set_unit(("PartType0", "density"), 'g/cm**3')
p.set_unit(("PartType0", "particle_position_cylindrical_z_abs"), 'kpc')
p.show()
This is the resulting plot of the Gadget example file of yt,
https://drive.google.com/file/d/1FGx2izfsnGrwP26SZ6JlfuIegz8eGVKo/view?usp=…
Could I get some advice for this problem?
Thank you in advance!
Eun-jin
2
2
Hello, hope you are doing well. I followed the steps to making a region and
then making a projection of a field in this region. This step didn't give
me an error, however when I tried to print this data, I get the following
output,
YTQuadTreeProj (ISM_hdf5_chk_0033): , axis=2, field=[('gas', 'ndens')],
weight_field=('gas', 'ndens')
but I expected it to print the values themselves. I was wondering how can I
access this array and work with the data?
--
Edward N. Buie II,
*Ph.D. Candidate*
Astrophysics
School of Earth and Space Exploration (SESE)
Arizona State University
2
1

May 4, 2019
Hey,
Indeed, the previous version was actually able to read these files —
even if invalid. The code should have never worked in the first place if
it wanted to be compliant with the binary format RAMSES uses. I think
that the easiest fix is to use a version of yt prior to commit
#016c7e04bdf443d16b0431369be364dbb152e4ed
(https://github.com/yt-project/yt/commit/016c7e04bdf443d16b0431369be364dbb15…).
The latest release that do /not/ include this commit is yt 3.4.1. If you
installed yt using git, you can easily switch to yt 3.4.1 by running in
the folder that contains yt
|git checkout yt-3.4.1 pip install . |
If installed via conda, simpy run |conda install -c conda-forge yt=3.4.1|.
Cheers,
Corentin
On 03/05/2019 15.33, Vadlamani Samhitha wrote:
> I see. Thank you. But I’m pretty positive I didn’t face this issue
> with the version I had before ( 3.4.0 ) as I was able to get the
> required plots. It’s just that when I upgraded and trying to do the
> same plots that I face this issue and I am unable get back to the
> older version now. Is there a possibility that outputs could have been
> corrupted during the upgrade somehow?
>
> On Fri, 3 May 2019 at 3:25 PM, Corentin CADIOU <contact(a)cphyc.me
> <mailto:contact@cphyc.me>> wrote:
>
> Hi,
>
> The issue is that your amr file does not contain any value for the
> field ‘mass_sph’. In fact, yt should /not/ haver never been able
> to read it because the structure is somehow broken.
>
> Here’s what I get from your file (as read by yt)
>
> |ncpu [4, 30, 4] ndim [4, 3, 4] nx [12, 3, 3, 3, 12] nlevelmax [4,
> 11, 4] ngridmax [4, 2000000, 4] nboundary [4, 6, 4] ngrid_current
> [4, 8722, 4] boxlen [8, 2000.0, 8] nout [12, 1, 1, 2, 12] tout [8,
> 50000.0, 8] aout [8, 1.100000023841858, 8] t [8, 0.0, 8] dtold
> [88, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 88]
> dtnew [88, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
> 88] nstep [8, 0, 0, 8] stat [24, 0.0, 0.0, 0.0, 24] cosm [56, 1.0,
> 0.0, 0.0, 0.0, 1.0, 10.0, 0.0, 56] timing [40, 1.0, 0.0, 1.0, 0.0,
> 0.0, 40] mass_sph [0, 2.801034444074e-311, 0] |
>
> The first and last item of each list are the length of each record
> (in bytes). For example the first record that contains ncpu has a
> length of 4 bytes and contains the value 30 (ncpu=30). However,
> the last record (mass_sph) has a length of 0 even though one even
> though it is not empty. I am not sure how that could happen, but
> it’s definitely on RAMSES side. The last line should read
> |mass_sph [8, 2.801034444074e-311, 8]|.
>
> I have to think about how that could be fixed.
>
> On 03/05/2019 14.56, Vadlamani Samhitha wrote:
>
>> Hi,
>>
>> If it's only one of the air files, I'm attaching it below. Let me
>> know if you would need the entire output folder too. Thank you.
>>
>> On Fri, May 3, 2019 at 2:52 PM Corentin CADIOU <contact(a)cphyc.me
>> <mailto:contact@cphyc.me>> wrote:
>>
>> Hey Vadlamani,
>>
>> This looks like a bug to me. Could you share one of your file
>> |amr_xxxxx.out00001|? It looks like yt has troubles reading
>> the headers.
>>
>> This can either be due to a backward incompatible change on
>> yt side (which would be a bug) or maybe your file became
>> corrupted at some point.
>>
>> Cheers,
>> Corentin
>>
>> On 02/05/2019 18.03, Vadlamani Samhitha wrote:
>>
>>> Hi,
>>>
>>> I was able to upgrade to the latest version and still have
>>> an issue with annotating particles on density map. I'm
>>> getting the following error:
>>>
>>> Traceback (most recent call last):
>>>
>>> File "density.py", line 47, in <module>
>>>
>>> plot = yt.ProjectionPlot(ds, 'z', 'density', width=(800,
>>> "kpc"), center="c")
>>>
>>> File
>>> "/home/samvad/yt-conda/lib/python3.7/site-packages/yt/visualization/plot_window.py",
>>> line 1464, in __init__
>>>
>>> validate_mesh_fields(test_data_source, fields)
>>>
>>> File
>>> "/home/samvad/yt-conda/lib/python3.7/site-packages/yt/visualization/plot_window.py",
>>> line 132, in validate_mesh_fields
>>>
>>> canonical_fields = data_source._determine_fields(fields)
>>>
>>> File
>>> "/home/samvad/yt-conda/lib/python3.7/site-packages/yt/data_objects/data_containers.py",
>>> line 1165, in _determine_fields
>>>
>>> finfo = self.ds._get_field_info("unknown", fname)
>>>
>>> File
>>> "/home/samvad/yt-conda/lib/python3.7/site-packages/yt/data_objects/static_output.py",
>>> line 756, in _get_field_info
>>>
>>> self.index
>>>
>>> File
>>> "/home/samvad/yt-conda/lib/python3.7/site-packages/yt/data_objects/static_output.py",
>>> line 509, in index
>>>
>>> self, dataset_type=self.dataset_type)
>>>
>>> File
>>> "/home/samvad/yt-conda/lib/python3.7/site-packages/yt/frontends/ramses/data_structures.py",
>>> line 236, in __init__
>>>
>>> super(RAMSESIndex, self).__init__(ds, dataset_type)
>>>
>>> File
>>> "/home/samvad/yt-conda/lib/python3.7/site-packages/yt/geometry/geometry_handler.py",
>>> line 50, in __init__
>>>
>>> self._setup_geometry()
>>>
>>> File
>>> "/home/samvad/yt-conda/lib/python3.7/site-packages/yt/geometry/oct_geometry_handler.py",
>>> line 25, in _setup_geometry
>>>
>>> self._initialize_oct_handler()
>>>
>>> File
>>> "/home/samvad/yt-conda/lib/python3.7/site-packages/yt/frontends/ramses/data_structures.py",
>>> line 245, in _initialize_oct_handler
>>>
>>> for i in cpu_list]
>>>
>>> File
>>> "/home/samvad/yt-conda/lib/python3.7/site-packages/yt/frontends/ramses/data_structures.py",
>>> line 245, in <listcomp>
>>>
>>> for i in cpu_list]
>>>
>>> File
>>> "/home/samvad/yt-conda/lib/python3.7/site-packages/yt/frontends/ramses/data_structures.py",
>>> line 82, in __init__
>>>
>>> self._read_amr_header()
>>>
>>> File
>>> "/home/samvad/yt-conda/lib/python3.7/site-packages/yt/frontends/ramses/data_structures.py",
>>> line 141, in _read_amr_header
>>>
>>> hvals.update(f.read_attrs(header))
>>>
>>> File "yt/utilities/cython_fortran_utils.pyx", line 223, in
>>> yt.utilities.cython_fortran_utils.FortranFile.read_attrs
>>>
>>> IndexError: index 0 is out of bounds for axis 0 with size 0
>>>
>>>
>>>
>>>
>>> On Tue, Apr 30, 2019 at 4:39 AM Vadlamani Samhitha
>>> <vadlamani.samhitha(a)gmail.com
>>> <mailto:vadlamani.samhitha@gmail.com>> wrote:
>>>
>>> Downgraded to initial version, but the 'Index error'
>>> still persists. Did a conda installation from scratch
>>> too. Reported it as a bug.
>>>
>>> On Mon, Apr 29, 2019 at 6:00 PM Nathan Goldbaum
>>> <nathan12343(a)gmail.com <mailto:nathan12343@gmail.com>>
>>> wrote:
>>>
>>> Hmm, I'm not sure, perhaps try uninstalling pyembree?
>>>
>>> You can also try creating a new conda environment
>>> from scratch.
>>>
>>> On Mon, Apr 29, 2019 at 10:56 AM Vadlamani Samhitha
>>> <vadlamani.samhitha(a)gmail.com
>>> <mailto:vadlamani.samhitha@gmail.com>> wrote:
>>>
>>> Thanks again, sorry but looks like I've messed
>>> up the installation. The installation wasn't
>>> right and I don't get the issue.
>>>
>>> Upon doing yt --help I get:
>>>
>>> Traceback (most recent call last):
>>>
>>> File "/home/samvad/yt-conda/bin/yt", line
>>> 4, in <module>
>>>
>>> import yt.utilities.command_line
>>>
>>> File
>>> "/home/samvad/yt-conda/lib/python3.6/site-packages/yt/__init__.py",
>>> line 102, in <module>
>>>
>>> from yt.visualization.api import \
>>>
>>> File
>>> "/home/samvad/yt-conda/lib/python3.6/site-packages/yt/visualization/api.py",
>>> line 22, in <module>
>>>
>>> from .particle_plots import \
>>>
>>> File
>>> "/home/samvad/yt-conda/lib/python3.6/site-packages/yt/visualization/particle_plots.py",
>>> line 18, in <module>
>>>
>>> from yt.visualization.fixed_resolution
>>> import \
>>>
>>> File
>>> "/home/samvad/yt-conda/lib/python3.6/site-packages/yt/visualization/fixed_resolution.py",
>>> line 23, in <module>
>>>
>>> from .volume_rendering.api import
>>> off_axis_projection
>>>
>>> File
>>> "/home/samvad/yt-conda/lib/python3.6/site-packages/yt/visualization/volume_rendering/api.py",
>>> line 23, in <module>
>>>
>>> from .camera import Camera
>>>
>>> File
>>> "/home/samvad/yt-conda/lib/python3.6/site-packages/yt/visualization/volume_rendering/camera.py",
>>> line 21, in <module>
>>>
>>> from .utils import data_source_or_all
>>>
>>> File
>>> "/home/samvad/yt-conda/lib/python3.6/site-packages/yt/visualization/volume_rendering/utils.py",
>>> line 11, in <module>
>>>
>>> from yt.utilities.lib import mesh_traversal
>>>
>>> File "rtcore_scene.pxd", line 61, in init
>>> yt.utilities.lib.mesh_traversal
>>>
>>> ValueError:
>>> pyembree.rtcore_scene.EmbreeScene has the
>>> wrong size, try recompiling. Expected 32, got 24
>>>
>>> -bash-4.2$ yt version
>>>
>>> Traceback (most recent call last):
>>>
>>> File "/home/samvad/yt-conda/bin/yt", line
>>> 4, in <module>
>>>
>>> import yt.utilities.command_line
>>>
>>> File
>>> "/home/samvad/yt-conda/lib/python3.6/site-packages/yt/__init__.py",
>>> line 102, in <module>
>>>
>>> from yt.visualization.api import \
>>>
>>> File
>>> "/home/samvad/yt-conda/lib/python3.6/site-packages/yt/visualization/api.py",
>>> line 22, in <module>
>>>
>>> from .particle_plots import \
>>>
>>> File
>>> "/home/samvad/yt-conda/lib/python3.6/site-packages/yt/visualization/particle_plots.py",
>>> line 18, in <module>
>>>
>>> from yt.visualization.fixed_resolution
>>> import \
>>>
>>> File
>>> "/home/samvad/yt-conda/lib/python3.6/site-packages/yt/visualization/fixed_resolution.py",
>>> line 23, in <module>
>>>
>>> from .volume_rendering.api import
>>> off_axis_projection
>>>
>>> File
>>> "/home/samvad/yt-conda/lib/python3.6/site-packages/yt/visualization/volume_rendering/api.py",
>>> line 23, in <module>
>>>
>>> from .camera import Camera
>>>
>>> File
>>> "/home/samvad/yt-conda/lib/python3.6/site-packages/yt/visualization/volume_rendering/camera.py",
>>> line 21, in <module>
>>>
>>> from .utils import data_source_or_all
>>>
>>> File
>>> "/home/samvad/yt-conda/lib/python3.6/site-packages/yt/visualization/volume_rendering/utils.py",
>>> line 11, in <module>
>>>
>>> from yt.utilities.lib import mesh_traversal
>>>
>>> File "rtcore_scene.pxd", line 61, in init
>>> yt.utilities.lib.mesh_traversal
>>>
>>> ValueError:
>>> pyembree.rtcore_scene.EmbreeScene has the
>>> wrong size, try recompiling. Expected 32, got 24
>>>
>>> -bash-4.20.9169398134926968nbsp;
>>>
>>>
>>>
>>> On Mon, Apr 29, 2019 at 5:30 PM Nathan Goldbaum
>>> <nathan12343(a)gmail.com
>>> <mailto:nathan12343@gmail.com>> wrote:
>>>
>>> Sure, you can use conda to install any
>>> version of any package. Just specify the
>>> version when you install:
>>>
>>> conda install -c conda-forge yt=3.4.1
>>>
>>> On Mon, Apr 29, 2019 at 10:27 AM Vadlamani
>>> Samhitha <vadlamani.samhitha(a)gmail.com
>>> <mailto:vadlamani.samhitha@gmail.com>> wrote:
>>>
>>> Will do, but is it possible to revert to
>>> the old version for now since none of my
>>> scripts are working with the latest
>>> version? A fresh installation of 3.4.0?
>>>
>>> On Mon, Apr 29, 2019 at 3:25 PM Nathan
>>> Goldbaum <nathan12343(a)gmail.com
>>> <mailto:nathan12343@gmail.com>> wrote:
>>>
>>> Hmm, not sure what’s happening
>>> there, you might need to report this
>>> as a bug on yt’s github, if you can
>>> please include a data file and
>>> script that triggers this error.
>>>
>>> On Mon, Apr 29, 2019 at 8:00 AM
>>> Vadlamani Samhitha
>>> <vadlamani.samhitha(a)gmail.com
>>> <mailto:vadlamani.samhitha@gmail.com>>
>>> wrote:
>>>
>>> Thank you, have done the upgrade
>>> but the following error is
>>> popping up:
>>>
>>> Traceback (most recent call
>>> last):
>>>
>>> File "density.py", line
>>> 43, in <module>
>>>
>>>
>>> ds.add_field(name=("gas",
>>> "density_threshold"),
>>> function=density_threshold,
>>> units="H/cm**3")
>>>
>>> File
>>> "/home/samvad/yt-conda/lib/python3.7/site-packages/yt/data_objects/static_output.py",
>>> line 1227, in add_field
>>>
>>> self.index
>>>
>>> File
>>> "/home/samvad/yt-conda/lib/python3.7/site-packages/yt/data_objects/static_output.py",
>>> line 509, in index
>>>
>>> self,
>>> dataset_type=self.dataset_type)
>>>
>>> File
>>> "/home/samvad/yt-conda/lib/python3.7/site-packages/yt/frontends/ramses/data_structures.py",
>>> line 236, in __init__
>>>
>>> super(RAMSESIndex,
>>> self).__init__(ds, dataset_type)
>>>
>>> File
>>> "/home/samvad/yt-conda/lib/python3.7/site-packages/yt/geometry/geometry_handler.py",
>>> line 50, in __init__
>>>
>>> self._setup_geometry()
>>>
>>> File
>>> "/home/samvad/yt-conda/lib/python3.7/site-packages/yt/geometry/oct_geometry_handler.py",
>>> line 25, in _setup_geometry
>>>
>>>
>>> self._initialize_oct_handler()
>>>
>>> File
>>> "/home/samvad/yt-conda/lib/python3.7/site-packages/yt/frontends/ramses/data_structures.py",
>>> line 245, in
>>> _initialize_oct_handler
>>>
>>> for i in cpu_list]
>>>
>>> File
>>> "/home/samvad/yt-conda/lib/python3.7/site-packages/yt/frontends/ramses/data_structures.py",
>>> line 245, in <listcomp>
>>>
>>> for i in cpu_list]
>>>
>>> File
>>> "/home/samvad/yt-conda/lib/python3.7/site-packages/yt/frontends/ramses/data_structures.py",
>>> line 82, in __init__
>>>
>>> self._read_amr_header()
>>>
>>> File
>>> "/home/samvad/yt-conda/lib/python3.7/site-packages/yt/frontends/ramses/data_structures.py",
>>> line 141, in _read_amr_header
>>>
>>>
>>> hvals.update(f.read_attrs(header))
>>>
>>> File
>>> "yt/utilities/cython_fortran_utils.pyx",
>>> line 223, in
>>> yt.utilities.cython_fortran_utils.FortranFile.read_attrs
>>>
>>> IndexError: index 0 is out
>>> of bounds for axis 0 with size 0
>>>
>>>
>>> On Mon, Apr 29, 2019 at 1:51 PM
>>> Nathan Goldbaum
>>> <nathan12343(a)gmail.com
>>> <mailto:nathan12343@gmail.com>>
>>> wrote:
>>>
>>> Yes, use conda-forge:
>>>
>>> conda update -c conda-forge yt
>>>
>>> On Mon, Apr 29, 2019 at 6:32
>>> AM Vadlamani Samhitha
>>> <vadlamani.samhitha(a)gmail.com
>>> <mailto:vadlamani.samhitha@gmail.com>>
>>> wrote:
>>>
>>> I installed yt from
>>> conda so, yt update is
>>> only being done to 3.4.1
>>> version with 'yt conda
>>> update' and with this my
>>> scripts are throwing
>>> assertion errors. Is
>>> there a way I could do a
>>> conda update to the
>>> latest version specifically?
>>>
>>> On Mon, Apr 29, 2019 at
>>> 1:05 PM Nathan Goldbaum
>>> <nathan12343(a)gmail.com
>>> <mailto:nathan12343@gmail.com>>
>>> wrote:
>>>
>>> The latest stable
>>> release is 3.5.1,
>>> please try updating
>>> your yt installation.
>>>
>>> On Mon, Apr 29, 2019
>>> at 5:58 AM Vadlamani
>>> Samhitha
>>> <vadlamani.samhitha(a)gmail.com
>>> <mailto:vadlamani.samhitha@gmail.com>>
>>> wrote:
>>>
>>> 3.4.0
>>>
>>> On Mon, Apr 29,
>>> 2019 at 12:52 PM
>>> Nathan Goldbaum
>>> <nathan12343(a)gmail.com
>>> <mailto:nathan12343@gmail.com>>
>>> wrote:
>>>
>>> What yt
>>> version are
>>> you using?
>>>
>>> On Mon, Apr
>>> 29, 2019 at
>>> 5:34 AM
>>> Vadlamani
>>> Samhitha
>>> <vadlamani.samhitha(a)gmail.com
>>> <mailto:vadlamani.samhitha@gmail.com>>
>>> wrote:
>>>
>>> Hi, I
>>> did try
>>> that as
>>> well,
>>> but
>>> doing so
>>> gives
>>> 'unexpected
>>> keyword'
>>> error.
>>>
>>> Traceback
>>> (most
>>> recent
>>> call
>>> last):
>>>
>>>
>>> File
>>> "density.py",
>>> line
>>> 57,
>>> in
>>> <module>
>>>
>>>
>>> plot.save(fil)
>>>
>>>
>>> File
>>> "/home/samvad/yt-conda/lib/python3.6/site-packages/yt/visualization/plot_container.py",
>>> line
>>> 94,
>>> in
>>> newfunc
>>>
>>>
>>> args[0]._setup_plots()
>>>
>>>
>>> File
>>> "/home/samvad/yt-conda/lib/python3.6/site-packages/yt/visualization/plot_window.py",
>>> line
>>> 948,
>>> in
>>> _setup_plots
>>>
>>>
>>> self.run_callbacks()
>>>
>>>
>>> File
>>> "/home/samvad/yt-conda/lib/python3.6/site-packages/yt/visualization/plot_window.py",
>>> line
>>> 997,
>>> in
>>> run_callbacks
>>>
>>>
>>> callback
>>> =
>>> CallbackMaker(*args[1:],
>>> **kwargs)
>>>
>>> TypeError:
>>> __init__()
>>> got
>>> an
>>> unexpected
>>> keyword
>>> argument
>>> 'data_source'
>>>
>>>
>>>
>>>
>>> On Mon,
>>> Apr 29,
>>> 2019 at
>>> 12:18 PM
>>> Wise,
>>> John H
>>> <jwise(a)physics.gatech.edu
>>> <mailto:jwise@physics.gatech.edu>>
>>> wrote:
>>>
>>> Hi,
>>>
>>> Because
>>> there
>>> are
>>> many
>>> optional
>>> arguments
>>> to
>>> annotate_particles,
>>> you
>>> have
>>> to
>>> specify
>>> that
>>> dd
>>> is
>>> the
>>> data_source.
>>> Try
>>>
>>> plot.annotate_particles(1.0,
>>> data_source=dd)
>>>
>>> John
>>>
>>> On
>>> 4/27/2019
>>> 15:46,
>>> Vadlamani
>>> Samhitha
>>> wrote:
>>> > Hi,
>>> >
>>> > I
>>> am
>>> trying
>>> to
>>> overlap
>>> two
>>> different
>>> projection
>>> plots
>>> (particles
>>> and
>>> >
>>> density)
>>> with
>>> two
>>> different
>>> color
>>> bars.
>>> However,
>>> I
>>> couldn't
>>> figure
>>> out a
>>> >
>>> way
>>> to
>>> do
>>> that
>>> but
>>> found
>>> over
>>> plotting
>>> particles
>>> over
>>> fluids.
>>> >
>>> >
>>> So,
>>> I
>>> have
>>> RAMSES
>>> data
>>> which
>>> can't
>>> distinguish
>>> between
>>> dark
>>> matter
>>> and
>>> >
>>> stars
>>> through
>>> particle
>>> types
>>> but
>>> only
>>> with
>>> mass
>>> cut_off.
>>> So I
>>> create
>>> a
>>> >
>>> filter
>>> for
>>> the
>>> particles
>>> accordingly
>>> and
>>> supply
>>> it
>>> as
>>> the
>>> 'data_source'
>>>
>>> >
>>> argument
>>> in
>>> 'annotate_particles'.
>>> So,
>>> I do
>>> the
>>> following:
>>> >
>>> >
>>> defstars(pfilter,
>>> data):
>>> >
>>> >
>>> #
>>> age
>>> =
>>> (data.ds.current_time
>>> -
>>> data[pfilter.filtered_type,
>>> >
>>> "particle_birth_time"]).in_units('Myr')
>>> >
>>> >
>>>
>>>
>>>
>>> stars_only
>>> =
>>> data[pfilter.filtered_type,
>>> >
>>> "particle_mass"].in_units('Msun')
>>> >
>>> >
>>> filter=
>>> (stars_only<4e6)
>>> >
>>> >
>>> returnfilter
>>> >
>>> >
>>> yt.add_particle_filter("stars",
>>> function=stars,
>>> filtered_type='io',
>>> >
>>> requires=["particle_mass"])
>>> >
>>> >
>>> >
>>> ini=1
>>> >
>>> >
>>> fin=2
>>> >
>>> >
>>> forx
>>> inrange(ini,
>>> fin):
>>> >
>>> >
>>> filename="/lunarc/nobackup/users/samvad/SQ-8-5/output/output_%0*d/info_%0*d.txt"
>>>
>>> >
>>> %
>>> (5,x,5,x)
>>> >
>>> >
>>>
>>>
>>> ds
>>> =
>>> yt.load(filename)
>>> >
>>> >
>>>
>>>
>>>
>>> ds.define_unit("H",
>>> (1.674*10**(-24),
>>> "g"))
>>> >
>>> >
>>> defdensity_threshold(field,
>>> data):
>>> >
>>> >
>>>
>>>
>>>
>>>
>>>
>>> dens=data["gas",
>>> "density"].in_units('H/cm**3')
>>> >
>>> >
>>>
>>>
>>>
>>>
>>>
>>> dens[dens
>>> < 0] = 0
>>> >
>>> >
>>> returndens
>>> >
>>> >
>>>
>>>
>>>
>>> ds.add_field(name=("gas",
>>> "density_threshold"),
>>> >
>>> function=density_threshold,
>>> units="H/cm**3")
>>> >
>>> >
>>>
>>>
>>>
>>> ad=ds.all_data()
>>> >
>>> >
>>>
>>>
>>>
>>> denst=ad["gas",
>>> "density_threshold"].in_units('H/cm**3')
>>> >
>>> >
>>> #plot
>>> =
>>> yt.SlicePlot(ds,
>>> 'z',
>>> 'density_threshold',
>>> width=(400,
>>> "kpc"))
>>> >
>>> >
>>>
>>>
>>>
>>> plot
>>> =
>>> yt.ProjectionPlot(ds,
>>> 'z',
>>> 'density',
>>> >
>>> weight_field='density',
>>> width=(800,
>>> "kpc"),
>>> center="c")
>>> >
>>> >
>>>
>>>
>>>
>>> ds.add_particle_filter('stars')
>>> >
>>> >
>>>
>>>
>>>
>>> dd=ds.all_data()
>>> >
>>> >
>>>
>>>
>>>
>>> plot.annotate_particles(1.0,
>>> dd)
>>> >
>>> >
>>>
>>>
>>>
>>> plot.set_cmap(field='density',
>>> cmap='Blues')
>>> >
>>> >
>>>
>>>
>>>
>>> plot.set_unit(("gas",
>>> "density"),
>>> "H/cm**3")
>>> >
>>> >
>>>
>>>
>>>
>>> plot.set_zlim(("gas",
>>> "density"),
>>> 1e-4,
>>> 1e-1)
>>> >
>>> >
>>> plot.annotate_timestamp()
>>> >
>>> >
>>>
>>>
>>> fil="density_%0*d.png"
>>> % (5,x)
>>> >
>>> >
>>>
>>>
>>>
>>> plot.save(fil)
>>> >
>>> >
>>> >
>>> But
>>> ending
>>> up
>>> with
>>> the
>>> error:
>>> >
>>> >
>>> Traceback
>>> (most
>>> recent
>>> call
>>> last):
>>> >
>>> >
>>> File
>>> >
>>> "/home/samvad/yt-conda/lib/python3.6/site-packages/yt/visualization/plot_window.py",
>>>
>>> >
>>> line
>>> 999,
>>> in
>>> run_callbacks
>>> >
>>> >
>>>
>>> callback(cbw)
>>> >
>>> >
>>> File
>>> >
>>> "/home/samvad/yt-conda/lib/python3.6/site-packages/yt/visualization/plot_modifications.py",
>>>
>>> >
>>> line
>>> 53,
>>> in
>>> _check_geometry
>>> >
>>> >
>>>
>>> return
>>> func(self,
>>> plot)
>>> >
>>> >
>>> File
>>> >
>>> "/home/samvad/yt-conda/lib/python3.6/site-packages/yt/visualization/plot_modifications.py",
>>>
>>> >
>>> line
>>> 1563,
>>> in
>>> __call__
>>> >
>>> >
>>>
>>> s=self.p_size,
>>> c=self.color,alpha=self.alpha)
>>> >
>>> >
>>> File
>>> >
>>> "/home/samvad/yt-conda/lib/python3.6/site-packages/matplotlib/__init__.py",
>>>
>>> >
>>> line
>>> 1717,
>>> in inner
>>> >
>>> >
>>>
>>> return
>>> func(ax,
>>> *args,
>>> **kwargs)
>>> >
>>> >
>>> File
>>> >
>>> "/home/samvad/yt-conda/lib/python3.6/site-packages/matplotlib/axes/_axes.py",
>>>
>>> >
>>> line
>>> 4032,
>>> in
>>> scatter
>>> >
>>> >
>>>
>>> alpha=alpha
>>> >
>>> >
>>> File
>>> >
>>> "/home/samvad/yt-conda/lib/python3.6/site-packages/matplotlib/collections.py",
>>>
>>> >
>>> line
>>> 880,
>>> in
>>> __init__
>>> >
>>> >
>>>
>>> self.set_sizes(sizes)
>>> >
>>> >
>>> File
>>> >
>>> "/home/samvad/yt-conda/lib/python3.6/site-packages/matplotlib/collections.py",
>>>
>>> >
>>> line
>>> 853,
>>> in
>>> set_sizes
>>> >
>>> >
>>>
>>> scale
>>> =
>>> np.sqrt(self._sizes)
>>> *
>>> dpi
>>> /
>>> 72.0
>>> *
>>> self._factor
>>> >
>>> >
>>> AttributeError:
>>> 'YTRegion'
>>> object
>>> has
>>> no
>>> attribute
>>> 'sqrt'
>>> >
>>> >
>>> >
>>> During
>>> handling
>>> of
>>> the
>>> above
>>> exception,
>>> another
>>> exception
>>> occurred:
>>> >
>>> >
>>> >
>>> Traceback
>>> (most
>>> recent
>>> call
>>> last):
>>> >
>>> >
>>> File
>>> "density.py",
>>> line
>>> 57,
>>> in
>>> <module>
>>> >
>>> >
>>>
>>> plot.save(fil)
>>> >
>>> >
>>> File
>>> >
>>> "/home/samvad/yt-conda/lib/python3.6/site-packages/yt/visualization/plot_container.py",
>>>
>>> >
>>> line
>>> 94,
>>> in
>>> newfunc
>>> >
>>> >
>>>
>>> args[0]._setup_plots()
>>> >
>>> >
>>> File
>>> >
>>> "/home/samvad/yt-conda/lib/python3.6/site-packages/yt/visualization/plot_window.py",
>>>
>>> >
>>> line
>>> 948,
>>> in
>>> _setup_plots
>>> >
>>> >
>>>
>>> self.run_callbacks()
>>> >
>>> >
>>> File
>>> >
>>> "/home/samvad/yt-conda/lib/python3.6/site-packages/yt/visualization/plot_window.py",
>>>
>>> >
>>> line
>>> 1005,
>>> in
>>> run_callbacks
>>> >
>>> >
>>>
>>> sys.exc_info()[2])
>>> >
>>> >
>>> File
>>> "/home/samvad/yt-conda/lib/python3.6/site-packages/six.py",
>>> line
>>> >
>>> 692,
>>> in
>>> reraise
>>> >
>>> >
>>>
>>> raise
>>> value.with_traceback(tb)
>>> >
>>> >
>>> File
>>> >
>>> "/home/samvad/yt-conda/lib/python3.6/site-packages/yt/visualization/plot_window.py",
>>>
>>> >
>>> line
>>> 999,
>>> in
>>> run_callbacks
>>> >
>>> >
>>>
>>> callback(cbw)
>>> >
>>> >
>>> File
>>> >
>>> "/home/samvad/yt-conda/lib/python3.6/site-packages/yt/visualization/plot_modifications.py",
>>>
>>> >
>>> line
>>> 53,
>>> in
>>> _check_geometry
>>> >
>>> >
>>>
>>> return
>>> func(self,
>>> plot)
>>> >
>>> >
>>> File
>>> >
>>> "/home/samvad/yt-conda/lib/python3.6/site-packages/yt/visualization/plot_modifications.py",
>>>
>>> >
>>> line
>>> 1563,
>>> in
>>> __call__
>>> >
>>> >
>>>
>>> s=self.p_size,
>>> c=self.color,alpha=self.alpha)
>>> >
>>> >
>>> File
>>> >
>>> "/home/samvad/yt-conda/lib/python3.6/site-packages/matplotlib/__init__.py",
>>>
>>> >
>>> line
>>> 1717,
>>> in inner
>>> >
>>> >
>>>
>>> return
>>> func(ax,
>>> *args,
>>> **kwargs)
>>> >
>>> >
>>> File
>>> >
>>> "/home/samvad/yt-conda/lib/python3.6/site-packages/matplotlib/axes/_axes.py",
>>>
>>> >
>>> line
>>> 4032,
>>> in
>>> scatter
>>> >
>>> >
>>>
>>> alpha=alpha
>>> >
>>> >
>>> File
>>> >
>>> "/home/samvad/yt-conda/lib/python3.6/site-packages/matplotlib/collections.py",
>>>
>>> >
>>> line
>>> 880,
>>> in
>>> __init__
>>> >
>>> >
>>>
>>> self.set_sizes(sizes)
>>> >
>>> >
>>> File
>>> >
>>> "/home/samvad/yt-conda/lib/python3.6/site-packages/matplotlib/collections.py",
>>>
>>> >
>>> line
>>> 853,
>>> in
>>> set_sizes
>>> >
>>> >
>>>
>>> scale
>>> =
>>> np.sqrt(self._sizes)
>>> *
>>> dpi
>>> /
>>> 72.0
>>> *
>>> self._factor
>>> >
>>> >
>>> yt.utilities.exceptions.YTPlotCallbackError:
>>> annotate_particles
>>> >
>>> callback
>>> failed
>>> with
>>> the
>>> following
>>> error:
>>> 'YTRegion'
>>> object
>>> has no
>>> >
>>> attribute
>>> 'sqrt'
>>> >
>>> > I
>>> don't
>>> seem to
>>>
4
8
Hi,
I was initially having yt version 3.4.0 that worked well with my RAMSES
data, however when I upgraded to 3.5.1 even the basic scripts would throw
error (Index error). So, I tried downgrading to 3.4.0, but yt only gets
downgraded to 3.4.1 even with which my scripts are not working. Why is that
I am unable to get back to 3.4.0 and is there a way I could solve this
issue? Thank you
1
0

May 2, 2019
Hi,
I am trying to overlap two different projection plots (particles and
density) with two different color bars. However, I couldn't figure out a
way to do that but found over plotting particles over fluids.
So, I have RAMSES data which can't distinguish between dark matter and
stars through particle types but only with mass cut_off. So I create a
filter for the particles accordingly and supply it as the 'data_source'
argument in 'annotate_particles'. So, I do the following:
> def stars(pfilter, data):
>
> # age = (data.ds.current_time - data[pfilter.filtered_type,
> "particle_birth_time"]).in_units('Myr')
>
> stars_only = data[pfilter.filtered_type, "particle_mass"
> ].in_units('Msun')
>
> filter = (stars_only<4e6)
>
> return filter
>
> yt.add_particle_filter("stars", function=stars, filtered_type='io',
> requires=["particle_mass"])
>
>
> ini=1
>
> fin=2
>
> for x in range(ini, fin):
>
> filename="/lunarc/nobackup/users/samvad/SQ-8-5/output/output_%0*d/info_%0*
> d.txt" % (5,x,5,x)
>
> ds = yt.load(filename)
>
> ds.define_unit("H", (1.674*10**(-24), "g"))
>
> def density_threshold(field, data):
>
> dens=data["gas", "density"].in_units('H/cm**3')
>
> dens[dens < 0] = 0
>
> return dens
>
> ds.add_field(name=("gas", "density_threshold"),
> function=density_threshold, units="H/cm**3")
>
> ad=ds.all_data()
>
> denst=ad["gas", "density_threshold"].in_units('H/cm**3')
>
> #plot = yt.SlicePlot(ds, 'z', 'density_threshold', width=(400, "kpc"))
>
> plot = yt.ProjectionPlot(ds, 'z', 'density', weight_field=
> 'density', width=(800, "kpc"), center="c")
>
> ds.add_particle_filter('stars')
>
> dd=ds.all_data()
>
> plot.annotate_particles(1.0, dd)
>
> plot.set_cmap(field='density', cmap='Blues')
>
> plot.set_unit(("gas", "density"), "H/cm**3")
>
> plot.set_zlim(("gas", "density"), 1e-4, 1e-1)
>
plot.annotate_timestamp()
fil="density_%0*d.png" % (5,x)
>
> plot.save(fil)
>
But ending up with the error:
Traceback (most recent call last):
File
"/home/samvad/yt-conda/lib/python3.6/site-packages/yt/visualization/plot_window.py",
line 999, in run_callbacks
callback(cbw)
File
"/home/samvad/yt-conda/lib/python3.6/site-packages/yt/visualization/plot_modifications.py",
line 53, in _check_geometry
return func(self, plot)
File
"/home/samvad/yt-conda/lib/python3.6/site-packages/yt/visualization/plot_modifications.py",
line 1563, in __call__
s=self.p_size, c=self.color,alpha=self.alpha)
File
"/home/samvad/yt-conda/lib/python3.6/site-packages/matplotlib/__init__.py",
line 1717, in inner
return func(ax, *args, **kwargs)
File
"/home/samvad/yt-conda/lib/python3.6/site-packages/matplotlib/axes/_axes.py",
line 4032, in scatter
alpha=alpha
File
"/home/samvad/yt-conda/lib/python3.6/site-packages/matplotlib/collections.py",
line 880, in __init__
self.set_sizes(sizes)
File
"/home/samvad/yt-conda/lib/python3.6/site-packages/matplotlib/collections.py",
line 853, in set_sizes
scale = np.sqrt(self._sizes) * dpi / 72.0 * self._factor
AttributeError: 'YTRegion' object has no attribute 'sqrt'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "density.py", line 57, in <module>
plot.save(fil)
File
"/home/samvad/yt-conda/lib/python3.6/site-packages/yt/visualization/plot_container.py",
line 94, in newfunc
args[0]._setup_plots()
File
"/home/samvad/yt-conda/lib/python3.6/site-packages/yt/visualization/plot_window.py",
line 948, in _setup_plots
self.run_callbacks()
File
"/home/samvad/yt-conda/lib/python3.6/site-packages/yt/visualization/plot_window.py",
line 1005, in run_callbacks
sys.exc_info()[2])
File "/home/samvad/yt-conda/lib/python3.6/site-packages/six.py", line
692, in reraise
raise value.with_traceback(tb)
File
"/home/samvad/yt-conda/lib/python3.6/site-packages/yt/visualization/plot_window.py",
line 999, in run_callbacks
callback(cbw)
File
"/home/samvad/yt-conda/lib/python3.6/site-packages/yt/visualization/plot_modifications.py",
line 53, in _check_geometry
return func(self, plot)
File
"/home/samvad/yt-conda/lib/python3.6/site-packages/yt/visualization/plot_modifications.py",
line 1563, in __call__
s=self.p_size, c=self.color,alpha=self.alpha)
File
"/home/samvad/yt-conda/lib/python3.6/site-packages/matplotlib/__init__.py",
line 1717, in inner
return func(ax, *args, **kwargs)
File
"/home/samvad/yt-conda/lib/python3.6/site-packages/matplotlib/axes/_axes.py",
line 4032, in scatter
alpha=alpha
File
"/home/samvad/yt-conda/lib/python3.6/site-packages/matplotlib/collections.py",
line 880, in __init__
self.set_sizes(sizes)
File
"/home/samvad/yt-conda/lib/python3.6/site-packages/matplotlib/collections.py",
line 853, in set_sizes
scale = np.sqrt(self._sizes) * dpi / 72.0 * self._factor
> yt.utilities.exceptions.YTPlotCallbackError: annotate_particles callback
> failed with the following error: 'YTRegion' object has no attribute 'sqrt'
>
I don't seem to understand the issue here. Is there a workaround to get
particle plot over density plot in a simpler way? Thank you.
3
15