[yt-users] reading gadget-2 binary/hdf5 format

Nathan Goldbaum nathan12343 at gmail.com
Tue May 3 10:08:31 PDT 2016


Hi Semyeong,

Yes, this is issue 823:

https://bitbucket.org/yt_analysis/yt/issues/823

If you're up for it, adding a print_stats method for SPH data would be a
great first contribution to yt.

-Nathan

On Tue, May 3, 2016 at 11:59 AM, Semyeong Oh <semyeong.oh at gmail.com> wrote:

> Hi Nathan,
>
>
> I can run the script, and I think it just must have been something I did
> before running this part of the code
> that produced the problem (not sure exactly what..). Sorry for the trouble.
>
>
> I just wanted to report that even if the dataset is correctly loaded,
> print_stats for this and also the example at yt
> (http://yt-project.org/data/GadgetDiskGalaxy.tar.gz)
> seem to give AttributeError
>
> ---------------------------------------------------------------------------AttributeError                            Traceback (most recent call last)<ipython-input-5-d2b97580ae55> in <module>()----> 1 ds.print_stats()
> /Users/semyeong/miniconda2/envs/yt/lib/python2.7/site-packages/yt/utilities/parallel_tools/parallel_analysis_interface.pyc in root_only(*args, **kwargs)    317     def root_only(*args, **kwargs):    318         if not parallel_capable:--> 319             return func(*args, **kwargs)    320         comm = _get_comm(args)    321         rv = None
> /Users/semyeong/miniconda2/envs/yt/lib/python2.7/site-packages/yt/data_objects/static_output.pyc in print_stats(self)    357     @parallel_root_only    358     def print_stats(self):--> 359         self.index.print_stats()    360     361     @property
> AttributeError: 'ParticleIndex' object has no attribute 'print_stats'
>
>
>
> Thanks,
> Semyeong
>
>
>
> On Tue, May 3, 2016 at 12:33 PM Nathan Goldbaum <nathan12343 at gmail.com>
> wrote:
>
>> Hi Semyeong,
>>
>> Hmm, so I just tried with yt 3.2.3, and I'm unable to reproduce this
>> using the following script (and with the snapshot you uploaded in the same
>> directory as the script):
>>
>> http://paste.yt-project.org/show/6455/
>>
>> So I'm not sure what's going wrong on your setup. Are you unable to run
>> my pasted script?
>>
>> -Nathan
>>
>> On Tue, May 3, 2016 at 11:13 AM, Semyeong Oh <semyeong.oh at gmail.com>
>> wrote:
>>
>>> It is
>>>
>>> yt module located at:
>>>     /Users/semyeong/miniconda2/envs/yt/lib/python2.7/site-packages
>>>
>>> The current version and changeset for the code is:
>>>
>>> ---
>>> Version = 3.2.3
>>> Changeset = None
>>> ---
>>>
>>> Semyeong
>>>
>>> On Tue, May 3, 2016 at 12:09 PM Nathan Goldbaum <nathan12343 at gmail.com>
>>> wrote:
>>>
>>>> Hi Semyeong,
>>>>
>>>> I'm not able to reproduce this behavior in yt 3.3dev. Any chance you
>>>> can share what yt version you're using? The output of "yt version", run
>>>> from the command line, should be sufficient.
>>>>
>>>> -Nathan
>>>>
>>>> On Tue, May 3, 2016 at 11:06 AM, Semyeong Oh <semyeong.oh at gmail.com>
>>>> wrote:
>>>>
>>>>> Sure, this is the link http://use.yt/upload/28d51f76
>>>>>
>>>>> Semyeong
>>>>>
>>>>> On Tue, May 3, 2016 at 12:05 PM Nathan Goldbaum <nathan12343 at gmail.com>
>>>>> wrote:
>>>>>
>>>>>> Any chance you can link to the HDF5 file? I don't have a gadget
>>>>>> development environment set up.
>>>>>>
>>>>>> You can use the yt curldrop:
>>>>>>
>>>>>> $ curl -T snapshot_000.hdf5 http://use.yt/upload/
>>>>>>
>>>>>> And then share the link this prints out here.
>>>>>>
>>>>>> -Nathan
>>>>>>
>>>>>> On Tue, May 3, 2016 at 11:02 AM, Semyeong Oh <semyeong.oh at gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>>> Hi Nathan,
>>>>>>>
>>>>>>> The dataset is just from
>>>>>>> http://wwwmpa.mpa-garching.mpg.de/gadget/gadget-2.0.7.tar.gz ICs/gassphere_littleendian.dat,
>>>>>>> and output from running the simulation
>>>>>>> (using /Gadget2/parameterfiles/gassphere.{Makefile/param} with format=2
>>>>>>> (hdf5)
>>>>>>>
>>>>>>> Semyeong
>>>>>>>
>>>>>>> On Tue, May 3, 2016 at 11:54 AM Matthew Turk <matthewturk at gmail.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> Hi Semyeong,
>>>>>>>>
>>>>>>>> Looks like the bounding box is getting confused somehow, and it's
>>>>>>>> seeing it as the same value for left/right edge.  I think your ordering of
>>>>>>>> the bbox is correct (if it weren't, then changing the ordering to be
>>>>>>>> [[-bbox_lim, -bbox_lim, -bbox_lim], [bbox_lim, bbox_lim, bbox_lim]] would
>>>>>>>> fix it) but I'm not sure why it's failing.
>>>>>>>>
>>>>>>>> On Tue, May 3, 2016 at 10:46 AM, Semyeong Oh <semyeong.oh at gmail.com
>>>>>>>> > wrote:
>>>>>>>>
>>>>>>>>> Hello,
>>>>>>>>>
>>>>>>>>> I'm having trouble reading gadget-2 both binary and hdf5 format,
>>>>>>>>> and
>>>>>>>>> was wondering if I could get some help.
>>>>>>>>> I'm testing out with the example distributed with gadget code, the
>>>>>>>>> gas sphere example which only
>>>>>>>>> contains ~1500 gas particles.
>>>>>>>>>
>>>>>>>>> - If I try to read the initial condition (distributed with gadget)
>>>>>>>>> binary file with yt.load, this command seems to
>>>>>>>>> execute fine, but the field_list returns empty list.
>>>>>>>>>
>>>>>>>>> - If I try to read the output of the simulation in hdf5 format,
>>>>>>>>> fname = 'output/snapshot_000.hdf5'
>>>>>>>>> unit_base = {'UnitLength_in_cm'         : 1.,
>>>>>>>>>              'UnitMass_in_g'            : 1.,
>>>>>>>>>              'UnitVelocity_in_cm_per_s' : 1.}
>>>>>>>>>
>>>>>>>>> bbox_lim = 5
>>>>>>>>> bbox = [[-bbox_lim,bbox_lim],
>>>>>>>>>         [-bbox_lim,bbox_lim],
>>>>>>>>>         [-bbox_lim,bbox_lim]]
>>>>>>>>>
>>>>>>>>> ds = yt.load(fname,unit_base=unit_base, bounding_box=bbox)
>>>>>>>>>
>>>>>>>>> and try ds.field_list or ds.print_stats,
>>>>>>>>> I end up getting something like this
>>>>>>>>> https://gist.github.com/smoh/7779e9ef546f9b05565aef86893dccd2
>>>>>>>>> which is obscure.
>>>>>>>>>
>>>>>>>>> What am I doing wrong?
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>> Semyeong
>>>>>>>>> --
>>>>>>>>> Semyeong
>>>>>>>>>
>>>>>>>>> _______________________________________________
>>>>>>>>> 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
>>>>>>>>
>>>>>>> --
>>>>>>> Semyeong
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> 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
>>>>>>
>>>>> --
>>>>> Semyeong
>>>>>
>>>>> _______________________________________________
>>>>> 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
>>>>
>>> --
>>> Semyeong
>>>
>>> _______________________________________________
>>> 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
>>
> --
> Semyeong
>
> _______________________________________________
> 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-users-spacepope.org/attachments/20160503/d22b637c/attachment.htm>


More information about the yt-users mailing list