Re: yt-users Digest, Vol 120, Issue 10
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,
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:
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
Subject: [yt-users] Re: Loading a large gadget snapshot To: Desika Narayanan , Discussion of the yt analysis package Message-ID: 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
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
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
Hello! I have a gadget snapshot file with 1024^3 particles. When I
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
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
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
On Tue, Feb 20, 2018 at 7:16 PM, Jared Coughlin
wrote: tried to that the max 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
wrote:<br>
<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<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><br>On Tue, Feb 20, 2018 at 7:53 PM, Desi= ka Narayanan <desika.narayanan@gmail.com</a>></span> wrote:quick note -- set=C2=A0n_ref=3D64 or 128 (or bigger than 32) to reduce RAM= footprint (instead of 16).=C2=A0 =C2=A0</span><div><br> span></div><div> -d</span></div></font></span><div><br>On Tue, Feb 20,= 2018 at 8:37 PM, Nathan Goldbaum <nathan12343@gmail.com </a>>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 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><br>On Tue, Feb 20, 2018 at= 7:22 PM, Matthew Turk <matthewturk@gmail.com</a>></span> wrote:
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><br> On Tue, Feb 20, 2018 at 7:16 PM, Jared Coughlin<br> <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 -- yt-users@python.org</a><br> > To unsubscribe send an email to yt-users-leave@python.org</a><br> ><br> > ______________________________<wbr>_________________<br> > yt-users mailing list -- yt-users@python.org</a><br> > To unsubscribe send an email to yt-users-leave@python.org</a><br> ><br> ______________________________<wbr>_________________<br> yt-users mailing list -- yt-users@python.org</a><br> To unsubscribe send an email to yt-users-leave@python.org</a><br> ______________________________<wbr>_________________<br> yt-users mailing list -- yt-users@python.org</a><br> To unsubscribe send an email to yt-users-leave@python.org</a><br> </blockquote></div><br></div> </div></div><br>______________________________<wbr>_________________<br> yt-users mailing list -- yt-users@python.org</a><br> To unsubscribe send an email to yt-users-leave@python.org</a><br> <br>______________________________<wbr>_________________<br> yt-users mailing list -- yt-users@python.org</a><br> To unsubscribe send an email to yt-users-leave@python.org</a><br> <br></blockquote></div><br></div></div></div></div> <br>______________________________<wbr>_________________<br> yt-users mailing list -- yt-users@py= thon.org</a><br> To unsubscribe send an email to yt-users@py= thon.org</a><br> To unsubscribe send an email to--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
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>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>On Tue, Feb 20, 2018 at 7:47 PM, Kazem Ardaneh= <kazem.arrdaneh@gmail.com</a>></span> wrote:<br>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=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?<br>= span></p></div><div>
<div><div><br>Kazem </div></div></div></div></div></div></div> </font></span></div> <br>______________________________<wbr>_________________<br> yt-users mailing list -- yt-users@py= thon.org</a><br> To unsubscribe send an email to yt-users@py= thon.org</a><br> To unsubscribe send an email to Download2253Age (days ago)2253Last active (days ago)
0 comments1 participantsparticipants (1)
Kazem Ardaneh