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.
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
Hi all,
We are trying to obtain inputs for RADMC3D from RAMSES data using the method from :
http://yt-project.org/doc/analyzing/analysis_modules/radmc3d_export.html
I get the following error message
In [5]: writer = RadMC3DWriter(ds)
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-5-e2ea2893623c> in <module>()
----> 1 writer = RadMC3DWriter(ds)
/Users/astrid/miniconda2/lib/python2.7/site-packages/yt/analysis_modules/radmc3d_export/RadMC3DInterface.pyc in __init__(self, ds, max_level)
146 self.cell_count += np.product(ds.domain_dimensions)
147
--> 148 sorted_grids = sorted(ds.index.grids, key=lambda x: x.Level)
149 for grid in sorted_grids:
150 if grid.Level <= self.max_level:
AttributeError: 'RAMSESIndex' object has no attribute 'grids'
which apparently has already popped up in the past (http://lists.spacepope.org/pipermail/yt-users-spacepope.org/2015-October/00… ).
Has this issue been fixed somewhere?
How can we get this to work?
Thanks,
Astrid
Astrid Lamberts
Postdoctoral Researcher
TAPIR Group, Caltech
Hi Nathan
My script is as bellow:
fns = [
"../DD0072/DD0072","../DD0102/DD0102","../DD0422/DD0422",
"../DD1117/DD1117",
"../DD1676/DD1676","../DD1902/DD1902","../DD1992/DD1992",
"../DD2054/DD2054",
"../DD3275/DD3275","../DD3601/DD3601","../DD3963/DD3963",
"../DD6300/DD6300"
]
fig = plt.figure()
grid = AxesGrid(fig, (0.02,0.02,0.84,0.84),
nrows_ncols = (3, 4),
axes_pad = 0.05,
label_mode = "L",
share_all = True,
cbar_location="right",
cbar_mode="single",
cbar_size="4%",
cbar_pad="1%”)
field = ['logD']
for i, fn in enumerate(fns):
ds = yt.load(fn)
p = yt.SlicePlot(ds, 'y', field)
p.set_zlim('logD', -12, np.log10(5e-7))
p.hide_axes()
p.set_cmap('logD','jet')
plot = p.plots['logD']
plot.figure = fig
plot.axes = grid[i].axes
plot.cax = grid.cbar_axes[i]
p._setup_plots()
I want to set ticks as [-12,-11,-10,-9,-8,-7], with similar labels.
What I do is as bellow:
cbar=plot.cb
cbar.set_ylabel(r'$\mathbf{log\ \rho\ [g\ cm^{-3}]}$')
cbar.ticklabels(['{:.0f}'.format(x) for x in np.arange(-12, np.log10(5e-7),
1)])
as is discussed here:
http://yt-project.org/doc/cookbook/custom_colorbar_tickmarks.html
But it seems it does not work for this plot.
Kazem
On Thu, Feb 22, 2018 at 2:00 AM, <yt-users-request(a)python.org> wrote:
> Send yt-users mailing list submissions to
> yt-users(a)python.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://mail.python.org/mm3/mailman3/lists/yt-users.python.org/
> or, via email, send a message with subject or body 'help' to
> yt-users-request(a)python.org
>
> You can reach the person managing the list at
> yt-users-owner(a)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. Re: Loading a large gadget snapshot (Nathan Goldbaum)
> 2. Re: set ticks and label for AxesGrid colorbar (Nathan Goldbaum)
>
>
> ----------------------------------------------------------------------
>
> Date: Tue, 20 Feb 2018 19:57:25 -0600
> From: Nathan Goldbaum <nathan12343(a)gmail.com>
> Subject: [yt-users] Re: Loading a large gadget snapshot
> To: Desika Narayanan <desika.narayanan(a)gmail.com>, Discussion of
> the yt analysis package <yt-users(a)python.org>
> Message-ID:
> <CAJXewOnftkyL3GvXC-bafgCWcn0nPaEN7ktNKv6eYx1vEJcU
> Xg(a)mail.gmail.com>
> Content-Type: multipart/alternative;
> boundary="94eb2c05f198e4c8590565af4076"
>
> --94eb2c05f198e4c8590565af4076
> Content-Type: text/plain; charset="UTF-8"
>
> Yes, apologies, I got that backwards. A larger n_ref means there needs be
> more particles per octree leaf zone to trigger refinement on that zone, so
> the you end up with fewer octree leaf nodes over all and you need less
> memory.
>
> -Nathan
>
> On Tue, Feb 20, 2018 at 7:53 PM, Desika Narayanan <
> desika.narayanan(a)gmail.com> wrote:
>
> > quick note -- set n_ref=64 or 128 (or bigger than 32) to reduce RAM
> > footprint (instead of 16).
> >
> > -d
> >
> > On Tue, Feb 20, 2018 at 8:37 PM, Nathan Goldbaum <nathan12343(a)gmail.com>
> > wrote:
> >
> >> Hi Jared,
> >>
> >> Just a comment that for these really big particle simulations the way yt
> >> currently supports particle data doesn't scale terribly well, so you
> might
> >> run into either issues with operations taking a very long time or using
> too
> >> much RAM.
> >>
> >> You may find it useful to only load in data in a subset of the
> simulation
> >> domain to restrict the number of particles yt is dealing with at any one
> >> time. This can be controlled at a coarse level via the "bounding_box"
> >> keyword argument to the load() function, in particular by supplying a
> >> bounding box that only covers a portion of the domain. It might also
> help
> >> with RAM usage to supply n_ref=16 instead of the default (32). There's
> more
> >> detail about what these parameters do in the docs:
> >>
> >> http://yt-project.org/docs/3.4.1/examining/loading_data.
> html#gadget-data
> >>
> >> If you'd like you could also try the "sph-viz" branch on my fork of yt
> at
> >> https://github.com/ngoldbaum/yt. This branch contains an implementation
> >> of the next-generation support for particle data in yt that is still
> under
> >> development. This version will scale much better for a dataset as big as
> >> yours.
> >>
> >> Best,
> >>
> >> Nathan
> >>
> >> On Tue, Feb 20, 2018 at 7:22 PM, Matthew Turk <matthewturk(a)gmail.com>
> >> wrote:
> >>
> >>> Hi Jared,
> >>>
> >>> I know you can make the particle IDs work by specifying the dtype, but
> >>> my reading of the _validate_header code is the same as yours. I think
> >>> it would be a pretty straightforward change to conditionally make the
> >>> 'I' read into the struct into a 64-bit variable, but it's not there
> >>> now.
> >>>
> >>> -Matt
> >>>
> >>> On Tue, Feb 20, 2018 at 7:16 PM, Jared Coughlin
> >>> <Jared.W.Coughlin.29(a)nd.edu> wrote:
> >>> > Hello! I have a gadget snapshot file with 1024^3 particles. When I
> >>> tried to
> >>> > load it with yt, yt fails by saying that it cannot identify the file
> >>> type. I
> >>> > did some digging and found that the way yt validates a gadget
> snapshot
> >>> is by
> >>> > reading the number of particles from the header and then comparing
> that
> >>> > number to the number derived from the size of the position block.
> This
> >>> size
> >>> > is 1024^3 *3*4 (the number of particles times 3 positions times 4
> >>> bytes per
> >>> > position). However, as I just discovered, this number is larger than
> >>> the max
> >>> > value of an int in c, and so gadget writes a value of 0 due to the
> >>> overflow.
> >>> > As such, I need to use gadget's unsigned long long int for the
> >>> padding, but
> >>> > this is 8 bytes, not 4. I was just wondering if yt had some ability
> to
> >>> > detect the need to use something larger than an int? If not, I can
> add
> >>> it.
> >>> > Thanks!
> >>> > -Jared
> >>> >
> >>> > _______________________________________________
> >>> > yt-users mailing list -- yt-users(a)python.org
> >>> > To unsubscribe send an email to yt-users-leave(a)python.org
> >>> >
> >>> > _______________________________________________
> >>> > yt-users mailing list -- yt-users(a)python.org
> >>> > To unsubscribe send an email to yt-users-leave(a)python.org
> >>> >
> >>> _______________________________________________
> >>> yt-users mailing list -- yt-users(a)python.org
> >>> To unsubscribe send an email to yt-users-leave(a)python.org
> >>> _______________________________________________
> >>> yt-users mailing list -- yt-users(a)python.org
> >>> To unsubscribe send an email to yt-users-leave(a)python.org
> >>>
> >>
> >>
> >> _______________________________________________
> >> yt-users mailing list -- yt-users(a)python.org
> >> To unsubscribe send an email to yt-users-leave(a)python.org
> >>
> >> _______________________________________________
> >> yt-users mailing list -- yt-users(a)python.org
> >> To unsubscribe send an email to yt-users-leave(a)python.org
> >>
> >>
> >
> > _______________________________________________
> > yt-users mailing list -- yt-users(a)python.org
> > To unsubscribe send an email to yt-users-leave(a)python.org
> >
> > _______________________________________________
> > yt-users mailing list -- yt-users(a)python.org
> > To unsubscribe send an email to yt-users-leave(a)python.org
> >
> >
>
> --94eb2c05f198e4c8590565af4076
> Content-Type: text/html; charset="UTF-8"
> Content-Transfer-Encoding: quoted-printable
>
> <div dir=3D"ltr"><div>Yes, apologies, I got that backwards. A larger n_ref
> =
> means there needs be more particles per octree leaf zone to trigger
> refinem=
> ent on that zone, so the you end up with fewer octree leaf nodes over all
> a=
> nd you need less memory.<br><br></div>-Nathan<br></div><div
> class=3D"gmail_=
> extra"><br><div class=3D"gmail_quote">On Tue, Feb 20, 2018 at 7:53 PM,
> Desi=
> ka Narayanan <span dir=3D"ltr"><<a href=3D"mailto:desika.
> narayanan@gmail=
> .com" target=3D"_blank">desika.narayanan(a)gmail.com</a>></span>
> wrote:<br=
> ><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0
> .8ex;border-left:1=
> px #ccc solid;padding-left:1ex"><div dir=3D"ltr">quick note --
> set=C2=A0<sp=
> an style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;
> font-size:12.8=
> px;font-style:normal;font-variant-ligatures:normal;font-
> variant-caps:normal=
> ;font-weight:400;letter-spacing:normal;text-align:
> start;text-indent:0px;tex=
> t-transform:none;white-space:normal;word-spacing:0px;
> background-color:rgb(2=
> 55,255,255);text-decoration-style:initial;text-decoration-
> color:initial;flo=
> at:none;display:inline">n_ref=3D64 or 128 (or bigger than 32) to reduce
> RAM=
> footprint (instead of 16).=C2=A0 =C2=A0</span><span
> class=3D"HOEnZb"><font=
> color=3D"#888888"><div><span style=3D"color:rgb(34,34,34);
> font-family:aria=
> l,sans-serif;font-size:12.8px;font-style:normal;font-
> variant-ligatures:norm=
> al;font-variant-caps:normal;font-weight:400;letter-
> spacing:normal;text-alig=
> n:start;text-indent:0px;text-transform:none;white-space:
> normal;word-spacing=
> :0px;background-color:rgb(255,255,255);text-decoration-
> style:initial;text-d=
> ecoration-color:initial;float:none;display:inline"><br></
> span></div><div><s=
> pan style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;
> font-size:12.=
> 8px;font-style:normal;font-variant-ligatures:normal;font-
> variant-caps:norma=
> l;font-weight:400;letter-spacing:normal;text-align:
> start;text-indent:0px;te=
> xt-transform:none;white-space:normal;word-spacing:0px;
> background-color:rgb(=
> 255,255,255);text-decoration-style:initial;text-decoration-
> color:initial;fl=
> oat:none;display:inline">-d</span></div></font></span><div><div
> class=3D"h5=
> "><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">On Tue, Feb
> 20,=
> 2018 at 8:37 PM, Nathan Goldbaum <span dir=3D"ltr"><<a href=3D"mailto:
> n=
> athan12343(a)gmail.com" target=3D"_blank">nathan12343(a)gmail.com
> </a>></span=
> > wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0
> .8ex;bo=
> rder-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div><div>Hi
> Ja=
> red,<br><br></div>Just a comment that for these really big particle
> simulat=
> ions the way yt currently supports particle data doesn't scale
> terribly=
> well, so you might run into either issues with operations taking a very
> lo=
> ng time or using too much RAM.<br><br></div><div>You may find it useful to
> =
> only load in data in a subset of the simulation domain to restrict the
> numb=
> er of particles yt is dealing with at any one time. This can be controlled
> =
> at a coarse level via the "bounding_box" keyword argument to the
> =
> load() function, in particular by supplying a bounding box that only
> covers=
> a portion of the domain. It might also help with RAM usage to supply
> n_ref=
> =3D16 instead of the default (32). There's more detail about what
> these=
> parameters do in the docs:<br><br><a href=3D"http://yt-project.org/
> docs/3.=
> 4.1/examining/loading_data.html#gadget-data" target=3D"_blank">
> http://yt-pr=
> oject.org/docs/3.4<wbr>.1/examining/loading_data.html<
> wbr>#gadget-data</a><=
> br><br></div><div>If you'd like you could also try the
> "sph-viz&qu=
> ot; branch on my fork of yt at <a href=3D"https://github.com/ngoldbaum/yt"
> =
> target=3D"_blank">https://github.com/ngoldbaum/y<wbr>t</a>. This branch
> con=
> tains an implementation of the next-generation support for particle data
> in=
> yt that is still under development. This version will scale much better
> fo=
> r a dataset as big as yours.<br><br></div><div>Best,
> <br><br></div><div>Nath=
> an<br></div></div><div class=3D"m_6788941403835052387m_-
> 5788644225450873479=
> HOEnZb"><div class=3D"m_6788941403835052387m_-5788644225450873479h5"><div
> c=
> lass=3D"gmail_extra"><br><div class=3D"gmail_quote">On Tue, Feb 20, 2018
> at=
> 7:22 PM, Matthew Turk <span dir=3D"ltr"><<a href=3D"mailto:
> matthewturk@=
> gmail.com" target=3D"_blank">matthewturk(a)gmail.com</a>></span>
> wrote:<br=
> ><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0
> .8ex;border-left:1=
> px #ccc solid;padding-left:1ex">Hi Jared,<br>
> <br>
> I know you can make the particle IDs work by specifying the dtype, but<br>
> my reading of the _validate_header code is the same as yours.=C2=A0 I
> think=
> <br>
> it would be a pretty straightforward change to conditionally make the<br>
> 'I' read into the struct into a 64-bit variable, but it's not
> t=
> here<br>
> now.<br>
> <br>
> -Matt<br>
> <div><div class=3D"m_6788941403835052387m_-5788644225450873479m_
> 23635419532=
> 30957494h5"><br>
> On Tue, Feb 20, 2018 at 7:16 PM, Jared Coughlin<br>
> <<a href=3D"mailto:Jared.W.Coughlin.29@nd.edu"
> target=3D"_blank">Jared.W=
> .Coughlin.29(a)nd.edu</a>> wrote:<br>
> > Hello! I have a gadget snapshot file with 1024^3 particles. When I
> tri=
> ed to<br>
> > load it with yt, yt fails by saying that it cannot identify the file
> t=
> ype. I<br>
> > did some digging and found that the way yt validates a gadget
> snapshot=
> is by<br>
> > reading the number of particles from the header and then comparing
> tha=
> t<br>
> > number to the number derived from the size of the position block.
> This=
> size<br>
> > is 1024^3 *3*4 (the number of particles times 3 positions times 4
> byte=
> s per<br>
> > position). However, as I just discovered, this number is larger than
> t=
> he max<br>
> > value of an int in c, and so gadget writes a value of 0 due to the
> ove=
> rflow.<br>
> > As such, I need to use gadget's unsigned long long int for the
> pad=
> ding, but<br>
> > this is 8 bytes, not 4. I was just wondering if yt had some ability
> to=
> <br>
> > detect the need to use something larger than an int? If not, I can
> add=
> it.<br>
> > Thanks!<br>
> > -Jared<br>
> ><br>
> </div></div>> ______________________________<wbr>_________________<br>
> > yt-users mailing list -- <a href=3D"mailto:yt-users@python.org"
> target=
> =3D"_blank">yt-users(a)python.org</a><br>
> > To unsubscribe send an email to <a href=3D"mailto:yt-users-leave@
> pytho=
> n.org" target=3D"_blank">yt-users-leave(a)python.org</a><br>
> ><br>
> > ______________________________<wbr>_________________<br>
> > yt-users mailing list -- <a href=3D"mailto:yt-users@python.org"
> target=
> =3D"_blank">yt-users(a)python.org</a><br>
> > To unsubscribe send an email to <a href=3D"mailto:yt-users-leave@
> pytho=
> n.org" target=3D"_blank">yt-users-leave(a)python.org</a><br>
> ><br>
> ______________________________<wbr>_________________<br>
> yt-users mailing list -- <a href=3D"mailto:yt-users@python.org"
> target=3D"_=
> blank">yt-users(a)python.org</a><br>
> To unsubscribe send an email to <a href=3D"mailto:yt-users-leave@
> python.org=
> " target=3D"_blank">yt-users-leave(a)python.org</a><br>
> ______________________________<wbr>_________________<br>
> yt-users mailing list -- <a href=3D"mailto:yt-users@python.org"
> target=3D"_=
> blank">yt-users(a)python.org</a><br>
> To unsubscribe send an email to <a href=3D"mailto:yt-users-leave@
> python.org=
> " target=3D"_blank">yt-users-leave(a)python.org</a><br>
> </blockquote></div><br></div>
> </div></div><br>______________________________<wbr>_________________<br>
> yt-users mailing list -- <a href=3D"mailto:yt-users@python.org"
> target=3D"_=
> blank">yt-users(a)python.org</a><br>
> To unsubscribe send an email to <a href=3D"mailto:yt-users-leave@
> python.org=
> " target=3D"_blank">yt-users-leave(a)python.org</a><br>
> <br>______________________________<wbr>_________________<br>
> yt-users mailing list -- <a href=3D"mailto:yt-users@python.org"
> target=3D"_=
> blank">yt-users(a)python.org</a><br>
> To unsubscribe send an email to <a href=3D"mailto:yt-users-leave@
> python.org=
> " target=3D"_blank">yt-users-leave(a)python.org</a><br>
> <br></blockquote></div><br></div></div></div></div>
> <br>______________________________<wbr>_________________<br>
> yt-users mailing list -- <a href=3D"mailto:yt-users@python.org
> ">yt-users@py=
> thon.org</a><br>
> To unsubscribe send an email to <a href=3D"mailto:yt-users-leave@
> python.org=
> ">yt-users-leave(a)python.org</a><br>
> <br>______________________________<wbr>_________________<br>
> yt-users mailing list -- <a href=3D"mailto:yt-users@python.org
> ">yt-users@py=
> thon.org</a><br>
> To unsubscribe send an email to <a href=3D"mailto:yt-users-leave@
> python.org=
> ">yt-users-leave(a)python.org</a><br>
> <br></blockquote></div><br></div>
>
> --94eb2c05f198e4c8590565af4076--
>
> ------------------------------
>
> Date: Wed, 21 Feb 2018 08:45:41 -0600
> From: Nathan Goldbaum <nathan12343(a)gmail.com>
> Subject: [yt-users] Re: set ticks and label for AxesGrid colorbar
> To: Discussion of the yt analysis package <yt-users(a)python.org>
> Message-ID:
> <CAJXewOmPkcsv6F+G74zwLEOEn-Qq294gMiyRVYPQoG1PqeT5nw@mail.
> gmail.com>
> Content-Type: multipart/alternative;
> boundary="94eb2c1935b46c17a80565b9fc54"
>
> --94eb2c1935b46c17a80565b9fc54
> Content-Type: text/plain; charset="UTF-8"
> Content-Transfer-Encoding: quoted-printable
>
> Is there any chance you can make a self-contained runnable example that
> demonstrates the issue you are having? That will make it easier to
> reproduce the issue and allow us to suggest a concrete modification.
>
> -Nathan
>
> On Tue, Feb 20, 2018 at 7:47 PM, Kazem Ardaneh <kazem.arrdaneh(a)gmail.com>
> wrote:
>
> > Dear All,
> >
> > I have a question about costume ticks and ticks label in YT when we use
> > AxesGrid.
> > I have a plot
> > =E2=80=8Bof =E2=80=8B
> > density and velocity vectors as over plotted. I want to use a custom
> > colorbar ticks and tickslablel. After setup the plots, I have used
> > colorbar.set_ticks, and colorbar.set_ticklabels, where
> colorbar=3Dplot.cb=
> .
> > However, they are not changed. Does anyone has a suggestion?
> >
> >
> >
> > Kazem
> >
> > _______________________________________________
> > yt-users mailing list -- yt-users(a)python.org
> > To unsubscribe send an email to yt-users-leave(a)python.org
> >
> > _______________________________________________
> > yt-users mailing list -- yt-users(a)python.org
> > To unsubscribe send an email to yt-users-leave(a)python.org
> >
> >
>
> --94eb2c1935b46c17a80565b9fc54
> Content-Type: text/html; charset="UTF-8"
> Content-Transfer-Encoding: quoted-printable
>
> <div dir=3D"ltr"><div>Is there any chance you can make a self-contained
> run=
> nable example that demonstrates the issue you are having? That will make
> it=
> easier to reproduce the issue and allow us to suggest a concrete
> modificat=
> ion.<br></div><div><br></div>-Nathan<br></div><div
> class=3D"gmail_extra"><b=
> r><div class=3D"gmail_quote">On Tue, Feb 20, 2018 at 7:47 PM, Kazem
> Ardaneh=
> <span dir=3D"ltr"><<a href=3D"mailto:kazem.arrdaneh@gmail.com" target=
> =3D"_blank">kazem.arrdaneh(a)gmail.com</a>></span> wrote:<br><blockquote
> c=
> lass=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc
> solid;=
> padding-left:1ex"><div dir=3D"ltr">Dear All, <br><br>I have a question
> abou=
> t costume ticks and ticks label in YT when we use AxesGrid.<br>I have a
> plo=
> t <div class=3D"gmail_default" style=3D"font-size:small;
> display:inline">=E2=
> =80=8Bof =E2=80=8B</div>density and velocity vectors as over plotted. I
> wan=
> t to use a custom colorbar ticks and tickslablel. After setup the plots, I
> =
> have used colorbar.set_ticks, and colorbar.set_ticklabels, where colorbar=
> =3Dplot.cb. However, they are not changed. Does anyone has a suggestion?
> <s=
> pan class=3D"HOEnZb"><font color=3D"#888888"><div class=3D"gmail_default"
> s=
> tyle=3D"font-size:small"><p style=3D"margin:0px;font-
> stretch:normal;font-si=
> ze:14px;line-height:normal;font-family:Menlo;color:rgb(205,121,35)"><span
> s=
> tyle=3D"font-variant-ligatures:no-common-ligatures;
> color:rgb(0,0,0)"><br></=
> span></p></div><div><div class=3D"m_6492320114560421087gmail-m_
> 626533431233=
> 1061960gmail_signature"><div dir=3D"ltr"><div><div dir=3D"ltr"><div><div
> di=
> r=3D"ltr"><br>Kazem </div></div></div></div></div></div></div>
> </font></span></div>
> <br>______________________________<wbr>_________________<br>
> yt-users mailing list -- <a href=3D"mailto:yt-users@python.org
> ">yt-users@py=
> thon.org</a><br>
> To unsubscribe send an email to <a href=3D"mailto:yt-users-leave@
> python.org=
> ">yt-users-leave(a)python.org</a><br>
> <br>______________________________<wbr>_________________<br>
> yt-users mailing list -- <a href=3D"mailto:yt-users@python.org
> ">yt-users@py=
> thon.org</a><br>
> To unsubscribe send an email to <a href=3D"mailto:yt-users-leave@
> python.org=
> ">yt-users-leave(a)python.org</a><br>
> <br></blockquote></div><br></div>
>
> --94eb2c1935b46c17a80565b9fc54--
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> yt-users mailing list -- yt-users(a)python.org
> To unsubscribe send an email to yt-users-leave(a)python.org
>
>
> ------------------------------
>
> End of yt-users Digest, Vol 120, Issue 10
> *****************************************
>
Hello! I have a gadget snapshot file with 1024^3 particles. When I tried to
load it with yt, yt fails by saying that it cannot identify the file type.
I did some digging and found that the way yt validates a gadget snapshot is
by reading the number of particles from the header and then comparing that
number to the number derived from the size of the position block. This size
is 1024^3 *3*4 (the number of particles times 3 positions times 4 bytes per
position). However, as I just discovered, this number is larger than the
max value of an int in c, and so gadget writes a value of 0 due to the
overflow. As such, I need to use gadget's unsigned long long int for the
padding, but this is 8 bytes, not 4. I was just wondering if yt had some
ability to detect the need to use something larger than an int? If not, I
can add it. Thanks!
-Jared
Dear All,
I have a question about costume ticks and ticks label in YT when we use
AxesGrid.
I have a plot
of
density and velocity vectors as over plotted. I want to use a custom
colorbar ticks and tickslablel. After setup the plots, I have used
colorbar.set_ticks, and colorbar.set_ticklabels, where colorbar=plot.cb.
However, they are not changed. Does anyone has a suggestion?
Kazem
Dear yt:
Is there a way to have normalized axis units for streamline plotting?
I want my x axis (xmin, xmax) to be in the units of (xmin/30, xmax/30).
Similarly, for y axis.
Thank you in advance
SCRIPT:
import yt
import numpy as np
import os
import matplotlib.pyplot as plt
import matplotlib
ms = 24000000
vector_max=ms-(ms/3)
ms1=ms-vector_max
dims = (200,200,200)
x =
np.genfromtxt("/work/jbi157/MODEL7/UPDATE_B/yo_n_t105.mtx",skip_header=2,usecols=1,
dtype="f8")
x = x.reshape((8000000, 3), order="F")
field1 = x[:,2].reshape(dims, order="F")
field2 = x[:,1].reshape(dims, order="F")
field3 = x[:,0].reshape(dims, order="F")
data = dict(velocity_x = field1,
velocity_y = field2,
velocity_z = field3)
bbox = np.array([[-100, 99], [-100, 99], [-100, 99]])
ds = yt.load_uniform_grid(data, dims, 'km', bbox=bbox, nprocs=1)
L = [0, 1, 0]
north_vector = [0.87, 0, 0.5]
slc = yt.OffAxisSlicePlot(ds, L, 'cutting_plane_velocity_x',
center=[0,0,0], width=(180,'km'), north_vector=north_vector)
vel = slc._frb['velocity_magnitude']
U = slc._frb['cutting_plane_velocity_y']
V = slc._frb['cutting_plane_velocity_x']
extentx = [slc.xlim[i].in_units('km') for i in (0, 1)]
extenty = [slc.ylim[i].in_units('km') for i in (0, 1)]
extent = extentx + extenty
x = np.linspace(extentx[0], extentx[1], vel.shape[0])
y = np.linspace(extenty[1], extenty[0], vel.shape[1])
X, Y = np.meshgrid(x, y)
normalize = False # Turn off normalize if you use streamplot
if normalize is True:
N = np.sqrt(U**2+V**2)
U /= N
V /= N
else:
U = U.d
V = V.d
factor = 40
#norm = matplotlib.colors.Normalize(vmin=vel.min(), vmax=vel.max(),
clip=True)
#norm = matplotlib.colors.LogNorm(vmin=vel.min(), vmax=vel.max(),
clip=True)
#norm = matplotlib.colors.NoNorm(vmin=vel.min(), vmax=vel.max(), clip=True)
#norm = matplotlib.colors.PowerNorm(gamma=0.5,vmin=vel.min(),
vmax=vel.max(), clip=True)
norm = matplotlib.colors.SymLogNorm(linthresh=0.01,vmin=vel.min(),
vmax=vel.max(), clip=True)
plt.streamplot(np.array(X),np.array(Y),np.array(U),np.array(V),
density=2,color='blue') # Here density adjusts the density of streamlines
#plt.imshow(vel.d, extent=extent, norm=norm)
#plt.imshow(vel.d, extent=extent, norm=norm, cmap='seismic')
plt.imshow(vel.d, extent=extent, norm=norm, cmap=plt.cm.coolwarm)
circle=plt.Circle((0,0),9,color='gray')
fig = plt.gcf()
fig.gca().add_artist(circle)
plt.colorbar()
#plt.title("Angle = 45$^{\circ}$, Grid size = 200\n Power Normalize, Gamma
= 0.5")
#plt.title("Angle = 45$^{\circ}$, Grid size = 200\n Linear Normalize")
plt.title("Angle = 60$^{\circ}$, x-z plane")
plt.axis([-72, 72, -72, 72])
plt.axis('off')
#plt.savefig('stream_plot_Norm.png')
#plt.savefig('stream_plot_LogNorm.png')
#plt.savefig('stream_plot_NoNorm.png')
#plt.savefig('stream_plot_PowerNorm.png')
plt.savefig('stream_plot_t0105.png')
--
*SK2*
*"**Claiming that something can move faster than light is a good
conversation-stopper in physics. People edge away from you in cocktail
parties; friends never return phone calls. You just don’t mess with Albert
Einstein.**"*
Hello,
I knew that I could use annotate_magnetic_field(), annotate_streamlines(), annotate_line_integral_convolution(), or annotate_cquiver() for 2D plots,
and yt.visualization.api, Streamlines for 3D stream lines (with Axes3D, ugly).
Is it possible to plot streamlines/vectors (magnetic field or velocity field) together with a volume rendering plot (not Isocontours)?
Many thanks,
Kuo-Chuan