Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Jammy2211 committed Dec 13, 2023
1 parent a433b99 commit 58110e1
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 20 deletions.
6 changes: 3 additions & 3 deletions autoarray/fit/fit_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,10 @@ def chi_squared_with_mask_fast_from(
np.subtract(
data,
model_data,
),
noise_map,
)[np.asarray(mask) == 0],
noise_map[np.asarray(mask) == 0],
)
)[np.asarray(mask) == 0]
)
)
)

Expand Down
15 changes: 15 additions & 0 deletions autoarray/inversion/pixelization/mappers/mapper_util.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import numpy as np
from scipy.spatial import cKDTree
from typing import Tuple

from autoconf import conf
Expand Down Expand Up @@ -172,6 +173,20 @@ def pix_indexes_for_sub_slim_index_delaunay_from(
return pix_indexes_for_sub_slim_index, pix_indexes_for_sub_slim_index_sizes


def nearest_pixelization_index_for_slim_index_from_kdtree(grid, mesh_grid):

kdtree = cKDTree(mesh_grid)

sparse_index_for_slim_index = []

for i in range(grid.shape[0]):

input_point = [grid[i, [0]], grid[i, 1]]
index = kdtree.query(input_point)[1]
sparse_index_for_slim_index.append(index)

return sparse_index_for_slim_index

@numba_util.jit()
def nearest_pixelization_index_for_slim_index_from(grid, mesh_grid):
"""
Expand Down
16 changes: 0 additions & 16 deletions autoarray/inversion/pixelization/mesh/mesh_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,22 +469,6 @@ def voronoi_neighbors_from(
-------
The arrays containing the 1D index of every pixel's neighbors and the number of neighbors that each pixel has.
"""
"""
Returns the neighbors and total number of neighbors of every cell on a Voronoi mesh.
Neighbors are returned as an ndarray of shape [total_pixels, max_neighbors_in_a_given_voronoi pixel], where
entries have values of -1 if the pixel has no neighbor.
The number of neighbors of every pixel is also returned as an ndarray of shape [total_pixels], where the values
are integers between 0 and the total neighbors in a given Voronoi pixel.
Parameters
----------
pixels
The number of pixels on the Voronoi mesh
ridge_points
Contains the information on every Voronoi pixel and its neighbors.
"""
neighbors_sizes = np.zeros(shape=(pixels))

for ridge_index in range(ridge_points.shape[0]):
Expand Down
2 changes: 1 addition & 1 deletion autoarray/plot/mat_plot/one_d.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def plot_yx(
text_manual_dict_y=None,
bypass: bool = False,
):
if (y is None) or np.count_nonzero(y) == 0:
if (y is None) or np.count_nonzero(y) == 0 or np.isnan(y).all():
return

ax = None
Expand Down

0 comments on commit 58110e1

Please sign in to comment.