<jupyter_start><jupyter_text>Transform the coordinates:<jupyter_code>planes = ['disk', 'gal', 'source', 'obs']

s = 12
fig, axes = plt.subplots(nrows=2, ncols=2, figsize=(s,s), sharex=True, sharey=True)
for i, plane in enumerate(planes):
#     x, y = transform._disk2gal(true_pars, prev_x, prev_y)
    x, y = transform.transform_coords(X, Y, 'disk', plane, true_pars)
    args = [x, y, *func_args]
    bim = func(*args)

    ax = axes[i//2, i%2]
    mesh = ax.pcolormesh(x, y, bim)
    plt.colorbar(mesh, ax=ax)
    ax.set_title(f'{plane} transform of basis function 00')
N = 3
func, func_args = bb.get_basis_func(N)

planes = ['disk', 'gal', 'source', 'obs']

# uniform grid for all planes
X, Y = utils.build_map_grid(nx, ny)

s = 12
fig, axes = plt.subplots(nrows=2, ncols=2, figsize=(s,s-1), sharex=True, sharey=True)
for i, plane in enumerate(planes):
#     x, y = transform._disk2gal(true_pars, prev_x, prev_y)
    xp, yp = transform.transform_coords(X, Y, plane, 'disk', true_pars)
    args = [xp, yp, *func_args]
    bim = func(*args)

    ax = axes[i//2, i%2]
    mesh = ax.pcolormesh(X, Y, bim)
    plt.colorbar(mesh, ax=ax)
    Nx, Ny = func_args[1], func_args[2]
    ax.set_title(f'{plane} transform of basis function ({Nx},{Ny})')<jupyter_output><empty_output><jupyter_text>Transform the basis funcs:<jupyter_code>planes = ['disk', 'gal', 'source', 'obs']

X, Y = utils.build_map_grid(nx, ny)

s = 12
fig, axes = plt.subplots(nrows=2, ncols=2, figsize=(s,s), sharex=True, sharey=True)
for i, plane in enumerate(planes):
#     x, y = transform._disk2gal(true_pars, prev_x, prev_y)
    x, y = transform.transform_coords(X, Y, 'obs', plane, true_pars)
    args = [x, y, *func_args]
    bim = func(*args)

    ax = axes[i//2, i%2]
    mesh = ax.pcolormesh(x, y, bim)
    plt.colorbar(mesh, ax=ax)
    ax.set_title(f'{plane} transform of basis function 00')
# b_disk = func(*[X, Y, *func_args]).reshape(nx*ny)
# plt.plot(b_disk)
# plt.title('disk')

Xdisk, Ydisk = utils.build_map_grid(5, 5)
Bdisk = func(*[Xdisk, Ydisk, *func_args])
plt.pcolormesh(Xdisk, Ydisk, Bdisk)
plt.gcf().set_size_inches(4,4)
print(Xdisk)
plt.imshow(Bdisk, origin='lower')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17582417582417584, 'fraction_numerical': 0.01510989010989011, 'mean_word_length': 4.588235294117647, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '150388', 'license': 'MIT', 'n_tokens_mistral': 953, 'n_tokens_neox': 918, 'n_words': 203, 'path': 'notebooks/basis-transorm.ipynb', 'repo_name': 'KinematicLensing/kl-tools', 'size': '2184'}