deeptrack.extras.radialcenter Module#
Radial center calculation function
This module provides a function to calculate the center location of an intensity distribution.
Module Structure#
Functions: - radialcenter: Calculates the center of a 2D intensity distribution.
Example#
Calculate center of an image containing randomly generated Gaussian blur.
>>> from deeptrack.extras import radialcenter as rc
>>> gaussian_blur = np.random.normal(0, 0.005, (100, 100))
>>> x, y = rc.radialcenter(gaussian_blur)
>>> print(f"Center of distribution = {x}, {y}")
Python implementation by Benjamin Midtvedt, University of Gothenburg, 2020 Copyright 2011-2012, Raghuveer Parthasarathy, The University of Oregon
- Disclaimer / License
- This program is free software: you can redistribute it and/or
modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This set of programs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License (gpl.txt) along with this program.
If not, see <http://www.gnu.org/licenses/>.
Raghuveer Parthasarathy The University of Oregon August 21, 2011 (begun) last modified Apr. 6, 2012 (minor change) Copyright 2011-2012, Raghuveer Parthasarathy
Functions#
|
Test whether all array elements along a given axis evaluate to True. |
|
Returns True if two arrays are element-wise equal within a tolerance. |
|
Return the maximum of an array or maximum along an axis. |
|
Return the minimum of an array or minimum along an axis. |
|
Return the angle of the complex argument. |
|
Test whether any array element along a given axis evaluates to True. |
|
Append values to the end of an array. |
|
Apply a function to 1-D slices along the given axis. |
|
Apply a function repeatedly over multiple axes. |
|
Return evenly spaced values within a given interval. |
|
Returns the indices of the maximum values along an axis. |
|
Returns the indices of the minimum values along an axis. |
|
Perform an indirect partition along the given axis using the algorithm specified by the kind keyword. |
|
Returns the indices that would sort an array. |
|
Find the indices of array elements that are non-zero, grouped by element. |
|
Round an array to the given number of decimals. |
|
array(object, dtype=None, *, copy=True, order='K', subok=False, ndmin=0, |
|
Return a string representation of an array. |
|
True if two arrays have the same shape and elements, False otherwise. |
|
Returns True if input arrays are shape consistent and all elements equal. |
|
Return the string representation of an array. |
|
Split an array into multiple sub-arrays. |
|
Return a string representation of the data in an array. |
|
Convert the input to an ndarray, but pass ndarray subclasses through. |
|
Convert the input to an array. |
|
Convert the input to an array, checking for NaNs or Infs. |
|
Return a contiguous array (ndim >= 1) in memory (C order). |
|
Return an array (ndim >= 1) laid out in Fortran order in memory. |
|
Interpret the input as a matrix. |
|
Copies an array to a specified data type. |
|
Convert inputs to arrays with at least one dimension. |
|
View inputs as arrays with at least two dimensions. |
|
View inputs as arrays with at least three dimensions. |
|
Compute the weighted average along the specified axis. |
|
Return the Bartlett window. |
|
Return a string representation of a number in the given base system. |
|
Return the binary representation of the input number as a string. |
|
Count number of occurrences of each value in array of non-negative ints. |
|
Return the Blackman window. |
|
Assemble an nd-array from nested lists of blocks. |
|
Build a matrix object from a string, nested sequence, or array. |
|
Broadcast any number of arrays against each other. |
|
Broadcast the input shapes into a single shape. |
|
Broadcast an array to a new shape. |
|
busday_count( |
|
busday_offset( |
|
Returns True if cast between data types can occur according to the casting rule. |
|
Construct an array from an index array and a list of arrays to choose from. |
|
Clip (limit) the values in an array. |
|
Stack 1-D arrays as columns into a 2-D array. |
|
Return a scalar type which is common to the input arrays. |
|
Return selected slices of an array along given axis. |
|
concatenate( |
|
concatenate( |
|
Returns the discrete, linear convolution of two one-dimensional sequences. |
|
Return an array copy of the given object. |
|
Copies values from one array to another, broadcasting as necessary. |
|
Return Pearson product-moment correlation coefficients. |
|
Cross-correlation of two 1-dimensional sequences. |
|
Counts the number of non-zero values in the array |
|
Estimate a covariance matrix, given data and weights. |
|
Return the cross product of two (arrays of) vectors. |
|
Return the cumulative product of elements along a given axis. |
|
Return the cumulative sum of the elements along a given axis. |
|
Convert an array of datetimes into an array of strings. |
|
Get information about the step size of a date or time type. |
|
Return a new array with sub-arrays along an axis deleted. |
|
Extract a diagonal or construct a diagonal array. |
|
Return the indices to access the main diagonal of an array. |
|
Return the indices to access the main diagonal of an n-dimensional array. |
|
Create a two-dimensional array with the flattened input as a diagonal. |
|
Return specified diagonals. |
|
Calculate the n-th discrete difference along the given axis. |
|
Return the indices of the bins to which each value in input array belongs. |
|
Dot product of two arrays. |
|
Split array into multiple sub-arrays along the 3rd axis (depth). |
|
Stack arrays in sequence depth wise (along third axis). |
|
The differences between consecutive elements of an array. |
|
einsum(subscripts, *operands, out=None, dtype=None, order='K', |
|
Evaluates the lowest cost contraction order for an einsum expression by considering the creation of intermediate arrays. |
|
Return a new array of given shape and type, without initializing entries. |
|
empty_like(prototype, dtype=None, order='K', subok=True, shape=None, *, |
|
Expand the shape of an array. |
|
Return the elements of an array that satisfy some condition. |
|
Return a 2-D array with ones on the diagonal and zeros elsewhere. |
|
Fill the main diagonal of the given array of any dimensionality. |
|
Round to nearest integer towards zero. |
|
Return indices that are non-zero in the flattened version of a. |
|
Reverse the order of elements in an array along the given axis. |
|
Reverse the order of elements along axis 1 (left/right). |
|
Reverse the order of elements along axis 0 (up/down). |
|
Format a floating-point scalar as a decimal string in positional notation. |
|
Format a floating-point scalar as a decimal string in scientific notation. |
|
Create a NumPy array from an object implementing the |
|
Interpret a buffer as a 1-dimensional array. |
|
Construct an array from data in a text or binary file. |
|
Construct an array by executing a function over each coordinate. |
|
Create a new 1-dimensional array from an iterable object. |
|
Takes an arbitrary Python function and returns a NumPy ufunc. |
|
Construct an array from a text file, using regular expression parsing. |
|
A new 1-D array initialized from text data in a string. |
|
Return a new array of given shape and type, filled with fill_value. |
|
Return a full array with the same shape and type as a given array. |
|
Load data from a text file, with missing values handled as specified. |
|
Return numbers spaced evenly on a log scale (a geometric progression). |
|
Return the directory that contains the NumPy *.h header files. |
|
Return the current print options. |
|
Return the size of the buffer used in ufuncs. |
|
Get the current way of handling floating-point errors. |
|
Return the current callback function used on floating-point errors. |
|
Return the gradient of an N-dimensional array. |
|
Return the Hamming window. |
|
Return the Hanning window. |
|
Compute the histogram of a dataset. |
|
Compute the bi-dimensional histogram of two data samples. |
|
Function to calculate only the edges of the bins used by the histogram function. |
|
Compute the multidimensional histogram of some data. |
|
Split an array into multiple sub-arrays horizontally (column-wise). |
|
Stack arrays in sequence horizontally (column wise). |
|
Modified Bessel function of the first kind, order 0. |
|
Return the identity array. |
|
Return the imaginary part of the complex argument. |
|
Test whether each element of a 1-D array is also present in a second array. |
|
Return an array representing the indices of a grid. |
|
Get help information for an array, function, class, or module. |
|
Inner product of two arrays. |
|
Insert values along the given axis before the given indices. |
|
One-dimensional linear interpolation for monotonically increasing sample points. |
|
Find the intersection of two arrays. |
|
is_busday( |
|
Returns a boolean array where two arrays are element-wise equal within a tolerance. |
|
Returns a bool array, where True if input element is complex. |
|
Check for a complex type or an array of complex numbers. |
|
Determine if a provided dtype is of a specified data type |
|
Check if the array is Fortran contiguous but not C contiguous. |
|
Calculates |
|
Test element-wise for negative infinity, return result as bool array. |
|
Test element-wise for positive infinity, return result as bool array. |
|
Returns a bool array, where True if input element is real. |
|
Return True if x is a not complex type or an array of complex numbers. |
|
Returns True if the type of element is a scalar type. |
|
Returns True if first argument is a typecode lower/equal in type hierarchy. |
|
Check whether or not an object can be iterated over. |
|
Construct an open mesh from multiple sequences. |
|
Return the Kaiser window. |
|
Kronecker product of two arrays. |
|
Perform an indirect stable sort using a sequence of keys. |
|
Return evenly spaced numbers over a specified interval. |
|
Load arrays or pickled objects from |
|
Load data from a text file. |
|
Return numbers spaced evenly on a log scale. |
|
Return the indices to access (n, n) arrays, given a masking function. |
|
Transposes a matrix (or a stack of matrices) |
|
Return the maximum of an array or maximum along an axis. |
|
Determine if two arrays might share memory |
|
Compute the arithmetic mean along the specified axis. |
|
Compute the median along the specified axis. |
|
Return a tuple of coordinate matrices from coordinate vectors. |
|
Return the minimum of an array or minimum along an axis. |
|
For scalar |
|
Return the character for the minimum-size type to which given types can be safely cast. |
|
Move axes of an array to new positions. |
|
Replace NaN with zero and infinity with large finite numbers (default behaviour) or with the numbers defined by the user using the nan, posinf and/or neginf keywords. |
|
Return the indices of the maximum values in the specified axis ignoring NaNs. |
|
Return the indices of the minimum values in the specified axis ignoring NaNs. |
|
Return the cumulative product of array elements over a given axis treating Not a Numbers (NaNs) as one. |
|
Return the cumulative sum of array elements over a given axis treating Not a Numbers (NaNs) as zero. |
|
Return the maximum of an array or maximum along an axis, ignoring any NaNs. |
|
Compute the arithmetic mean along the specified axis, ignoring NaNs. |
|
Compute the median along the specified axis, while ignoring NaNs. |
|
Return minimum of an array or minimum along an axis, ignoring any NaNs. |
|
Compute the qth percentile of the data along the specified axis, while ignoring nan values. |
|
Return the product of array elements over a given axis treating Not a Numbers (NaNs) as ones. |
|
Compute the qth quantile of the data along the specified axis, while ignoring nan values. |
|
Compute the standard deviation along the specified axis, while ignoring NaNs. |
|
Return the sum of array elements over a given axis treating Not a Numbers (NaNs) as zero. |
|
Compute the variance along the specified axis, while ignoring NaNs. |
|
Return the number of dimensions of an array. |
|
Create nditers for use in nested loops |
|
Return the indices of the elements that are non-zero. |
|
Return a new array of given shape and type, filled with ones. |
|
Return an array of ones with the same shape and type as a given array. |
|
Compute the outer product of two vectors. |
|
Packs the elements of a binary-valued array into bits in a uint8 array. |
|
Pad an array. |
|
Return a partitioned copy of an array. |
|
Compute the q-th percentile of the data along the specified axis. |
|
Returns an array with axes transposed. |
|
Evaluate a piecewise-defined function. |
|
Change elements of an array based on conditional and input values. |
|
Find the coefficients of a polynomial with the given sequence of roots. |
|
Find the sum of two polynomials. |
|
Return the derivative of the specified order of a polynomial. |
|
Returns the quotient and remainder of polynomial division. |
|
Least squares polynomial fit. |
|
Return an antiderivative (indefinite integral) of a polynomial. |
|
Find the product of two polynomials. |
|
Difference (subtraction) of two polynomials. |
|
Evaluate a polynomial at specific values. |
|
Context manager for setting print options. |
|
Return the product of array elements over a given axis. |
|
Returns the data type with the smallest size and smallest scalar kind to which both |
|
Range of values (maximum - minimum) along an axis. |
|
Replaces specified elements of an array with given values. |
|
Put values into the destination array by matching 1d index and data slices. |
|
Changes elements of an array based on conditional and input values. |
|
Compute the q-th quantile of the data along the specified axis. |
|
Calculates the center of a 2D intensity distribution. |
|
Return a contiguous flattened array. |
|
Converts a tuple of index arrays into an array of flat indices, applying boundary modes to the multi-index. |
|
Return the real part of the complex argument. |
|
If input is complex with all imaginary parts close to zero, return real parts. |
|
Repeat each element of an array after themselves |
|
Return an ndarray of the provided type that satisfies requirements. |
|
Gives a new shape to an array without changing its data. |
|
Return a new array with the specified shape. |
|
Returns the type that results from applying the NumPy type promotion rules to the arguments. |
|
Roll array elements along a given axis. |
|
Roll the specified axis backwards, until it lies in a given position. |
|
Return the roots of a polynomial with coefficients given in p. |
|
Rotate an array by 90 degrees in the plane specified by axes. |
|
Evenly round to the given number of decimals. |
|
Stack arrays in sequence vertically (row wise). |
|
Save an array to a binary file in NumPy |
|
Save an array to a text file. |
|
Save several arrays into a single file in uncompressed |
|
Save several arrays into a single file in compressed |
|
Find indices where elements should be inserted to maintain order. |
|
Return an array drawn from elements in choicelist, depending on conditions. |
|
Set printing options. |
|
Set the size of the buffer used in ufuncs. |
|
Find the set difference of two arrays. |
|
Set how floating-point errors are handled. |
|
Set the floating-point error callback function or log object. |
|
Find the set exclusive-or of two arrays. |
|
Return the shape of an array. |
|
Determine if two arrays share memory. |
|
Show libraries and system information on which NumPy was built and is being used |
|
Print information about various resources in the system including available intrinsic support and BLAS/LAPACK library in use |
|
Return the normalized sinc function. |
|
Return the number of elements along a given axis. |
|
Return a sorted copy of an array. |
|
Sort a complex array using the real part first, then the imaginary part. |
|
Split an array into multiple sub-arrays as views into ary. |
|
Remove axes of length one from a. |
|
Join a sequence of arrays along a new axis. |
|
Compute the standard deviation along the specified axis. |
|
Sum of array elements over a given axis. |
|
Interchange two axes of an array. |
|
Take elements from an array along an axis. |
|
Take values from the input array by matching 1d index and data slices. |
|
Compute tensor dot product along specified axes. |
|
Construct an array by repeating A the number of times given by reps. |
|
Return the sum along diagonals of the array. |
|
Returns an array with axes transposed. |
|
Integrate along the given axis using the composite trapezoidal rule. |
|
trapz is deprecated in NumPy 2.0. |
|
An array with ones at and below the given diagonal and zeros elsewhere. |
|
Lower triangle of an array. |
|
Return the indices for the lower-triangle of an (n, m) array. |
|
Return the indices for the lower-triangle of arr. |
|
Trim the leading and/or trailing zeros from a 1-D array or sequence. |
|
Upper triangle of an array. |
|
Return the indices for the upper-triangle of an (n, m) array. |
|
Return the indices for the upper-triangle of arr. |
|
Return a description for the given data type code. |
|
Find the union of two arrays. |
|
Find the unique elements of an array. |
|
Find the unique elements of an array, and counts, inverse and indices. |
|
Find the unique elements and counts of an input array x. |
|
Find the unique elements of x and indices to reconstruct x. |
|
Returns the unique elements of an input array x. |
|
Unpacks elements of a uint8 array into a binary-valued output array. |
|
Converts a flat index or array of flat indices into a tuple of coordinate arrays. |
|
Unwrap by taking the complement of large deltas with respect to the period. |
|
Generate a Vandermonde matrix. |
|
Compute the variance along the specified axis. |
|
Return the dot product of two vectors. |
|
Split an array into multiple sub-arrays vertically (row-wise). |
|
Stack arrays in sequence vertically (row wise). |
|
Return elements chosen from x or y depending on condition. |
|
Return a new array of given shape and type, filled with zeros. |
|
Return an array of zeros with the same shape and type as a given array. |