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,
I have need for reading some pickle files containing yt array outputs. The files were created by someone else a while ago so I don’t know much about the conditions of their creation. When trying to open them I get the error below.
I am asking here because the comment on line 1384 of the traceback seems to point at a yt issue, not something in the file itself. Has anyone encountered this? Is there a workaround?
Thanks
JT
In [3]: f = open(‘file.cpkl', 'rb')
In [4]: cPickle.load(f)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-4-1f99de24e8dc> in <module>()
----> 1 cPickle.load(f)
/Users/tumlinson/yt-conda/lib/python2.7/site-packages/yt/units/yt_array.pyc in __setstate__(self, state)
1381 """
1382 super(YTArray, self).__setstate__(state[1:])
-> 1383 unit, lut = state[0]
1384 # need to fix up the lut if the pickle was saved prior to PR #1728
1385 # when the pickle format changed
TypeError: 'int' object is not iterable
Hi Nathan,
Here is a script whose output will show the same problem. I'm using
version 3.4.0
--------------------
import yt
import numpy as np
arr = np.random.random(size=(41,56,47))
data = dict(density = (arr,"g/cm**3"))
bbox = np.array([[-4.0,4.2],[-5.5,5.7],[-4.175872,5.22413]])
ds = yt.load_uniform_grid(data, arr.shape, length_unit="cm", bbox=bbox)
ad = ds.all_data()
print ad.quantities.extrema([("gas", "density")])
den = ad.cut_region(['obj["density"] > 0.0'])
print den.quantities.extrema([("gas", "density")])
p = yt.SlicePlot(ds, 'x','density', center="m", data_source=den)
----------------------
thanks for investigating,
Dale
Hello! I have a gadget snapshot that was generated from a non-cosmological
simulation. This causes yt to ignore the box size parameter. However, when
I try to make a plot, yt generally fails because ds.domain_left_edge =
ds.domain_right_edge = 0.0. This necessitates that I change those
parameters manually. My question is: is there a way to get the domain
bounds from the file so that I don't have to set these manually every time?
I noticed that if I get the box size wrong, yt complains about particle
bounds exceeding the domain bounds, and so I looked a little bit at the
code to see if I could figure out how yt was getting these numbers and see
if I could just do something similar, but I haven't had a whole lot of
luck. It seems that in the compute_morton function there's a pos_x.max and
min function, but those are passed in _initialize_index as data having been
read from an hdf5 file?
I'm not super sure I understand what's going on there, but if anyone has
any thoughts, I'd greatly appreciate it. I basically just need the max and
min particle positions along each of the x, y, and z directions, but trying
ad["Coordinates"] fails unless the bounds are properly set to begin with.
Thanks!
-Jared
Hello. I am new here and was trying to setup yt. I installed yt using
virtualenv following the exact steps as mentioned in the github repo.
After that I tried to follow the steps on the quickstart page but it failed
http://yt-project.org/doc/quickstart/index.html
This page. I realised that the path to quickstart on my pc was somewhat
different (/yt-git/doc/source/quickstart).
So I navigated there and tried running `yt notebook` (as mentioned in the
above page) but it failed
ModuleNotFoundError: No module named 'notebook'
This was the last line
How do I run the quickstart process?
I am new to opensource community so I dont really know how to setup the
tools required
Regards,
Arpit Kubadia
Hello,
I have some density data in an unsupported format which I read into yt
by means of the yt.load_uniform_grid() function. I want to filter this
data by creating a cut_region and then do a SlicePlot on the filtered
data. What I find is that no matter how I define the cut_region, the
dynamic range of the resulting plot is said to be 0.0, even though the
cut region has no values in it which are actually 0.0.
I do not have this problem if I use data in a supported format. For
example, I can follow the yt tutorial which creates a SlicePlot from a
cut_region on the Enzo_64 example dataset. So I wonder if maybe the
problem I'm having is due to the fact that when one creates a dataset
using load_uniform_grid(), one ends up with a StreamDataset object
instead of an object representing a supported format.
Here is some relevant output from my session (omitting the code to read
in my data from disk):
In [8]: data2 = np.array(griddata)
In [9]: arr = data2.reshape((41,56,47))
In [10]: data = dict(density = (arr,"g/cm**3"))
In [11]: bbox = np.array([[-4.0,4.2],[-5.5,5.7],[-4.175872,5.22413]])
In [12]: ds = yt.load_uniform_grid(data, arr.shape, length_unit="cm",
bbox=bbox)
yt : [INFO ] 2017-12-09 15:41:20,781 Parameters:
current_time = 0.0
yt : [INFO ] 2017-12-09 15:41:20,781 Parameters:
domain_dimensions = [41 56 47]
yt : [INFO ] 2017-12-09 15:41:20,782 Parameters:
domain_left_edge = [-4. -5.5 -4.175872]
yt : [INFO ] 2017-12-09 15:41:20,782 Parameters:
domain_right_edge = [ 4.2 5.7 5.22413]
yt : [INFO ] 2017-12-09 15:41:20,783 Parameters:
cosmological_simulation = 0.0
In [13]: ds.find_max('density')
yt : [INFO ] 2017-12-09 15:48:16,640 Max Value is 5.14618e+01 at
0.0999999999999996 -0.0000000000000009 -0.0758711276595738
Out[13]: (51.4618 g/cm**3, YTArray([ 1.00000000e-01, -8.88178420e-16,
-7.58711277e-02]) code_length)
In [14]: ds.find_min('density')
yt : [INFO ] 2017-12-09 15:48:53,392 Min Value is 8.71255e-12 at
-3.8999999999999999 -5.4000000000000004 -4.0758719787234039
Out[14]: (8.71255e-12 g/cm**3, YTArray([-3.9 , -5.4 ,
-4.07587198]) code_length)
So you can see from find_min() that all data values are > 0.0. I should
mention that if I do a SlicePlot on ds.all_data(), it looks fine. But
if I try a SlicePlot on a cut_region, even one that essentially
duplicates the entire dataset, then there's nothing to plot even though
the cut_region does have valid data in it:
In [20]: ad = ds.all_data()
In [23]: den = ad.cut_region(['obj["density"] > 0.0'])
In [24]: print den.quantities.extrema([('gas','density')])
[ 8.71255000e-12 5.14618000e+01] g/cm**3
In [25]: p2 = yt.SlicePlot(ds, 'x','density', center="m", data_source=den)
yt : [INFO ] 2017-12-09 15:55:58,155 Max Value is 5.14618e+01 at
0.0999999999999996 -0.0000000000000009 -0.0758711276595738
yt : [INFO ] 2017-12-09 15:55:58,585 xlim = -5.600000 5.600000
yt : [INFO ] 2017-12-09 15:55:58,585 ylim = -4.775872 4.624130
yt : [INFO ] 2017-12-09 15:55:58,586 xlim = -5.600000 5.600000
yt : [INFO ] 2017-12-09 15:55:58,586 ylim = -4.775872 4.624130
yt : [INFO ] 2017-12-09 15:55:58,587 Making a fixed resolution
buffer of (('gas', 'density')) 800 by 800
yt : [WARNING ] 2017-12-09 15:55:58,606 Plot image for field ('gas',
'density') has zero dynamic range. Min = Max = 0.000000.
yt : [WARNING ] 2017-12-09 15:55:58,606 Switching to linear colorbar
scaling.
That first warning message is the problem: zero dynamic range. What's
going wrong?
best wishes,
Dale
Thanks Matt. Not sure where in the docs something like that might go, but
if it's in there, I completely missed it.
Jon
On Fri, Dec 8, 2017 at 2:10 PM, <yt-users-request(a)lists.spacepope.org>
wrote:
>
> Date: Fri, 8 Dec 2017 09:14:01 -0600
> From: Matthew Turk <matthewturk(a)gmail.com>
> To: Discussion of the yt analysis package
> <yt-users(a)lists.spacepope.org>
> Subject: Re: [yt-users] getting real scalar value
> Message-ID:
> <CALO3=5HZT53jPgJeFYxhp-0FNU4gTaZo66sp9tqdZyzmkkMAAA@
> mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hi Jon,
>
> You can see all of these in under ds.parameters, which is populated from
> all the non-field values.
>
> -Matt
>
> On Fri, Dec 8, 2017 at 9:08 AM, Slavin, Jonathan <jslavin(a)cfa.harvard.edu>
> wrote:
>
> > Hi,
> >
> > I would like to get the value of the timestep from my FLASH data read in
> > by yt. In HDFView I can see the value of 'dt' under 'real scalars'.
> Using
> > yt to read in the data, though I don't see any way to access it, if it is
> > contained in the ds. The field list just shows the grid variables. I can
> > get the absolute time via ds.current_time. There are a number of
> different
> > items at the top level in HDFView, e.g. bflags, block size, sim info,
> that
> > are not available, as far as I can tell, from the ds object. Am I missing
> > something? Is there any way to get yt to read in specific variables like
> > dr (under "real scalars")?
> >
> > Thanks,
> > Jon
>
Hi all,
I'm trying to have a first look at my simulations and when I follow the cookbook for plots, I don't see any plot.
I use ipython with:
import yt
ds=yt.load(mysim)
p=yt.ProjectionPlot(ds,"z","density")
and no plot appears, even after a p.show(). p.save() saves the plot to a file, but I am looking for a more direct way to look at the data, and I would rather not use jupyter notebooks.
How can I proceed?
Thanks,
Astrid
Astrid Lamberts
Postdoctoral Researcher
TAPIR Group, Caltech
Hi,
I would like to get the value of the timestep from my FLASH data read in by
yt. In HDFView I can see the value of 'dt' under 'real scalars'. Using yt
to read in the data, though I don't see any way to access it, if it is
contained in the ds. The field list just shows the grid variables. I can
get the absolute time via ds.current_time. There are a number of different
items at the top level in HDFView, e.g. bflags, block size, sim info, that
are not available, as far as I can tell, from the ds object. Am I missing
something? Is there any way to get yt to read in specific variables like
dr (under "real scalars")?
Thanks,
Jon
--
________________________________________________________
Jonathan D. Slavin Harvard-Smithsonian CfA
jslavin(a)cfa.harvard.edu 60 Garden Street, MS 83
phone: (617) 496-7981 Cambridge, MA 02138-1516
cell: (781) 363-0035 USA
________________________________________________________