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@python.org wrote:
Send yt-users mailing list submissions to yt-users@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@python.org
You can reach the person managing the list at 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:
- Re: Loading a large gadget snapshot (Nathan Goldbaum)
- Re: set ticks and label for AxesGrid colorbar (Nathan Goldbaum)
Date: Tue, 20 Feb 2018 19:57:25 -0600 From: Nathan Goldbaum nathan12343@gmail.com Subject: [yt-users] Re: Loading a large gadget snapshot To: Desika Narayanan desika.narayanan@gmail.com, Discussion of the yt analysis package yt-users@python.org Message-ID: <CAJXewOnftkyL3GvXC-bafgCWcn0nPaEN7ktNKv6eYx1vEJcU Xg@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@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@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:
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@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@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@python.org To unsubscribe send an email to yt-users-leave@python.org
yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org _______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@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@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@gmail.com" target=3D"_blank">nathan12343@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@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@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@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@python.org</a><br> ><br> > ______________________________<wbr>_________________<br> > yt-users mailing list -- <a href=3D"mailto:yt-users@python.org" target= =3D"_blank">yt-users@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@python.org</a><br> ><br> ______________________________<wbr>_________________<br> yt-users mailing list -- <a href=3D"mailto:yt-users@python.org" target=3D"_= blank">yt-users@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@python.org</a><br> ______________________________<wbr>_________________<br> yt-users mailing list -- <a href=3D"mailto:yt-users@python.org" target=3D"_= blank">yt-users@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@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@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@python.org</a><br> <br>______________________________<wbr>_________________<br> yt-users mailing list -- <a href=3D"mailto:yt-users@python.org" target=3D"_= blank">yt-users@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@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@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@python.org</a><br> <br></blockquote></div><br></div>
--94eb2c05f198e4c8590565af4076--
Date: Wed, 21 Feb 2018 08:45:41 -0600 From: Nathan Goldbaum nathan12343@gmail.com Subject: [yt-users] Re: set ticks and label for AxesGrid colorbar To: Discussion of the yt analysis package yt-users@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@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@python.org To unsubscribe send an email to yt-users-leave@python.org
yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@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@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@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@python.org</a><br> <br></blockquote></div><br></div>
--94eb2c1935b46c17a80565b9fc54--
Subject: Digest Footer
yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
End of yt-users Digest, Vol 120, Issue 10