[yt-users] ZEUS support by means of the GDF format

Andrea Negri negri.andre at gmail.com
Fri May 6 10:36:31 PDT 2016


Dear Kacper,

thanks for the file.
I am quite in trouble in understanding the GDF format. My data are on
a spherical grid, regularly sampled in theta and phi for every grid.
Only the r direction has multiple levels of refinements, structured in
this way (units in pc, just to say a unit):
r_1 = [0.1, ..., 10]
r_2 = [10, ..., 100]
...
r_n = [..., 250000]


So there is no overlapping on the r_i array (except for one point),
and the spacing in the r_i arrays is constant. My data are stored in
this way:

density_1[:,:,:] is sampled on r_1, theta and phi
...
density_n[:,:,:] is sampled on r_n, theta and phi


So the big question is: what should I put in the arrays like
grid_left_index, grid_level,  grid_parent_id?

On 4 May 2016 at 18:46, Kacper Kowalik <xarthisius.kk at gmail.com> wrote:
> On 05/04/2016 10:38 AM, Andrea Negri wrote:
>>
>> Hi,
>>
>> I want to support the ZEUS code by means of the GDF format. Today I
>> wrote a program that basically interpolates the outputs of ZEUS over a
>> series of uniformly spaced grids.
>>
>> Next step would be actually create the file in the GDF format.
>>
>> Here it comes the issue: I downloaded the example file from
>> https://bitbucket.org/yt_analysis/grid_data_format#branches and I
>> tried to load it with
>>
>>   ds=yt.load('RD0005.gdf')
>
>
> Hi Andrea,
> that file is a little outdated. You can grab more recent output from:
>
> http://yt-project.org/data/sedov_tst_0004.tar.gz
>
> Cheers,
> Kacper
>
>>
>>
>> but I obtain the error
>>
>> KeyError                                  Traceback (most recent call
>> last)
>> <ipython-input-6-37dba47b307d> in <module>()
>> ----> 1 ds=yt.load('RD0005.gdf')
>>
>> /home/tockay1NS/negri/software/yt/yt-x86_64/src/yt-hg/yt/convenience.pyc
>> in load(*args, **kwargs)
>>       84     candidates = find_lowest_subclasses(candidates)
>>       85     if len(candidates) == 1:
>> ---> 86         return candidates[0](*args, **kwargs)
>>       87     if len(candidates) == 0:
>>       88         if ytcfg.get("yt", "enzo_db") != '' \
>>
>>
>> /home/tockay1NS/negri/software/yt/yt-x86_64/src/yt-hg/yt/frontends/gdf/data_structures.pyc
>> in __init__(self, filename, dataset_type, storage_filename, geometry,
>> units_override, unit_system)
>>      179         self.fluid_types += ("gdf",)
>>      180         Dataset.__init__(self, filename, dataset_type,
>> --> 181                          units_override=units_override,
>> unit_system=unit_system)
>>      182         self.storage_filename = storage_filename
>>      183         self.filename = filename
>>
>>
>> /home/tockay1NS/negri/software/yt/yt-x86_64/src/yt-hg/yt/data_objects/static_output.pyc
>> in __init__(self, filename, dataset_type, file_style, units_override,
>> unit_system)
>>      234
>>      235         self._create_unit_registry()
>> --> 236         self._parse_parameter_file()
>>      237         self.set_units()
>>      238         self._setup_coordinate_handler()
>>
>>
>> /home/tockay1NS/negri/software/yt/yt-x86_64/src/yt-hg/yt/frontends/gdf/data_structures.pyc
>> in _parse_parameter_file(self)
>>      248         self.refine_by = refine_by
>>      249         self.dimensionality = sp["dimensionality"]
>> --> 250         self.current_time = sp["current_time"]
>>      251         self.unique_identifier = sp["unique_identifier"]
>>      252         self.cosmological_simulation =
>> sp["cosmological_simulation"]
>>
>>
>> /home/tockay1NS/negri/software/yt/yt-x86_64/lib/python2.7/site-packages/h5py-2.5.0-py2.7-linux-x86_64.egg/h5py/_objects.so
>> in h5py._objects.with_phil.wrapper
>>
>> (/home/tockay1NS/negri/software/yt/yt-x86_64/src/h5py-2.5.0/h5py/_objects.c:2458)()
>>
>>
>> /home/tockay1NS/negri/software/yt/yt-x86_64/lib/python2.7/site-packages/h5py-2.5.0-py2.7-linux-x86_64.egg/h5py/_objects.so
>> in h5py._objects.with_phil.wrapper
>>
>> (/home/tockay1NS/negri/software/yt/yt-x86_64/src/h5py-2.5.0/h5py/_objects.c:2415)()
>>
>>
>> /home/tockay1NS/negri/software/yt/yt-x86_64/lib/python2.7/site-packages/h5py-2.5.0-py2.7-linux-x86_64.egg/h5py/_hl/attrs.pyc
>> in __getitem__(self, name)
>>       50         """ Read the value of an attribute.
>>       51         """
>> ---> 52         attr = h5a.open(self._id, self._e(name))
>>       53
>>       54         if attr.get_space().get_simple_extent_type() == h5s.NULL:
>>
>>
>> /home/tockay1NS/negri/software/yt/yt-x86_64/lib/python2.7/site-packages/h5py-2.5.0-py2.7-linux-x86_64.egg/h5py/_objects.so
>> in h5py._objects.with_phil.wrapper
>>
>> (/home/tockay1NS/negri/software/yt/yt-x86_64/src/h5py-2.5.0/h5py/_objects.c:2458)()
>>
>>
>> /home/tockay1NS/negri/software/yt/yt-x86_64/lib/python2.7/site-packages/h5py-2.5.0-py2.7-linux-x86_64.egg/h5py/_objects.so
>> in h5py._objects.with_phil.wrapper
>>
>> (/home/tockay1NS/negri/software/yt/yt-x86_64/src/h5py-2.5.0/h5py/_objects.c:2415)()
>>
>>
>> /home/tockay1NS/negri/software/yt/yt-x86_64/lib/python2.7/site-packages/h5py-2.5.0-py2.7-linux-x86_64.egg/h5py/h5a.so
>> in h5py.h5a.open
>>
>> (/home/tockay1NS/negri/software/yt/yt-x86_64/src/h5py-2.5.0/h5py/h5a.c:2062)()
>>
>> KeyError: "Can't open attribute (Can't locate attribute: 'current_time')"
>>
>>
>>
>>
>>
>> Can you help me?
>> Many thanks in advance!
>>
>> Andrea
>> _______________________________________________
>> 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