pynbody.halo.details.iord_mapping.IordOffsetModifier

pynbody.halo.details.iord_mapping.IordOffsetModifier#

class pynbody.halo.details.iord_mapping.IordOffsetModifier(iord_to_offset: IordToOffset, fpos_offset: int)[source]#

Bases: IordToOffset

A wrapper around an IordToOffset which adds a constant offset to the result of the underlying mapping.

Useful if the iord values e.g. are only available for a single family; then the fpos_offset will correspond to the first index of that family in the pynbody snapshot.

Methods

map_ignoring_order(i)

Given an array of iord values, return the corresponding fpos values.

__init__(iord_to_offset: IordToOffset, fpos_offset: int)[source]#
map_ignoring_order(i: ndarray | int) ndarray | int[source]#

Given an array of iord values, return the corresponding fpos values.

Warning: The returned values are not guaranteed to be in the same order as the input iord array.