pynbody.util#
util#
Various utility routines used internally by pynbody.
Functions
|
Returns True if a1 and a2 are numpy views pointing to the exact same underlying data; False otherwise. |
|
Finds the value x such that f(x)=0 for a monotonically increasing function f, using a binary search. |
|
Return a slice s3 with the property that ar[s1][s2] == ar[s3] |
|
Given either a numpy array or slice for both i1 and i2, return either a numpy array or slice i3 with the property that |
|
Strip the .gz ending off a string |
|
Mark a method or function as deprecated |
|
Convert th given eps to a SimArray with units of f['pos'] and dtype of f['mass'] |
|
Given an array ar, return nbins+1 monotonically increasing bin edges such that the number of items in each bin is approximately equal. |
|
Incomplete gamma function accepting complex z, based on algorithm given in numerical recipes (3rd ed) |
|
A simple Gauss-Jordan matrix inverter. |
|
|
|
The gravitational softening length is determined from (in order of preference): 1. |
|
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]. |
|
Returns the index to the first element in array which satisfies array[index]>=find. |
|
Given either an array or slice, return len(ar[sl_or_ar]) for any array ar which is large enough that the slice does not overrun it. |
|
Given two python slices s1 and s2, return a new slice which will extract the data of an array d which is in both d[s1] and d[s2]. |
|
|
|
Open a file, determining from the filename whether to use gzip decompression |
|
Open a file for reading, returning also the (decompressed) file size |
Return a random rotation matrix (Haar measure for 3x3 case), using fast algorithm from Graphics Gems III |
|
|
A simple replacement for numpy linalg matrix inverse which handles fractions exactly. |
|
Given a slice s, return a slice s_prime with the property that array[s_relative_to][s_prime] == array[s]. |
|
This routine checks whether a_store and a_in ultimately point to the same buffer; if not, the contents of a_in are copied into a_store. |
|
Run func in separate threads, mapping over the arguments in the same way as map(..) |
|
When scipy.weave.inline is called, it may trigger a compile. |
Classes
Modules