Hello again,
I am using yt slices and projections with scale annotation. I have my plots in comoving units ("Mpccm/h") but whenever I want to use the same units for annotation:
slc.annotate_scale(corner='lower_right', coeff=10, units='Mpccm/h'),
yt does not recognize these units. Am I missing something or only the physical scale annotation is possible ?
Thanks,
Salome
Hello,
I've looked at the documentation and it seems that octree datasets are
loadable for a few specific codes, but not in general. I have an
octree that represents galaxy simulation data, but it's produced as an
output of an analysis script. It would be nice to take advantage of yt's
capabilities to do analysis.
Is there a simple way to load an generic octree or would I have to write a
front-end myself (as described in the documentation and by looking at ART,
for example)?
Thanks!
Paco Holguin
Hi Matthew,
Thanks for your reply. Then if there is no translation for the spatial
coordinates what is happening to the velocities of the cells belonging
to the disk?
I'm asking that because what I see on my code is that the velocities and
the disk that is on the negative X region show a distribution that
corresponds to the middle of the computational domain and the same
happens to the distribution of the velocities on the disk that is on the
positive X region. However, since the coordinate system of both the
cylinder and the computational domain are at rest there shouldn't be a
any difference. So, I wonder what are the velocities that I get when I
do something like this:
disk['velocity_x']
The fact that the velocities that I'm getting correspond to another
region makes me believe that there is something wrong on the disk
structure code and it is always taking cells locate on the center that
correspond to a center c=[0.5,0.5,0.5]. Is there any way to verify where
the cylinder is located in the computational domain?
Regards,
El sáb., 19 sept. 2020 a las 11:02, <yt-users-request(a)python.org
<mailto:yt-users-request@python.org>> escribió:
Send yt-users mailing list submissions to
yt-users(a)python.org <mailto:yt-users@python.org>
To subscribe or unsubscribe via the World Wide Web, visit
https://mail.python.org/mailman3/lists/yt-users.python.org/
or, via email, send a message with subject or body 'help' to
yt-users-request(a)python.org <mailto:yt-users-request@python.org>
You can reach the person managing the list at
yt-users-owner(a)python.org <mailto:yt-users-owner@python.org>
When replying, please edit your Subject line so it is more specific
than "Re: Contents of yt-users digest..."
Today's Topics:
1. yt.disk (Guido granda muñoz)
2. Re: yt.disk (Matthew Turk)
----------------------------------------------------------------------
Message: 1
Date: Fri, 18 Sep 2020 16:05:21 -0500
From: Guido granda muñoz <guidogranda(a)gmail.com
<mailto:guidogranda@gmail.com>>
Subject: [yt-users] yt.disk
To: yt-users(a)python.org <mailto:yt-users@python.org>
Message-ID:
<CALOHZ_0=sr94xUKaxvBuRki99xZtKQtezhx3nEXXqDV9Ly4S1g(a)mail.gmail.com
<mailto:sr94xUKaxvBuRki99xZtKQtezhx3nEXXqDV9Ly4S1g@mail.gmail.com>>
Content-Type: multipart/alternative;
boundary="000000000000855e3c05af9cdca7"
--000000000000855e3c05af9cdca7
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Hello yt-users,
I have a question about the disk data object. The first input it
needs is
center, which according to your website is the coordinates of the
geometrical center of the disk on the simulation length units. So, the
center of the computational domain is c=3D[0.5,0.5,0.5].
I set the center of two different cylinders in a way that they
don=E2=80=99=
t
overlap. The axis of these cylinders are parallel to the x axis and
one is
on the negative X coordinate region while the other one on the positive
region. But, I found that they actually have exactly the same cell
centers.
Did I do something wrong?
On the following code the box side is 256 pc, so the center of the first
disk c_1=3D[0.25,0.5,0.5] with a height of 32 pc does not overlap
with the
second disk of center c_2=3D[0.75,0.5,0.5] also with height 32 pc.
http://paste.yt-project.org/show/275/
I=E2=80=99m using :
---
Version =3D 3.6.dev0
And the snapshot used is here:
http://use.yt/upload/c58a4c0f
--=20
Guido
--000000000000855e3c05af9cdca7
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br clear=3D"all"><div>
=09
=09
<p lang=3D"en-US" style=3D"margin-bottom:0in;line-height:100%">Hello
yt-users,</p>
<p lang=3D"en-US" style=3D"margin-bottom:0in;line-height:100%">I have
a question about the disk data object. The first input it needs is
center, which according to your website is the coordinates of the
geometrical center of the disk on the simulation length units. So,
the center of the computational domain is c=3D[0.5,0.5,0.5].<br></p>
<p lang=3D"en-US" style=3D"margin-bottom:0in;line-height:100%">I set
the center of two different cylinders in a way that they don=E2=80=99t
overlap. The axis of these cylinders are parallel to the x axis and
one is on the negative X coordinate region while the other one on the
positive region. But, I found that they actually have exactly the
same cell centers. Did I do something wrong?<br></p>
<p lang=3D"en-US" style=3D"margin-bottom:0in;line-height:100%">On the
following code the box side is 256 pc, so the center of the first
disk c_1=3D[0.25,0.5,0.5] with a height of 32 pc does not overlap with
the second disk of center c_2=3D[0.75,0.5,0.5] also with height 32
pc.=20
</p>
<p lang=3D"en-US" style=3D"margin-bottom:0in;line-height:100%"><a
href=3D"h=
ttp://paste.yt-project.org/show/275/
<http://paste.yt-project.org/show/275/>">http://paste.yt-project.org/show/275/=
</a><br></p>
<p lang=3D"en-US"
style=3D"margin-bottom:0in;line-height:100%">I=E2=80=99m
using :<br></p>
<p lang=3D"en-US" style=3D"margin-bottom:0in;line-height:100%">---</p>
<p lang=3D"en-US"
style=3D"margin-bottom:0in;border-top:none;border-bottom:=
1px solid rgb(0,0,0);border-left:none;border-right:none;padding:0in
0in 0.0=
3in;line-height:100%">
Version =3D 3.6.dev0</p>
<p lang=3D"en-US" style=3D"margin-bottom:0in;line-height:100%">And the
snapshot used is here:<br></p>
<p lang=3D"en-US" style=3D"margin-bottom:0in;line-height:100%"><a
href=3D"h=
ttp://use.yt/upload/c58a4c0f
<http://use.yt/upload/c58a4c0f>">http://use.yt/upload/c58a4c0f</a></p>
<p lang=3D"en-US" style=3D"margin-bottom:0in;line-height:100%"><br>
</p></div>-- <br><div dir=3D"ltr" class=3D"gmail_signature"
data-smartmail=
=3D"gmail_signature">Guido</div></div>
--000000000000855e3c05af9cdca7--
------------------------------
Message: 2
Date: Fri, 18 Sep 2020 17:13:40 -0500
From: Matthew Turk <matthewturk(a)gmail.com
<mailto:matthewturk@gmail.com>>
Subject: [yt-users] Re: yt.disk
To: Discussion of the yt analysis package <yt-users(a)python.org
<mailto:yt-users@python.org>>
Message-ID:
<CALO3=5GozUpChB+gLs-F1toed22XjDM6F4zEG4j4k=9Nu1HAJw(a)mail.gmail.com
<mailto:9Nu1HAJw@mail.gmail.com>>
Content-Type: multipart/alternative;
boundary="000000000000d95c4e05af9dd04e"
--000000000000d95c4e05af9dd04e
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Hi Guido,
The cell centers will indeed be the same -- there's no coordinate
translation that is done when you access just the 'x' 'y' and 'z'
fields.
I believe that the fields you might be looking for are
"cylindrical_radius"
"cylindrical_z" and "cylindrical_theta".
On Fri, Sep 18, 2020 at 4:06 PM Guido granda mu=C3=B1oz
<guidogranda(a)gmail.=
com>
wrote:
>
> Hello yt-users,
>
> I have a question about the disk data object. The first input it
needs is
> center, which according to your website is the coordinates of the
> geometrical center of the disk on the simulation length units.
So, the
> center of the computational domain is c=3D[0.5,0.5,0.5].
>
> I set the center of two different cylinders in a way that they
don=E2=80=
=99t
> overlap. The axis of these cylinders are parallel to the x axis
and one i=
s
> on the negative X coordinate region while the other one on the
positive
> region. But, I found that they actually have exactly the same
cell center=
s.
> Did I do something wrong?
>
> On the following code the box side is 256 pc, so the center of
the first
> disk c_1=3D[0.25,0.5,0.5] with a height of 32 pc does not overlap
with th=
e
> second disk of center c_2=3D[0.75,0.5,0.5] also with height 32 pc.
>
> http://paste.yt-project.org/show/275/
>
> I=E2=80=99m using :
>
> ---
>
> Version =3D 3.6.dev0
>
> And the snapshot used is here:
>
> http://use.yt/upload/c58a4c0f
>
>
> --
> Guido
> _______________________________________________
> yt-users mailing list -- yt-users(a)python.org
<mailto:yt-users@python.org>
> To unsubscribe send an email to yt-users-leave(a)python.org
<mailto:yt-users-leave@python.org>
> https://mail.python.org/mailman3/lists/yt-users.python.org/
> Member address: matthewturk(a)gmail.com <mailto:matthewturk@gmail.com>
>
--000000000000d95c4e05af9dd04e
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Hi Guido,<div><br></div><div>The cell centers will
indeed =
be the same -- there's no coordinate translation that is done
when you =
access just the 'x' 'y' and 'z'
fields.=C2=A0 I bel=
ieve that the fields you might be looking for are
"cylindrical_radius&=
quot; "cylindrical_z" and
"cylindrical_theta".</div></d=
iv><br><div class=3D"gmail_quote"><div dir=3D"ltr"
class=3D"gmail_attr">On =
Fri, Sep 18, 2020 at 4:06 PM Guido granda mu=C3=B1oz <<a
href=3D"mailto:=
guidogranda(a)gmail.com
<mailto:guidogranda@gmail.com>">guidogranda(a)gmail.com
<mailto:guidogranda@gmail.com></a>> wrote:<br></div><block=
quote class=3D"gmail_quote" style=3D"margin:0px 0px 0px
0.8ex;border-left:1=
px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr"><br
clear=3D"a=
ll"><div>
=09
=09
<p lang=3D"en-US" style=3D"margin-bottom:0in;line-height:100%">Hello
yt-users,</p>
<p lang=3D"en-US" style=3D"margin-bottom:0in;line-height:100%">I have
a question about the disk data object. The first input it needs is
center, which according to your website is the coordinates of the
geometrical center of the disk on the simulation length units. So,
the center of the computational domain is c=3D[0.5,0.5,0.5].<br></p>
<p lang=3D"en-US" style=3D"margin-bottom:0in;line-height:100%">I set
the center of two different cylinders in a way that they don=E2=80=99t
overlap. The axis of these cylinders are parallel to the x axis and
one is on the negative X coordinate region while the other one on the
positive region. But, I found that they actually have exactly the
same cell centers. Did I do something wrong?<br></p>
<p lang=3D"en-US" style=3D"margin-bottom:0in;line-height:100%">On the
following code the box side is 256 pc, so the center of the first
disk c_1=3D[0.25,0.5,0.5] with a height of 32 pc does not overlap with
the second disk of center c_2=3D[0.75,0.5,0.5] also with height 32
pc.=20
</p>
<p lang=3D"en-US" style=3D"margin-bottom:0in;line-height:100%"><a
href=3D"h=
ttp://paste.yt-project.org/show/275/
<http://paste.yt-project.org/show/275/>"
target=3D"_blank">http://paste.yt-pro=ject.org/show/275/ <http://ject.org/show/275/></a><br></p>
<p lang=3D"en-US"
style=3D"margin-bottom:0in;line-height:100%">I=E2=80=99m
using :<br></p>
<p lang=3D"en-US" style=3D"margin-bottom:0in;line-height:100%">---</p>
<p lang=3D"en-US"
style=3D"margin-bottom:0in;border-top:none;border-bottom:=
1px solid rgb(0,0,0);border-left:none;border-right:none;padding:0in
0in 0.0=
3in;line-height:100%">
Version =3D 3.6.dev0</p>
<p lang=3D"en-US" style=3D"margin-bottom:0in;line-height:100%">And the
snapshot used is here:<br></p>
<p lang=3D"en-US" style=3D"margin-bottom:0in;line-height:100%"><a
href=3D"h=
ttp://use.yt/upload/c58a4c0f <http://use.yt/upload/c58a4c0f>"
target=3D"_blank">http://use.yt/upload/c58a4c=
0f <http://use.yt/upload/c58a4c=0f></a></p>
<p lang=3D"en-US" style=3D"margin-bottom:0in;line-height:100%"><br>
</p></div>-- <br><div dir=3D"ltr">Guido</div></div>
_______________________________________________<br>
yt-users mailing list -- <a href=3D"mailto:yt-users@python.org
<mailto:yt-users@python.org>" target=3D"_=
blank">yt-users(a)python.org <mailto:yt-users@python.org></a><br>
To unsubscribe send an email to <a
href=3D"mailto:yt-users-leave@python.org
<mailto:yt-users-leave@python.org>=
" target=3D"_blank">yt-users-leave(a)python.org
<mailto:yt-users-leave@python.org></a><br>
<a
href=3D"https://mail.python.org/mailman3/lists/yt-users.python.org/"
rel=
=3D"noreferrer"
target=3D"_blank">https://mail.python.org/mailman3/lists/yt=
-users.python.org/
<https://mail.python.org/mailman3/lists/yt=-users.python.org/></a><br>
Member address: <a href=3D"mailto:matthewturk@gmail.com
<mailto:matthewturk@gmail.com>" target=3D"_blank">=
matthewturk(a)gmail.com <mailto:matthewturk@gmail.com></a><br>
</blockquote></div>
--000000000000d95c4e05af9dd04e--
------------------------------
Subject: Digest Footer
_______________________________________________
yt-users mailing list -- yt-users(a)python.org
<mailto:yt-users@python.org>
To unsubscribe send an email to yt-users-leave(a)python.org
<mailto:yt-users-leave@python.org>
https://mail.python.org/mailman3/lists/yt-users.python.org/
------------------------------
End of yt-users Digest, Vol 151, Issue 6
****************************************
--
Guido
Hello yt-users,
I have a question about the disk data object. The first input it needs is
center, which according to your website is the coordinates of the
geometrical center of the disk on the simulation length units. So, the
center of the computational domain is c=[0.5,0.5,0.5].
I set the center of two different cylinders in a way that they don’t
overlap. The axis of these cylinders are parallel to the x axis and one is
on the negative X coordinate region while the other one on the positive
region. But, I found that they actually have exactly the same cell centers.
Did I do something wrong?
On the following code the box side is 256 pc, so the center of the first
disk c_1=[0.25,0.5,0.5] with a height of 32 pc does not overlap with the
second disk of center c_2=[0.75,0.5,0.5] also with height 32 pc.
http://paste.yt-project.org/show/275/
I’m using :
---
Version = 3.6.dev0
And the snapshot used is here:
http://use.yt/upload/c58a4c0f
--
Guido
Hi all,
I'm trying to do a volume render of the temperature field inside a
sphere with the following code:
val, loc = ds.find_max('density')
sp = ds.sphere(loc, SP_DIST)
source = VolumeSource(sp, 'temperature')
scene = Scene()
scene.add_source(source)
# v is calculated based on angular momentum
camera = scene.add_camera(sp, lens_type= 'perspective')
cam_position = loc + v * CAM_DIST
camera.set_position(cam_position)
camera.set_focus(loc)
source.set_field('temperature')
source.set_log(True)
bounds = (UPPER, LOWER)
tf = yt.ColorTransferFunction(np.log10(bounds))
tf.add_layers(12, colormap='jet')
source.tfh.tf = tf
source.tfh.bounds = bounds
source.tfh.plot('transfer_function.png', profile_field='temperature')
scene.save("render_t={:.3f}".format(times[i]), sigma_clip= 1)
Upon saving though I encounter the error:
Traceback (most recent call last):
File "plot_3d.py", line 51, in <module>
scene.save("render_t={:.3f}".format(times[i]), sigma_clip= 1)
#last sigma = 2
File
"/opt/apps/pkgs/cpython/3.7.1/intel64/intel_2019.2/lib/python3.7/site-packages/yt/visualization/volume_rendering/scene.py",
line 310, in save
yt : [INFO ] 2020-09-15 10:34:02,783 Saving render render_t=0.000.png
self._last_render.write_png(fname, sigma_clip=sigma_clip)
File
"/opt/apps/pkgs/cpython/3.7.1/intel64/intel_2019.2/lib/python3.7/site-packages/yt/data_objects/image_array.py",
line 289, in write_png
scaled = self.rescale(inline=False)
File
"/opt/apps/pkgs/cpython/3.7.1/intel64/intel_2019.2/lib/python3.7/site-packages/yt/data_objects/image_array.py",
line 242, in rescale
np.clip(out, 0.0, 1.0, out)
File "<__array_function__ internals>", line 6, in clip
File
"/opt/apps/pkgs/cpython/3.7.1/intel64/intel_2019.2/lib/python3.7/site-packages/numpy/core/fromnumeric.py",
line 2084, in clip
return _wrapfunc(a, 'clip', a_min, a_max, out=out, **kwargs)
File
"/opt/apps/pkgs/cpython/3.7.1/intel64/intel_2019.2/lib/python3.7/site-packages/numpy/core/fromnumeric.py",
line 61, in _wrapfunc
return bound(*args, **kwds)
File
"/opt/apps/pkgs/cpython/3.7.1/intel64/intel_2019.2/lib/python3.7/site-packages/numpy/core/_methods.py",
line 132, in _clip
um.clip, a, min, max, out=out, casting=casting, **kwargs)
File
"/opt/apps/pkgs/cpython/3.7.1/intel64/intel_2019.2/lib/python3.7/site-packages/numpy/core/_methods.py",
line 85, in _clip_dep_invoke_with_casting
return ufunc(*args, out=out, **kwargs)
File
"/opt/apps/pkgs/cpython/3.7.1/intel64/intel_2019.2/lib/python3.7/site-packages/yt/units/yt_array.py",
line 1401, in __array_ufunc__
"added to YTArray." % (str(ufunc), len(inputs)))
RuntimeError: Support for the <ufunc 'clip'> ufunc with 3 inputs has not
beenadded to YTArray.
I would also like to eventually add a colorbar to the side of the
created image which represents the transfer function and annotate text
as well. Does the render functionality allow me to do this? Any help on
these topics would be much appreciated.
Many thanks,
Sam Patrick
Hello,
data_source in SlicePlot does not work (data_source in ProjectionPlot works). Would you explain how to enable it or fix the problem?
ds= yt.load("../DD2000/jf2000")
ad = ds.all_data()
dense_ad = ad.cut_region(["obj['Density'] >= 0"])
p = yt.SlicePlot(ds, 'x',"density",center=[6.5536/2, 6.5536/2,(15.5/2+2.5)],origin=["lower", "center", "domain"]
,data_source=dense_ad )
I chose 0 so that it will pick up all the gas but it does not.
There is no error message. It just does not show anything much in the figure. How can I attach figures here?