Skip to content

Mft¤

mft

abcdlux_patch.mft(u, Kx, Ky, left_conj=False, right_conj=False) ¤

Source code in abcdlux_patch.py
225
226
227
228
229
230
231
def mft(
    u: Array, Kx: Array, Ky: Array, left_conj: bool = False, right_conj: bool = False
) -> Array:
    Kx_eff = Kx.conj() if right_conj else Kx
    Ky_eff = Ky.conj() if left_conj else Ky
    tmp = u @ Kx_eff.T
    return Ky_eff @ tmp
mft_kernels

abcdlux_patch.mft_kernels(spec_in, spec_out, alpha, weight=1.0) ¤

Source code in abcdlux_patch.py
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
def mft_kernels(
    spec_in: Array | tuple,
    spec_out: Array | tuple,
    alpha: float,
    weight: float | tuple = 1.0,
) -> tuple[Array, Array]:
    x_in, y_in = unpack_coord_spec(spec_in)
    x_out, y_out = unpack_coord_spec(spec_out)

    if isinstance(weight, (int, float)):
        wx = wy = float(weight)
    else:
        wx, wy = weight

    Kx = _mft_kernel_1d(x_in, x_out, alpha, wx)
    Ky = _mft_kernel_1d(y_in, y_out, alpha, wy)
    return Kx, Ky