pynbody.snapshot.namemapper.AdaptiveNameMapper

pynbody.snapshot.namemapper.AdaptiveNameMapper#

class pynbody.snapshot.namemapper.AdaptiveNameMapper(config_name, gadget_blocks=False)[source]#

Bases: object

A class to map between the names of arrays in different simulation codes.

This class is designed to be used in a context where the names of arrays in a simulation code may not be fully known in advance. For example, we might be unsure whether pynbody’s pos array corresponds to the Coordinates array or the Position array in a given simulation snapshot. This class allows us possible different mappings to be given in the configuration, and then once one of the mappings is used, it is locked in for the duration of the object’s lifetime.

Methods

__call__(name[, reverse])

Call self as a function.

__init__(config_name, gadget_blocks=False)[source]#