yt.lagos Native AMR Data Structures
These are data structures for interacting with the various AMR platforms that
yt understands and can analyze.
yt.lagos.OutputTypes Output Types
-
class yt.lagos.EnzoStaticOutput(filename, data_style=None, parameter_override=None, conversion_override=None)
Enzo-specific output, set at a fixed time.
This class is a stripped down class that simply reads and parses
filename without looking at the hierarchy. data_style gets passed
to the hierarchy to pre-determine the style of data-output. However,
it is not strictly necessary. Optionally you may specify a
parameter_override dictionary that will override anything in the
paarmeter file and a conversion_override dictionary that consists
of {fieldname : conversion_to_cgs} that will override the #DataCGS.
-
cosmology_get_units()
- Return an Enzo-fortran style dictionary of units to feed into custom
routines. This is typically only necessary if you are interacting
with fortran code.
-
get_parameter(parameter, type=None)
- Gets a parameter not in the parameterDict.
-
has_key(key)
- Returns true or false
-
keys()
- Returns a list of possible keys, from _units, parameters and
_conversion_factors
-
class yt.lagos.OrionStaticOutput(plotname, paramFilename=None, fparamFilename=None, data_style=7, paranoia=False)
This class is a stripped down class that simply reads and parses, without
looking at the Orion hierarchy.
@todo:
@param filename: The filename of the parameterfile we want to load
@type filename: String
need to override for Orion file structure.
the paramfile is usually called “inputs”
and there may be a fortran inputs file usually called “probin”
plotname here will be a directory name
as per BoxLib, data_style will be one of
Native
IEEE (not implemented in yt)
ASCII (not implemented in yt)
-
has_key(key)
- Returns true or false
-
keys()
- Returns a list of possible keys, from _units, parameters and
_conversion_factors
-
class yt.lagos.StaticOutput(filename, data_style=None)
Base class for generating new output types. Principally consists of
a filename and a data_style which will be passed on to children.
-
has_key(key)
- Returns true or false
-
keys()
- Returns a list of possible keys, from _units, parameters and
_conversion_factors
yt.lagos.HierarchyTypes Grid Hierarchies
-
class yt.lagos.EnzoHierarchy(pf, data_style=None)
This is the grid structure as Enzo sees it, with some added bonuses.
It’s primarily used as a class factory, to generate data objects and
access grids.
It should never be created directly – you should always access it via
calls to an affiliated EnzoStaticOutput.
On instantiation, it processes the hierarchy and generates the grids.
-
export_boxes_pv(filename)
- Exports the grid structure in partiview text format.
-
export_particles_pb(filename, filter=1, indexboundary=0, fields=None, scale=1.0)
- Exports all the star particles, or a subset, to pb-format filename
for viewing in partiview. Filters based on particle_type=*filter*,
particle_index>=*indexboundary*, and exports fields, if supplied.
Otherwise, index, position(x,y,z). Optionally scale by a given
factor before outputting.
-
findMax(*args, **kwargs)
- Returns (value, center) of location of maximum for a given field.
-
find_max(field, finestLevels=True)
- Returns (value, center) of location of maximum for a given field.
-
find_min(field)
- Returns (value, center) of location of minimum for a given field
-
find_point(coord)
- Returns the (objects, indices) of grids containing an (x,y,z) point
-
find_ray_grids(coord, axis)
- Returns the (objects, indices) of grids that an (x,y) ray intersects
along axis
-
find_slice_grids(coord, axis)
- Returns the (objects, indices) of grids that a slice intersects along
axis
-
find_sphere_grids(center, radius)
- Returns objects, indices of grids within a sphere
-
get_box_grids(left_edge, right_edge)
- Gets back all the grids between a left edge and right edge
-
get_data(node, name)
- Return the dataset with a given name located at node in the
datafile.
-
get_smallest_dx()
- Returns (in code units) the smallest cell size in the simulation.
-
load_object(name)
- Load and return and object from the data_file using the Pickle protocol,
under the name name on the node /Objects.
-
print_stats()
- Prints out (stdout) relevant information about the simulation
-
save_data(array, node, name, set_attr=None, force=False, passthrough=False)
- Arbitrary numpy data will be saved to the region in the datafile
described by node and name. If data file does not exist, it throws
no error and simply does not save.
-
save_object(obj, name)
- Save an object (obj) to the data_file using the Pickle protocol,
under the name name on the node /Objects.
-
select_grids(level)
- Returns an array of grids at level.
-
class yt.lagos.OrionHierarchy(pf, data_style=7)
-
export_boxes_pv(filename)
- Exports the grid structure in partiview text format.
-
export_particles_pb(filename, filter=1, indexboundary=0, fields=None, scale=1.0)
- Exports all the star particles, or a subset, to pb-format filename
for viewing in partiview. Filters based on particle_type=*filter*,
particle_index>=*indexboundary*, and exports fields, if supplied.
Otherwise, index, position(x,y,z). Optionally scale by a given
factor before outputting.
-
findMax(*args, **kwargs)
- Returns (value, center) of location of maximum for a given field.
-
find_max(field, finestLevels=True)
- Returns (value, center) of location of maximum for a given field.
-
find_min(field)
- Returns (value, center) of location of minimum for a given field
-
find_point(coord)
- Returns the (objects, indices) of grids containing an (x,y,z) point
-
find_ray_grids(coord, axis)
- Returns the (objects, indices) of grids that an (x,y) ray intersects
along axis
-
find_slice_grids(coord, axis)
- Returns the (objects, indices) of grids that a slice intersects along
axis
-
find_sphere_grids(center, radius)
- Returns objects, indices of grids within a sphere
-
get_box_grids(left_edge, right_edge)
- Gets back all the grids between a left edge and right edge
-
get_data(node, name)
- Return the dataset with a given name located at node in the
datafile.
-
get_smallest_dx()
- Returns (in code units) the smallest cell size in the simulation.
-
load_object(name)
- Load and return and object from the data_file using the Pickle protocol,
under the name name on the node /Objects.
-
print_stats()
- Prints out (stdout) relevant information about the simulation
- read the global header file for an Orion plotfile output.
-
save_data(array, node, name, set_attr=None, force=False, passthrough=False)
- Arbitrary numpy data will be saved to the region in the datafile
described by node and name. If data file does not exist, it throws
no error and simply does not save.
-
save_object(obj, name)
- Save an object (obj) to the data_file using the Pickle protocol,
under the name name on the node /Objects.
-
select_grids(level)
- Returns an array of grids at level.
-
class yt.lagos.AMRHierarchy(pf)
-
export_boxes_pv(filename)
- Exports the grid structure in partiview text format.
-
export_particles_pb(filename, filter=1, indexboundary=0, fields=None, scale=1.0)
- Exports all the star particles, or a subset, to pb-format filename
for viewing in partiview. Filters based on particle_type=*filter*,
particle_index>=*indexboundary*, and exports fields, if supplied.
Otherwise, index, position(x,y,z). Optionally scale by a given
factor before outputting.
-
findMax(*args, **kwargs)
- Returns (value, center) of location of maximum for a given field.
-
find_max(field, finestLevels=True)
- Returns (value, center) of location of maximum for a given field.
-
find_min(field)
- Returns (value, center) of location of minimum for a given field
-
find_point(coord)
- Returns the (objects, indices) of grids containing an (x,y,z) point
-
find_ray_grids(coord, axis)
- Returns the (objects, indices) of grids that an (x,y) ray intersects
along axis
-
find_slice_grids(coord, axis)
- Returns the (objects, indices) of grids that a slice intersects along
axis
-
find_sphere_grids(center, radius)
- Returns objects, indices of grids within a sphere
-
get_box_grids(left_edge, right_edge)
- Gets back all the grids between a left edge and right edge
-
get_data(node, name)
- Return the dataset with a given name located at node in the
datafile.
-
get_smallest_dx()
- Returns (in code units) the smallest cell size in the simulation.
-
load_object(name)
- Load and return and object from the data_file using the Pickle protocol,
under the name name on the node /Objects.
-
print_stats()
- Prints out (stdout) relevant information about the simulation
-
save_data(array, node, name, set_attr=None, force=False, passthrough=False)
- Arbitrary numpy data will be saved to the region in the datafile
described by node and name. If data file does not exist, it throws
no error and simply does not save.
-
save_object(obj, name)
- Save an object (obj) to the data_file using the Pickle protocol,
under the name name on the node /Objects.
-
select_grids(level)
- Returns an array of grids at level.
yt.lagos.BaseGridType Grid Types
-
class yt.lagos.EnzoGridBase(id, filename=None, hierarchy=None)
Class representing a single Enzo Grid instance.
Returns an instance of EnzoGrid with id, associated with
filename and hierarchy.
-
clear_all()
- Clears all datafields from memory and calls
clear_derived_quantities().
-
clear_all_grid_references()
- This clears out all references this grid has to any others, as
well as the hierarchy. It’s like extra-cleaning after clear_data.
-
clear_data()
- Clear out the following things: child_mask, child_indices,
all fields, all field parameters.
-
clear_derived_quantities()
- Clears coordinates, child_indices, child_mask.
-
convert(datatype)
- This will attempt to convert a given unit to cgs from code units.
It either returns the multiplicative factor or throws a KeyError.
-
find_max(field)
- Returns value, index of maximum value of field in this gird
-
find_min(field)
- Returns value, index of minimum value of field in this gird
-
get_data(field)
- Returns a field or set of fields for a key or set of keys
-
get_field_parameter(name, default=None)
- This is typically only used by derived field functions, but
it returns parameters used to generate fields.
-
get_global_startindex()
- Return the integer starting index for each dimension at the current
level.
-
get_position(index)
- Returns center position of an index
-
has_field_parameter(name)
- Checks if a field parameter is set.
-
has_key(key)
- Checks if a data field already exists.
-
save_object(name, filename=None)
- Save an object. If filename is supplied, it will be stored in
a shelve file of that name. Otherwise, it will be stored via
yt.lagos.AMRHierarchy.save_object().
-
set_field_parameter(name, val)
- Here we set up dictionaries that get passed up and down and ultimately
to derived fields.
-
set_filename(filename)
- Intelligently set the filename.
-
class yt.lagos.OrionGridBase(LeftEdge, RightEdge, index, level, filename, offset, dimensions, start, stop, paranoia=False)
-
clear_all()
- Clears all datafields from memory and calls
clear_derived_quantities().
-
clear_all_grid_references()
- This clears out all references this grid has to any others, as
well as the hierarchy. It’s like extra-cleaning after clear_data.
-
clear_data()
- Clear out the following things: child_mask, child_indices,
all fields, all field parameters.
-
clear_derived_quantities()
- Clears coordinates, child_indices, child_mask.
-
convert(datatype)
- This will attempt to convert a given unit to cgs from code units.
It either returns the multiplicative factor or throws a KeyError.
-
find_max(field)
- Returns value, index of maximum value of field in this gird
-
find_min(field)
- Returns value, index of minimum value of field in this gird
-
get_data(field)
- Returns a field or set of fields for a key or set of keys
-
get_field_parameter(name, default=None)
- This is typically only used by derived field functions, but
it returns parameters used to generate fields.
-
get_position(index)
- Returns center position of an index
-
has_field_parameter(name)
- Checks if a field parameter is set.
-
has_key(key)
- Checks if a data field already exists.
-
save_object(name, filename=None)
- Save an object. If filename is supplied, it will be stored in
a shelve file of that name. Otherwise, it will be stored via
yt.lagos.AMRHierarchy.save_object().
-
set_field_parameter(name, val)
- Here we set up dictionaries that get passed up and down and ultimately
to derived fields.
-
class yt.lagos.AMRGridPatch(id, filename=None, hierarchy=None)
-
clear_all()
- Clears all datafields from memory and calls
clear_derived_quantities().
-
clear_all_grid_references()
- This clears out all references this grid has to any others, as
well as the hierarchy. It’s like extra-cleaning after clear_data.
-
clear_data()
- Clear out the following things: child_mask, child_indices,
all fields, all field parameters.
-
clear_derived_quantities()
- Clears coordinates, child_indices, child_mask.
-
convert(datatype)
- This will attempt to convert a given unit to cgs from code units.
It either returns the multiplicative factor or throws a KeyError.
-
find_max(field)
- Returns value, index of maximum value of field in this gird
-
find_min(field)
- Returns value, index of minimum value of field in this gird
-
get_data(field)
- Returns a field or set of fields for a key or set of keys
-
get_field_parameter(name, default=None)
- This is typically only used by derived field functions, but
it returns parameters used to generate fields.
-
get_position(index)
- Returns center position of an index
-
has_field_parameter(name)
- Checks if a field parameter is set.
-
has_key(key)
- Checks if a data field already exists.
-
save_object(name, filename=None)
- Save an object. If filename is supplied, it will be stored in
a shelve file of that name. Otherwise, it will be stored via
yt.lagos.AMRHierarchy.save_object().
-
set_field_parameter(name, val)
- Here we set up dictionaries that get passed up and down and ultimately
to derived fields.