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='orion_native', paranoia=False)

This class is a stripped down class that simply reads and parses filename, without looking at the Orion hierarchy.

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)
clear_all_data()
This routine clears all the data currently being held onto by the grids and the data io handler.
find_max(field, finest_levels=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_particles_by_type(ptype, max_num=None, additional_fields=None)
Returns a structure of arrays with all of the particles’ positions, velocities, masses, types, IDs, and attributes for a particle type ptype for a maximum of max_num particles. If non-default particle fields are used, provide them in additional_fields.
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.
grid
alias of EnzoGrid
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='orion_native')
clear_all_data()
This routine clears all the data currently being held onto by the grids and the data io handler.
find_max(field, finest_levels=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
readGlobalHeader(filename, paranoid_read)
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, data_style)
clear_all_data()
This routine clears all the data currently being held onto by the grids and the data io handler.
find_max(field, finest_levels=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.EnzoGrid(id, hierarchy)

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_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.
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.OrionGrid(LeftEdge, RightEdge, index, level, filename, offset, dimensions, start, stop, paranoia=False, **kwargs)
clear_all()
Clears all datafields from memory and calls clear_derived_quantities().
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.
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_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.
set_field_parameter(name, val)
Here we set up dictionaries that get passed up and down and ultimately to derived fields.

Comments

Feel free to leave comments! If you've got a GMail account, you can use https://www.google.com/accounts/o8/id as your OpenID URL.
comments powered by Disqus