[yt-dev] [yt-users] Make projections for uniform grid FLASH4 data
John ZuHone
jzuhone at gmail.com
Tue Aug 7 14:48:58 PDT 2012
Hi Suoqing,
We have a patch for at least part of the problem you are seeing with 2D data. If you're on the development branch, try updating using "yt update."
If the output of "yt instinfo" doesn't have the current version of the code as "a0d43ccae65d", then you'll have to manually pull as Matt had you do before:
hg pull https://bitbucket.org/yt_analysis/yt
hg up
python2.7 setup.py develop
This will fix the slice plots, but we've tried doing a projection plot using your data and the code segfaults. We will have to look into this a little more to see what is going on with that, but I'm sure it's a mistake on our end somewhere.
We've talked about it on the dev side, and it is true that you should get the same thing with a slice and a projection for 2D data, except for the fact that the projected data will have been multiplied by the length of the domain in the z direction (which in your case appears to be the width of one cell), unless you have weighted the data by something. So my advice would be just to use slices for 2D data.
Thanks for bringing all of this to our attention... we really want to make sure everyone's FLASH data is well-supported.
Best,
John Z
On Aug 7, 2012, at 5:04 PM, Nathan Goldbaum wrote:
> Hi Suoqing,
>
> John ZuHone is going to try to sort this out tonight. I think he'll let you know as soon as he figures out what went wrong.
>
> Cheers,
>
> Nathan
>
> On Aug 7, 2012, at 1:15 PM, Ji Suoqing wrote:
>
>> Hi Nathan,
>>
>> Sure! It just took several time for me to download from server and upload to dropbox.
>>
>> http://dl.dropbox.com/u/83265784/relax_hdf5_chk_0000
>>
>> Thanks for your consideration and care!
>>
>> Best wishes,
>> Suoqing
>>
>> 在 2012-8-7,下午4:03,Nathan Goldbaum <nathan12343 at gmail.com> 写道:
>>
>>> I'm replying off-list because to minimize the number of messages to the rest of yt-users.
>>>
>>> Would you mind making your dataset available to me? It will make it much easier to figure out what's going wrong if I can directly reproduce the behavior you're seeing.
>>>
>>> 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
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-dev-spacepope.org/attachments/20120807/29e1c149/attachment.htm>
More information about the yt-dev
mailing list