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 user,
I try to use Generic UnicGrid Data (256^3 gas density cube + position
of particle that is subset of a huge simulation).
It is preliminary work, but I still have some questions.
1. In order to set density unit as cgs, I made following script:
......
data = dict(density = (map, "g/cm**3")) #map is 256^3 density data array
bbox = np.array([[0., boxsize], [0., boxsize], [0.,boxsize]])
ds = load_uniform_grid(data, data['density'][0].shape, 3.086e24,
bbox=bbox, nprocs=4)
.....
Then, I got the following error message:
Traceback (most recent call last):
File "cutout2.py", line 62, in <module>
ds = load_uniform_grid(data, data['density'][0].shape, 3.086e24,
bbox=bbox, nprocs=4)
File "/Users/jhchoi/common/lib/python2.7/site-packages/yt-3.0dev-py2.7-macosx-10.4-x86_64.egg/yt/frontends/stream/data_structures.py",
line 461, in load_uniform_grid
psize = get_psize(np.array(data[key].shape), nprocs)
AttributeError: 'tuple' object has no attribute 'shape'
Hence, I modify "data = dict(density = (map, "g/cm**3"))" --> "data =
dict(density = map)" and it work.
If this is the case, how can I define the density unit and show it
when I make Slice/Projection?
In addition, I would like to know how I can set the unit in Generic
UnicGrid Data in general?
The length unit can be provide to script in load_uniform_grid(...
3.086e24 ....) but I do not know how to set other units.
2. When I add particle information as follow:
.....
npart = 100000 # number of particles
data = dict(density = map,
number_of_particles = npart,
particle_position_x = posx,
particle_position_y = posy,
particle_position_z = posz)
bbox = np.array([[0., boxsize], [0., boxsize], [0.,boxsize]])
ds = load_uniform_grid(data, data['density'][0].shape, 3.086e24,
bbox=bbox, nprocs=4)
...
I got the following error message:
Traceback (most recent call last):
File "cutout.py", line 107, in <module>
ds = load_uniform_grid(data, data['density'][0].shape, 3.086e24,
bbox=bbox, nprocs=4)
File "/Users/jhchoi/common/lib/python2.7/site-packages/yt-3.0dev-py2.7-macosx-10.4-x86_64.egg/yt/frontends/stream/data_structures.py",
line 519, in load_uniform_grid
assign_particle_data(spf, pdata)
File "/Users/jhchoi/common/lib/python2.7/site-packages/yt-3.0dev-py2.7-macosx-10.4-x86_64.egg/yt/frontends/stream/data_structures.py",
line 371, in assign_particle_data
pdata.pop("number_of_particles")
KeyError: 'number_of_particles'
So, I change "number_of_particles = npart," --> "number_of_particles =
100000," and it works.
How could it happen?
3. Can I do halo finder (hop/fof) using the above particle data?
Or, what information do I need to provide to do grouping?
In this case, how can I set the units and linking length?
4. Can I make particle distribution to particle data like
data['Dark_Matter_position_x']?
This process will allow me additional analysis such as profile and
obtaining total value.
I may ask too many for new tool, but it will help a lot to use yt for
general data set.
Thank you,
Junhwan
I'd like to try using the PerspectiveCamera instead of the normal
orthographic Camera. My script renders fine with Camera(), but I thought
that I should be able to just change Camera() to PerspectiveCamera() and it
should render with the perspective. Instead, I get an empty rendering --
is there something else one needs to do to use the PerspectiveCamera rather
than just changing the class name but otherwise keeping the argument list
the same?
Mike
--
Michael Zingale
Associate Professor
Dept. of Physics & Astronomy • Stony Brook University • Stony Brook, NY
11794-3800
*phone*: 631-632-8225
*e-mail*: Michael.Zingale(a)stonybrook.edu
*web*: http://www.astro.sunysb.edu/mzingale
Hi folks,
I'm trying to make a projection of an Enzo dataset using yt-3, showing the
maximum level along the line of sight. This command:
ProjectionPlot(pf,"x","grid_level",weight_field=None,data_source=reg,width=(0.25,'unitary')).save()
definitely seems to make projections of grid levels, but I'm not convinced
that it is the maximum level along the LOS. Is there a better way to do
this?
Thanks!
--Brian
Is there a way to set the background color for projection plots? I'd like
to set it to be black instead of white, which I assume is the default.
Thanks,
Andrew E.
--
Graduate Student
Columbia University
Department of Astronomy
Hi Junhwan,
I'm having trouble finding anything wrong with your script, actually.
I would recommend changing this:
ds = load_uniform_grid(data, data['density'][0].shape, 3.086e24, bbox=bbox, nprocs=4)
to this:
ds = load_uniform_grid(data, data['density'][0].shape, length_unit=(1.0,"Mpc"), bbox=bbox, nprocs=4)
but I doubt that would make much of a difference.
Have you inspected what data["density"][0] is in your script, and what npart is? I set up an example on my own with random particle data, and I set the number_of_particles dictionary key to a variable npart that was set previously, and saw no issues there.
If it's possible to post the file that this script works with somewhere, that would enable me to reproduce the buggy behavior.
Best,
John Z
On May 22, 2014, at 6:19 PM, John ZuHone <jzuhone(a)gmail.com> wrote:
> Hi Junhwan,
>
> Sorry, I kind of got lost in some other things--I'll have a look at your script tonight and get back to you.
>
> Best,
>
>
> On May 22, 2014, at 6:17 PM, Junhwan Choi (최준환) <choi.junhwan(a)gmail.com> wrote:
>
>> Hi,
>>
>> I have read more about the "generic array data" from the document in yt webpage.
>> I found that the the how to set data dict and call "load_uniform_grid"
>> by yt-2.6 and yt-3.0 are quite different, and it looks that yt-3.0
>> supports better unit treatment.
>>
>> However, my yt-3.0 looks use old formate for load_uniform_grid as follow:
>> .....
>> def load_uniform_grid(data, domain_dimensions, sim_unit_to_cm, bbox=None,
>> nprocs=1, sim_time=0.0, periodicity=(True, True, True)):
>> ....
>>
>> This load_uniform_grid arguments are different with those presented in
>> yt-3.0 document.
>> I think this is part of the reason that I have a difficulty.
>>
>> How can I use that load_uniform_grid for the version shown in yt-3.0 document?
>>
>> Thank you,
>> Junhwan
>>
>> On Fri, May 16, 2014 at 11:28 AM, Junhwan Choi (최준환)
>> <choi.junhwan(a)gmail.com> wrote:
>>> Here, I post my script in http://paste.yt-project.org/show/4641
>>>
>>> Thank you,
>>> Junhwan
>>>
>>> On Thu, May 15, 2014 at 11:56 PM, John ZuHone <jzuhone(a)gmail.com> wrote:
>>>> Junhwan,
>>>>
>>>> Can you post your script somewhere? It might be easier to debug it that way.
>>>>
>>>> Best,
>>>>
>>>> John Z
>>>>
>>>> On May 16, 2014, at 12:46 AM, Junhwan Choi <choi.junhwan(a)gmail.com> wrote:
>>>>
>>>> Hi Nathan,
>>>>
>>>> I think that I am using the yt 3.0 unless there is stabke yt 3.0 version.
>>>>
>>>> Junhwan
>>>>
>>>>
>>>>
>>>> On May 15, 2014, at 11:29 PM, Nathan Goldbaum <nathan12343(a)gmail.com> wrote:
>>>>
>>>> Hi Junhwan,
>>>>
>>>> Just to clarify (since the answers you receive will be different depending
>>>> on your response) is this for the in-development yt 3.0 release or the
>>>> current stable release?
>>>>
>>>> Nathan
>>>>
>>>> On Friday, May 16, 2014, Junhwan Choi (최준환) <choi.junhwan(a)gmail.com> wrote:
>>>>>
>>>>> Dear yt user,
>>>>>
>>>>> I try to use Generic UnicGrid Data (256^3 gas density cube + position
>>>>> of particle that is subset of a huge simulation).
>>>>> It is preliminary work, but I still have some questions.
>>>>>
>>>>> 1. In order to set density unit as cgs, I made following script:
>>>>> ......
>>>>> data = dict(density = (map, "g/cm**3")) #map is 256^3 density data array
>>>>> bbox = np.array([[0., boxsize], [0., boxsize], [0.,boxsize]])
>>>>> ds = load_uniform_grid(data, data['density'][0].shape, 3.086e24,
>>>>> bbox=bbox, nprocs=4)
>>>>> .....
>>>>>
>>>>> Then, I got the following error message:
>>>>> Traceback (most recent call last):
>>>>> File "cutout2.py", line 62, in <module>
>>>>> ds = load_uniform_grid(data, data['density'][0].shape, 3.086e24,
>>>>> bbox=bbox, nprocs=4)
>>>>> File
>>>>> "/Users/jhchoi/common/lib/python2.7/site-packages/yt-3.0dev-py2.7-macosx-10.4-x86_64.egg/yt/frontends/stream/data_structures.py",
>>>>> line 461, in load_uniform_grid
>>>>> psize = get_psize(np.array(data[key].shape), nprocs)
>>>>> AttributeError: 'tuple' object has no attribute 'shape'
>>>>>
>>>>> Hence, I modify "data = dict(density = (map, "g/cm**3"))" --> "data =
>>>>> dict(density = map)" and it work.
>>>>> If this is the case, how can I define the density unit and show it
>>>>> when I make Slice/Projection?
>>>>> In addition, I would like to know how I can set the unit in Generic
>>>>> UnicGrid Data in general?
>>>>> The length unit can be provide to script in load_uniform_grid(...
>>>>> 3.086e24 ....) but I do not know how to set other units.
>>>>>
>>>>> 2. When I add particle information as follow:
>>>>> .....
>>>>> npart = 100000 # number of particles
>>>>> data = dict(density = map,
>>>>> number_of_particles = npart,
>>>>> particle_position_x = posx,
>>>>> particle_position_y = posy,
>>>>> particle_position_z = posz)
>>>>> bbox = np.array([[0., boxsize], [0., boxsize], [0.,boxsize]])
>>>>> ds = load_uniform_grid(data, data['density'][0].shape, 3.086e24,
>>>>> bbox=bbox, nprocs=4)
>>>>> ...
>>>>>
>>>>> I got the following error message:
>>>>> Traceback (most recent call last):
>>>>> File "cutout.py", line 107, in <module>
>>>>> ds = load_uniform_grid(data, data['density'][0].shape, 3.086e24,
>>>>> bbox=bbox, nprocs=4)
>>>>> File
>>>>> "/Users/jhchoi/common/lib/python2.7/site-packages/yt-3.0dev-py2.7-macosx-10.4-x86_64.egg/yt/frontends/stream/data_structures.py",
>>>>> line 519, in load_uniform_grid
>>>>> assign_particle_data(spf, pdata)
>>>>> File
>>>>> "/Users/jhchoi/common/lib/python2.7/site-packages/yt-3.0dev-py2.7-macosx-10.4-x86_64.egg/yt/frontends/stream/data_structures.py",
>>>>> line 371, in assign_particle_data
>>>>> pdata.pop("number_of_particles")
>>>>> KeyError: 'number_of_particles'
>>>>>
>>>>> So, I change "number_of_particles = npart," --> "number_of_particles =
>>>>> 100000," and it works.
>>>>> How could it happen?
>>>>>
>>>>> 3. Can I do halo finder (hop/fof) using the above particle data?
>>>>> Or, what information do I need to provide to do grouping?
>>>>> In this case, how can I set the units and linking length?
>>>>>
>>>>> 4. Can I make particle distribution to particle data like
>>>>> data['Dark_Matter_position_x']?
>>>>> This process will allow me additional analysis such as profile and
>>>>> obtaining total value.
>>>>>
>>>>> I may ask too many for new tool, but it will help a lot to use yt for
>>>>> general data set.
>>>>>
>>>>> Thank you,
>>>>> Junhwan
>>>>> _______________________________________________
>>>>> yt-users mailing list
>>>>> yt-users(a)lists.spacepope.org
>>>>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>>>
>>>> _______________________________________________
>>>> yt-users mailing list
>>>> yt-users(a)lists.spacepope.org
>>>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>>>
>>>> _______________________________________________
>>>> yt-users mailing list
>>>> yt-users(a)lists.spacepope.org
>>>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> yt-users mailing list
>>>> yt-users(a)lists.spacepope.org
>>>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>>>
>> _______________________________________________
>> yt-users mailing list
>> yt-users(a)lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
Dear All,
How to find virial radius from enzo output. From the following page
http://yt-project.org/docs/2.6/reference/api/generated/yt.analysis_modules.…
I came to know that there is a function called virial_radius(). But how to
use it?
In the provided example
>>> vr = halos[0].virial_radius()
what is ' halos[0] ' ?
Thank You
--
Reju Sam John
Hi all,
I am trying to make a nice volume rendering, and am having some trouble.
My camera commands are:
tf = ColorTransferFunction((-29,-24))
tf.add_layers(8,w=0.1,colormap="Hue Sat Value 2")
tf.sample_colormap(-26.5,w=0.02,colormap="Hue Sat Value 2")
cam = pf.h.camera([0.0,2.,1.8],[0.0,-1.0,-0.2],4.0,512,tf)
cam.show()
I will attach the image, also (v11). First, when I use add_layers, can I
get yt to print out WHERE the layers are? Second, but related, when I just
use add_layers I only see the higher density gas. I have to add
sample_colormap to see lower density gas (the blue stuff). Compare v11 to
v6 to see what I am talking about.
Thanks!
Stephanie
I'm trying to show the transfer function on a volume render. Plotting a
velocity component, I set the transfer function with 4 Gaussians all with
the same width. The range of the transfer function is -1.e7 to 1.e7, but
for some reason, when output, the upper label in the colorbar is not 1.e7
but a bit lower (9.92e6). I am not sure where the code is that draws this,
and I am confused why it is not setting the tick at 1.e7. It gets the
bottom tick right.
Here's an image:
http://bender.astro.sunysb.edu/random/test_0000.png
and the script:
http://bender.astro.sunysb.edu/random/vol_rotate.py
any pointers are appreciated.
Mike
--
Michael Zingale
Associate Professor
Dept. of Physics & Astronomy • Stony Brook University • Stony Brook, NY
11794-3800
*phone*: 631-632-8225
*e-mail*: Michael.Zingale(a)stonybrook.edu
*web*: http://www.astro.sunysb.edu/mzingale
Hi yt,
I have a pretty simple question that I ought to know the answer to - how
do I extract the actual values in the field_list or derived_field_list of a
ds?
For example, I have a field: ('PartType0', 'Coordinates'),
but printing something like pf[('PartType0','Coordinates')] doesn't return
the list of particle type 0 coordinates (or anything for that matter). Do
I have to access this through a pf.all_data() command somehow?
Thanks
-desika