pynbody.util.index_before_slice

pynbody.util.index_before_slice#

pynbody.util.index_before_slice(s, index)[source]#

Return an index array new_index with the property that, for a slice s (start, stop and step all positive), ar[s][index] == ar[new_index].