yt.frontends.enzo_e.misc module

yt.frontends.enzo_e.misc.bdecode(block)[source]

Decode a block descriptor to get its left and right sides and level.

A block string consisting of (0, 1), with optionally one colon. The number of digits after the colon is the refinement level. The combined digits denote the binary representation of the left edge.

yt.frontends.enzo_e.misc.get_block_info(block, min_dim=3)[source]

Decode a block name to get its left and right sides and level.

Given a block name, this function returns the locations of the block’s left and right edges (measured as binary fractions of the domain along each axis) and level.

Unrefined blocks in the root array (which can each hold an of octree) have a refinement level of 0 while their ancestors (used internally by Enzo-E’s solvers - they don’t actually hold meaningful data) have negative levels. Because identification of negative refinement levels requires knowledge of the root array shape (the ‘root_blocks’ value specified in the parameter file), all unrefined blocks are assumed to have a level of 0.

yt.frontends.enzo_e.misc.get_block_level(block)[source]
yt.frontends.enzo_e.misc.get_block_string_and_dim(block, min_dim=3)[source]
yt.frontends.enzo_e.misc.get_child_index(anc_id, desc_id)[source]
yt.frontends.enzo_e.misc.get_listed_subparam(pdict, parent_param, subparam, default=None)[source]

Returns nested_dict_get(pdict, (parent_param,subparam), default) if subparam is an entry in nested_dict_get(pdict, (parent_param, ‘list’), [])

This is a common idiom in Enzo-E’s parameter parsing

yt.frontends.enzo_e.misc.get_particle_mass_correction(ds)[source]

Normalize particle masses by the root grid cell volume.

This correction is used for Enzo-E datasets where particle masses are stored as densities.

yt.frontends.enzo_e.misc.get_root_block_id(block, min_dim=3)[source]
yt.frontends.enzo_e.misc.get_root_blocks(block, min_dim=3)[source]
yt.frontends.enzo_e.misc.is_parent(anc_block, desc_block)[source]
yt.frontends.enzo_e.misc.nested_dict_get(pdict, keys, default=None)[source]

Retrieve a value from a nested dict using a tuple of keys.

If a is a dict, and a[‘b’] = {‘c’: ‘d’}, then nested_dict_get(a, (‘b’, ‘c’)) returns ‘d’.