[yt-users] Make projections for uniform grid FLASH4 data

Nathan Goldbaum nathan12343 at gmail.com
Tue Aug 7 13:01:22 PDT 2012


Hi Suoqing,

There are some people working on your issue in IRC, hopefully we will have a patch for you to try shortly.

> And for John, I always use projection to deal with 2D AMR FLASH data and it works fine, because I suspect that projection will add all the data on different refinement level together. But I suspect slicing might not do exactly the same thing. And now for uniform grid data, both projection and slicing failed.

yt automatically takes into account the fact that data is on different refinement levels.  It doesn't matter if you ask for slices, projections, spheres, cubes, etc.  The yt method paper goes into detail on how exactly this works.  In general, if you ask yt to fetch data from a location in the simulation box, it will always retrieve the data with the finest available resolution.

Cheers,

Nathan

On Aug 7, 2012, at 12:57 PM, Ji Suoqing wrote:

> Hi Matt, Hi John,
> 
> I've tried slicing, and still got the same error:
> 
>>>> from yt.mods import *
>>>> pf=load('relax_hdf5_chk_0000')
> yt : [INFO     ] 2012-08-07 23:53:31,172 Parameters: current_time              = 0.0
> yt : [INFO     ] 2012-08-07 23:53:31,172 Parameters: domain_dimensions         = [512 256   1]
> yt : [INFO     ] 2012-08-07 23:53:31,173 Parameters: domain_left_edge          = [  1.50000000e+07  -6.55360000e+09   0.00000000e+00]
> yt : [INFO     ] 2012-08-07 23:53:31,173 Parameters: domain_right_edge         = [  2.62144000e+10   6.55360000e+09   1.74532925e-02]
> yt : [INFO     ] 2012-08-07 23:53:31,173 Parameters: cosmological_simulation   = 0.0
>>>> p=SlicePlot(pf, 'z', 'Density')
> yt : [INFO     ] 2012-08-07 23:55:10,116 Adding unknown field fspd to list of fields
> yt : [INFO     ] 2012-08-07 23:55:10,116 Adding unknown field spec to list of fields
> Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
>  File "/aphelion/jisuoqing/yt-x86_64/src/yt-hg/yt/visualization/plot_window.py", line 803, in __init__
>    slc = pf.h.slice(axis, center[axis], fields=fields)
>  File "/aphelion/jisuoqing/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 1042, in __init__
>    self._refresh_data()
>  File "/aphelion/jisuoqing/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 315, in _refresh_data
>    self.get_data()
>  File "/aphelion/jisuoqing/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 830, in get_data
>    self._generate_coords()
>  File "/aphelion/jisuoqing/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 1076, in _generate_coords
>    for grid in self._get_grids():
>  File "/aphelion/jisuoqing/yt-x86_64/src/yt-hg/yt/utilities/parallel_tools/parallel_analysis_interface.py", line 900, in _get_grids
>    return ObjectIterator(self, attr='_grids')
>  File "/aphelion/jisuoqing/yt-x86_64/src/yt-hg/yt/utilities/parallel_tools/parallel_analysis_interface.py", line 102, in __init__
>    raise YTNoDataInObjectError(pobj)
> yt.utilities.exceptions.YTNoDataInObjectError: The object requested has no data included in it.  It may lie on a grid face.  Try offsetting slightly.
> 
> And for John, I always use projection to deal with 2D AMR FLASH data and it works fine, because I suspect that projection will add all the data on different refinement level together. But I suspect slicing might not do exactly the same thing. And now for uniform grid data, both projection and slicing failed.
> 
> All best,
> Suoqing
> 
> 
> 在 2012-8-7,下午3:42,John ZuHone <jzuhone at gmail.com> 写道:
> 
>> Suoqing,
>> 
>> Just a quick question... I notice that your dataset is 2D. Have you tried using a SlicePlot instead? If your dataset is 2D, projections and slices should be identical. 
>> 
>> I'm not saying that the projection should fail like it does, but I suspect that you probably would not have trouble with a slice and you would get the same result. 
>> 
>> Best,
>> 
>> John Z
>> 
>> On Aug 7, 2012, at 3:40 PM, Ji Suoqing wrote:
>> 
>>> Ah, thanks a lot! With your suggestion I have axis ticks now.
>>> 
>>> And the ug projection is still a problem.
>>> 
>>> Best wishes,
>>> Suoqing
>>> 
>>> 在 2012-8-7,下午3:34,Ji Suoqing <jisuoqing at gmail.com> 写道:
>>> 
>>>> Hi Matt,
>>>> 
>>>> Thanks for you response. I've tried:
>>>> 
>>>>>>> from yt.mods import  *
>>>>>>> pf=load('relax_hdf5_chk_0000')
>>>> yt : [INFO     ] 2012-08-07 23:39:54,570 Parameters: current_time              = 0.0
>>>> yt : [INFO     ] 2012-08-07 23:39:54,571 Parameters: domain_dimensions         = [512 256   1]
>>>> yt : [INFO     ] 2012-08-07 23:39:54,571 Parameters: domain_left_edge          = [  1.50000000e+07  -6.55360000e+09   0.00000000e+00]
>>>> yt : [INFO     ] 2012-08-07 23:39:54,571 Parameters: domain_right_edge         = [  2.62144000e+10   6.55360000e+09   1.74532925e-02]
>>>> yt : [INFO     ] 2012-08-07 23:39:54,572 Parameters: cosmological_simulation   = 0.0
>>>>>>> p = ProjectionPlot(pf, "z", "Density")
>>>> yt : [INFO     ] 2012-08-07 23:40:02,771 Adding unknown field fspd to list of fields
>>>> yt : [INFO     ] 2012-08-07 23:40:02,772 Adding unknown field spec to list of fields
>>>> Traceback (most recent call last):
>>>> File "<stdin>", line 1, in <module>
>>>> File "/aphelion/jisuoqing/yt-x86_64/src/yt-hg/yt/visualization/plot_window.py", line 875, in __init__
>>>> proj = pf.h.proj(axis,fields,weight_field=weight_field,max_level=max_level,center=center)
>>>> File "/aphelion/jisuoqing/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 1697, in __init__
>>>> self._initialize_source(source)
>>>> File "/aphelion/jisuoqing/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 1724, in _initialize_source
>>>> source = self.pf.h.all_data()
>>>> File "/aphelion/jisuoqing/yt-x86_64/src/yt-hg/yt/data_objects/hierarchy.py", line 188, in all_data
>>>> pf.domain_left_edge, pf.domain_right_edge)
>>>> File "/aphelion/jisuoqing/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 3221, in __init__
>>>> self._refresh_data()
>>>> File "/aphelion/jisuoqing/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 315, in _refresh_data
>>>> self.get_data()
>>>> File "/aphelion/jisuoqing/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 2508, in get_data
>>>> raise YTNoDataInObjectError(self)
>>>> yt.utilities.exceptions.YTNoDataInObjectError: The object requested has no data included in it.
>>>> 
>>>> All best,
>>>> Suoqing
>>>> 
>>>> 在 2012-8-7,下午3:24,Matthew Turk <matthewturk at gmail.com> 写道:
>>>> 
>>>>> Hi Suoqing,
>>>>> 
>>>>> Could you try it with the ProjectionPlot call?  It should look like this:
>>>>> 
>>>>> p = ProjectionPlot(pf, "z", "Density")
>>>>> p.save()
>>>>> 
>>>>> -Matt
>>>>> 
>>>>> On Tue, Aug 7, 2012 at 3:14 PM, Ji Suoqing <jisuoqing at gmail.com> wrote:
>>>>>> Hi all,
>>>>>> 
>>>>>> I'm trying to make projections for uniform grid FLASH4 data with the most updated YT, but there're errors when adding projections:
>>>>>> 
>>>>>> yt : [WARNING  ] 2012-08-07 23:13:56,239 integer runtime parameter checkpointfilenumber overwrites a simulation scalar of the same name
>>>>>> yt : [INFO     ] 2012-08-07 23:13:56,244 Parameters: current_time              = 0.0
>>>>>> yt : [INFO     ] 2012-08-07 23:13:56,245 Parameters: domain_dimensions         = [512 256   1]
>>>>>> yt : [INFO     ] 2012-08-07 23:13:56,245 Parameters: domain_left_edge          = [  1.50000000e+07  -6.55360000e+09   0.00000000e+00]
>>>>>> yt : [INFO     ] 2012-08-07 23:13:56,245 Parameters: domain_right_edge         = [  2.62144000e+10   6.55360000e+09   1.74532925e-02]
>>>>>> yt : [INFO     ] 2012-08-07 23:13:56,245 Parameters: cosmological_simulation   = 0.0
>>>>>> yt : [INFO     ] 2012-08-07 23:13:56,587 Max Value is 2.46340e+06 at 38378027.3437500000000000 6400000.0000000000000000 0.5000000000000000 in grid FLASHGrid_0033 ([128 128   1]) at level 0 (1, 0, 0)
>>>>>> yt : [INFO     ] 2012-08-07 23:13:56,587 Created plot collection with default plot-center = [13114700000.0, 0.0, 0.0087266462599716477]
>>>>>> Traceback (most recent call last):
>>>>>> File "proj.py", line 18, in <module>
>>>>>> p1 = pc.add_projection(my_var, 2)
>>>>>> File "/aphelion/jisuoqing/yt-x86_64/src/yt-hg/yt/visualization/plot_collection.py", line 784, in add_projection
>>>>>> **field_parameters)
>>>>>> File "/aphelion/jisuoqing/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 1697, in __init__
>>>>>> self._initialize_source(source)
>>>>>> File "/aphelion/jisuoqing/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 1724, in _initialize_source
>>>>>> source = self.pf.h.all_data()
>>>>>> File "/aphelion/jisuoqing/yt-x86_64/src/yt-hg/yt/data_objects/hierarchy.py", line 188, in all_data
>>>>>> pf.domain_left_edge, pf.domain_right_edge)
>>>>>> File "/aphelion/jisuoqing/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 3221, in __init__
>>>>>> self._refresh_data()
>>>>>> File "/aphelion/jisuoqing/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 315, in _refresh_data
>>>>>> self.get_data()
>>>>>> File "/aphelion/jisuoqing/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 2508, in get_data
>>>>>> raise YTNoDataInObjectError(self)
>>>>>> yt.utilities.exceptions.YTNoDataInObjectError: The object requested has no data included in it.
>>>>>> 
>>>>>> 
>>>>>> And another separated question: how can I add axis ticks onto projection or slice plot to show the spacial scale? I suspect there should exist some easy way, but I failed to find it.
>>>>>> 
>>>>>> Thanks for your care!
>>>>>> 
>>>>>> All best,
>>>>>> Suoqing
>>>>>> _______________________________________________
>>>>>> yt-users mailing list
>>>>>> yt-users at lists.spacepope.org
>>>>>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>>>> _______________________________________________
>>>>> yt-users mailing list
>>>>> yt-users at lists.spacepope.org
>>>>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>>> 
>>> 
>>> _______________________________________________
>>> yt-users mailing list
>>> yt-users at lists.spacepope.org
>>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>> 
>> _______________________________________________
>> yt-users mailing list
>> yt-users at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
> 
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org




More information about the yt-users mailing list