idl_function
IDL-compatible numerical helpers for the matched-filter pipeline.
These functions reproduce small array and weighted-regression utilities used by the original IDL AMICAL implementation.
array_coords(ind, dim)
Convert flattened square-array indices to two-dimensional coordinates.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ind
|
int or array-like of int
|
Flattened indices into a |
required |
dim
|
int
|
Side length of the square array in pixels. |
required |
Returns:
| Type | Description |
|---|---|
numpy.ndarray of shape (2, ...)
|
x then y coordinates corresponding to |
Source code in src/amical/mf_pipeline/idl_function.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | |
dblarr(dim1, dim2=None)
Create a zero-filled floating-point array.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dim1
|
int
|
Length of a one-dimensional array or first array dimension. |
required |
dim2
|
int
|
Second array dimension. If omitted, return a one-dimensional array. |
None
|
Returns:
| Type | Description |
|---|---|
ndarray
|
Zero-filled array of shape |
Source code in src/amical/mf_pipeline/idl_function.py
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 | |
dist(naxis)
Compute a periodic radial-distance map.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
naxis
|
int
|
Side length of the square output array in pixels. |
required |
Returns:
| Type | Description |
|---|---|
numpy.ndarray of shape (naxis, naxis)
|
Euclidean distance from the Fourier origin in pixels, with periodic frequency ordering. |
Examples:
>>> dist(3)
array([[0. , 1. , 1. ],
[1. , 1.41421356, 1.41421356],
[1. , 1.41421356, 1.41421356]])
Source code in src/amical/mf_pipeline/idl_function.py
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | |
regress_noc(x, y, weights)
Perform a weighted linear regression without a constant term.
y and weights may carry leading batch dimensions, in which case an
independent regression is performed for each and every output gains the
same leading dimensions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
numpy.ndarray of shape (n_terms, n_observations)
|
Regression design matrix. |
required |
y
|
numpy.ndarray of shape (..., n_observations)
|
Observed values. |
required |
weights
|
numpy.ndarray of shape (..., n_observations)
|
Multiplicative weights for each observation. |
required |
Returns:
| Type | Description |
|---|---|
object
|
Regression results containing coefficients, coefficient covariance, fitted values, mean squared error, and fitted-value variances. |
Source code in src/amical/mf_pipeline/idl_function.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | |