I’m trying to invert the horizontal axis on some simple projection plots. I’m trying to get a projection along the x axis, with y as the vertical and z as the horizontal axis where the horizontal/z axis is inverted, with the horizontal/z axis decreasing from left to right. Here’s the relevant code:
ds.coordinates.x_axis = 2
ds.coordinates.x_axis['x'] = 2
ds.coordinates.y_axis = 1
ds.coordinates.y_axis['x'] = 1
This is just assigning the z axis (2) to the horizontal axis and the y axis (1) to the vertical axis.
plot1 = yt.ProjectionPlot(ds,"x","velocity_x",weight_field='density')
plot12 = yt.ProjectionPlot(ds,"x","density")
And then I just use ProjectionPlot to make the plots. As you can see, I commented out a sort of matplotlib-y attempt to invert the horizontal axis, to no effect.
I’ve attached two files: the first is what I’m getting with the above code (‘Projection_x_density_actual'), and the second illustrates the orientation I’d like (‘Projection_x_density_rotated'). Unfortunately, I got to the desired orientation by swapping my vertical/horizontal axes like this:
ds.coordinates.x_axis = 1
ds.coordinates.x_axis['x'] = 1
ds.coordinates.y_axis = 2
ds.coordinates.y_axis['x'] = 2
and then just rotating the png in preview.
I can’t find anything in the documentation about this besides the fact that we can use matplotlib objects to customize plots. I’d really appreciate any help on this!
So I think I found a bug in cut_region. Right now the directions say you
can chain cut regions in two ways: either listing several cut_regions or
using one call and an "&".
However, for some extremely mysterious reason, when I do a multi-call to
cut_region I get wackadoo numbers, like too high by a couple orders of
Here is the quick check that should work on IsoGal:
disk3 = ds.disk([0.5,0.5,0.5],[0,0,-1.0],(40,"kpc"),(10,"kpc"))
diskn = disk3.cut_region(["obj['Metal_Density']/obj['density'] > 0.5"])
diska = diskn.cut_region(["obj['density'] > 1e-25"])
diskd = disk3.cut_region(["(obj['Metal_Density']/obj['density'] > 0.5)
& (obj['density'] > 1e-25)"])
I am also attaching my whole code, which is a loop, just in case. So here
the diska mass is two orders of magnitude larger than any of the others,
and diskd is what I would expect with the two selection criteria.
Dr. Stephanie Tonnesen
Alvin E. Nashman Postdoctoral Fellow
Carnegie Observatories, Pasadena, CA
Dear YT users,
I have question about 3D visualization. I have two 3D numpy float arrays
with the same dimensions. It is possible to visualize so that the first
array will be data and second array will be their transparency?
Best regards Zbynek Dostal.
Ing. Zbynek Dostal, Ph.D.
CEITEC | Brno University of Technology
Brno, Czech Republic
I need to install the development version of yt, which is fully capable
of reading BoxLib-based datasets (yt-users Digest, Vol 110, Issue 1).
While I can do that without problems on my PC, I ran into problems on
the remote host where the datasets are produced.
I am able to successfully install Anaconda and also the stable yt branch
(via conda install yt), but the "nightly conda build"
conda install -c http://use.yt/with_conda/ yt
fails with the error message
Fetching package metadata ...
CondaHTTPError: HTTP None None for url
An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on
port=80): Max retries exceeded with url:
/with_conda/linux-64/repodata.json (Caused by
object at 0x2aaab449ad30>: Failed to establish a new connection: [Errno
113] No route to host',))",),)
It turns out that retrying doesn't help. I suspect that traffic through
certain ports is blocked.
Over the alternative route offered by the yt installation script, even
the basic installation fails because some packages cannot be accessed.
If anyone knows of other options or a way to circumvent the above
problem, please let me know.
I encountered a problem when processing BoxLib (Nyx) data from pure
hydro simulations without particles, using an Anaconda installation of yt.
After loading a dataset with yt.load(), I get the following error for
KeyError Traceback (most recent call last)
<ipython-input-5-5aaf470c0415> in<module>() ---->
in field_list(self) 459 @property460 def field_list(self):--> 461return
self.index.field_list462 463 def
in index(self) 417 raise RuntimeError("You should not instantiate
Dataset.")418 self._instantiated_index = self._index_class( --> 419self,
dataset_type=self.dataset_type) 420 # Now we do things that we need an
instantiated index for421 # ...first off, we create our field_info
in __init__(self, ds, dataset_type) 906 def __init__(self, ds,
dataset_type='nyx_native'):907 super(NyxHierarchy, self).__init__(ds,
dataset_type)--> 908self._read_particle_header()909 910 def
in _read_particle_header(self) 909 910 def
_read_particle_header(self):--> 911if not
self.ds.parameters["particles"]:912 self.pgrid_info =
np.zeros((self.num_grids, 3), dtype='int64')913 returnKeyError: 'particles'
Same problem with slices. I am not sure what exactly causes the error
here, but since I can load datasets from cosmological simulations with
Nyx and process them without problems, I suppose the problem outlined
above is somehow related to the missing particles.
How can this be fixed?