[yt-users] Analyzing DM-only run

Matthew Turk matthewturk at gmail.com
Fri Mar 12 10:02:18 PST 2010


Hi Kai,

Right now, the velocity vectors only work with the baryon quantities.  
It might be possible to make a smoothed, cell-based particle velocity  
field. I'm not sure why your other command segfaulted; can you send me  
a separate email off list with a backtrace?

-Matt



On Mar 12, 2010, at 11:20 AM, kcai at pa.uky.edu wrote:

> Hi Matt and Britton,
>
>   Thank you both for teaching me how to plot particles in the past.  
> Now that I got rid of the redundant particles in the initial  
> conditions, it is desirable to look at the subsequent evolution in  
> more detail - in particular, the sphere of particles still got  
> destroyed fairly quickly. So we suspect it is the initial velocity  
> field that was not set up properly. However, I tried to use
>
> p = pc.add_slice('particle_density_pyx', 0)
> p.modify["velocity"]()
> but failed (the add_slice part works):
>
> Traceback (most recent call last):
>  File "DM_plots.py", line 14, in <module>
>    pc.save("RD0000/Redshift199")
>  File "/share/home/kca223/lib/python2.6/site-packages/yt-1.6-py2.6- 
> linux-x86_64.egg/yt/raven/PlotCollection.py", line 81, in save
>    override=override, force_save=force_save))
>  File "/share/home/kca223/lib/python2.6/site-packages/yt-1.6-py2.6- 
> linux-x86_64.egg/yt/raven/PlotTypes.py", line 112, in save_image
>    self._redraw_image()
>  File "/share/home/kca223/lib/python2.6/site-packages/yt-1.6-py2.6- 
> linux-x86_64.egg/yt/raven/PlotTypes.py", line 374, in _redraw_image
>    self._run_callbacks()
>  File "/share/home/kca223/lib/python2.6/site-packages/yt-1.6-py2.6- 
> linux-x86_64.egg/yt/raven/PlotTypes.py", line 238, in _run_callbacks
>    cb(self)
>  File "/share/home/kca223/lib/python2.6/site-packages/yt-1.6-py2.6- 
> linux-x86_64.egg/yt/raven/Callbacks.py", line 75, in __call__
>    return qcb(plot)
>  File "/share/home/kca223/lib/python2.6/site-packages/yt-1.6-py2.6- 
> linux-x86_64.egg/yt/raven/Callbacks.py", line 102, in __call__
>    plot.data[self.field_x] - self.bv_x,
>  File "/share/home/kca223/lib/python2.6/site-packages/yt-1.6-py2.6- 
> linux-x86_64.egg/yt/lagos/BaseDataTypes.py", line 249, in __getitem__
>    self.get_data(key)
>  File "/share/home/kca223/lib/python2.6/site-packages/yt-1.6-py2.6- 
> linux-x86_64.egg/yt/lagos/BaseDataTypes.py", line 584, in get_data
>    if self._generate_field(field):
>  File "/share/home/kca223/lib/python2.6/site-packages/yt-1.6-py2.6- 
> linux-x86_64.egg/yt/lagos/BaseDataTypes.py", line 606, in  
> _generate_field
>    self.pf.field_info[field].check_available(self)
>  File "/share/home/kca223/lib/python2.6/site-packages/yt-1.6-py2.6- 
> linux-x86_64.egg/yt/lagos/FieldInfoContainer.py", line 267, in  
> check_available
>    validator(data)
>  File "/share/home/kca223/lib/python2.6/site-packages/yt-1.6-py2.6- 
> linux-x86_64.egg/yt/lagos/FieldInfoContainer.py", line 365, in  
> __call__
>    raise NeedsDataField(doesnt_have)
> yt.lagos.FieldInfoContainer.NeedsDataField: (['y-velocity'])
>>>> pc.save("RD0000/Redshift199")
> Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
>  File "/share/home/kca223/lib/python2.6/site-packages/yt-1.6-py2.6- 
> linux-x86_64.egg/yt/raven/PlotCollection.py", line 81, in save
>    override=override, force_save=force_save))
>  File "/share/home/kca223/lib/python2.6/site-packages/yt-1.6-py2.6- 
> linux-x86_64.egg/yt/raven/PlotTypes.py", line 112, in save_image
>    self._redraw_image()
>  File "/share/home/kca223/lib/python2.6/site-packages/yt-1.6-py2.6- 
> linux-x86_64.egg/yt/raven/PlotTypes.py", line 374, in _redraw_image
>    self._run_callbacks()
>  File "/share/home/kca223/lib/python2.6/site-packages/yt-1.6-py2.6- 
> linux-x86_64.egg/yt/raven/PlotTypes.py", line 238, in _run_callbacks
>    cb(self)
>  File "/share/home/kca223/lib/python2.6/site-packages/yt-1.6-py2.6- 
> linux-x86_64.egg/yt/raven/Callbacks.py", line 75, in __call__
>    return qcb(plot)
>  File "/share/home/kca223/lib/python2.6/site-packages/yt-1.6-py2.6- 
> linux-x86_64.egg/yt/raven/Callbacks.py", line 102, in __call__
>    plot.data[self.field_x] - self.bv_x,
>  File "/share/home/kca223/lib/python2.6/site-packages/yt-1.6-py2.6- 
> linux-x86_64.egg/yt/lagos/BaseDataTypes.py", line 249, in __getitem__
>    self.get_data(key)
>  File "/share/home/kca223/lib/python2.6/site-packages/yt-1.6-py2.6- 
> linux-x86_64.egg/yt/lagos/BaseDataTypes.py", line 584, in get_data
>    if self._generate_field(field):
>  File "/share/home/kca223/lib/python2.6/site-packages/yt-1.6-py2.6- 
> linux-x86_64.egg/yt/lagos/BaseDataTypes.py", line 606, in  
> _generate_field
>    self.pf.field_info[field].check_available(self)
>  File "/share/home/kca223/lib/python2.6/site-packages/yt-1.6-py2.6- 
> linux-x86_64.egg/yt/lagos/FieldInfoContainer.py", line 267, in  
> check_available
>    validator(data)
>  File "/share/home/kca223/lib/python2.6/site-packages/yt-1.6-py2.6- 
> linux-x86_64.egg/yt/lagos/FieldInfoContainer.py", line 365, in  
> __call__
>    raise NeedsDataField(doesnt_have)
> yt.lagos.FieldInfoContainer.NeedsDataField: (['y-velocity'])
>
> and I tried pc.add_slice('ParticleVelocityMagnitude', 0) and got  
> segfault.
> Do you have any suggestions?
>
>  In addition, how may I smooth the particle density and see more  
> structures?
>
> Thanks a lot,
> Kai
>
> Quoting Matthew Turk <matthewturk at gmail.com>:
>
>> Hi Kai,
>>
>> You're right, good luck.
>>
>> -MAtt
>>
>> On Thu, Mar 11, 2010 at 10:42 PM,  <kcai at pa.uky.edu> wrote:
>>> Hi Matt,
>>>   Sorry for responding a bit late - I was out for dinner. We got a  
>>> visitor
>>> here...
>>>
>>>   I did find the gdb command you sent me a while ago, but looks  
>>> like I get
>>> the problem fixed already - I found I can not only reset the  
>>> NumberOfParticles,
>>> but also the "size" of the ParticleField[] array. So I set it to  
>>> be the same
>>> as NumberOfParticles. Now: not only I get a perfect sphere of  
>>> particles with
>>> nothing outside initially; and no segfaults with the YT script  
>>> now. So you
>>> are right - it's those redundant array elements which caused the  
>>> trouble.
>>> So it may not be necessary to get a "backtrace" now - don't you  
>>> think?
>>>
>>> Thanks,
>>> Kai
>>>
>>> Quoting Matthew Turk <matthewturk at gmail.com>:
>>>
>>>> Use gdb, get a backtrace.  Alternately, get a core dump and a
>>>> backtrace off that.  If it's really segfaulting, the problem  
>>>> needs to
>>>> be debugged that way.
>>>>
>>>> On Thu, Mar 11, 2010 at 6:00 PM,  <kcai at pa.uky.edu> wrote:
>>>>>
>>>>> Hi Matt,
>>>>>   Thanks for helping out. Here is what I got (I don't know what  
>>>>> is a "gdb
>>>>> backtrace"):
>>>>>
>>>>>> python2.6 -i DM_plots.py
>>>>>
>>>>> /home/kca223/lib/python2.6/site-packages/IPython/Magic.py:38:
>>>>> DeprecationWarning: the sets module is deprecated
>>>>>  from sets import Set
>>>>> yt         INFO       2010-03-11 18:34:20,059 Created plot  
>>>>> collection
>>>>> with
>>>>> default plot-center = [0.5, 0.5, 0.5]
>>>>> yt         INFO       2010-03-11 18:34:20,172 Getting the binary
>>>>> hierarchy
>>>>> yt         INFO       2010-03-11 18:34:20,174 Finished with binary
>>>>> hierarchy
>>>>> reading
>>>>> yt         INFO       2010-03-11 18:34:20,285 Getting field
>>>>> particle_position_y from 1
>>>>> yt         INFO       2010-03-11 18:34:20,285 Getting  
>>>>> particle_position_y
>>>>> using ParticleIO
>>>>> yt         INFO       2010-03-11 18:34:20,597 Getting field
>>>>> particle_position_z from 1
>>>>> yt         INFO       2010-03-11 18:34:20,597 Getting  
>>>>> particle_position_z
>>>>> using ParticleIO
>>>>> yt         INFO       2010-03-11 18:34:21,214 Generating overlap  
>>>>> masks
>>>>> for
>>>>> level 0
>>>>> Reading and masking grids 100%
>>>>> ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||  
>>>>> Time:
>>>>> 00:00:00
>>>>> yt         INFO       2010-03-11 18:34:21,215 Finished calculating
>>>>> overlap.
>>>>> Segmentation fault 0 /  0   0% |
>>>>>
>>>>> And my YT script:
>>>>>
>>>>> from yt.mods import *
>>>>> pf = load("RD0002/RedDump0002", data_style = "enzo_packed_3d")
>>>>> pc = PlotCollection(pf, center = [0.5, 0.5, 0.5])
>>>>> pc.add_particles(0, 0.5, p_size=1.0)
>>>>> pc.add_projection("particle_density_pyx", 0)
>>>>> pc.add_projection("particle_density_pyx", 1)
>>>>> pc.save("RD0002/Redshift100")
>>>>>
>>>>> Thanks in advance,
>>>>> Kai
>>>>>
>>>>> ----------------------------------------------------------------
>>>>> This message was sent using IMP, the Internet Messaging Program.
>>>>>
>
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
>



More information about the yt-users mailing list