Skip to content

Commit

Permalink
shape check
Browse files Browse the repository at this point in the history
  • Loading branch information
yusukeaso-astron committed Jan 6, 2025
1 parent 7cca706 commit 3603c12
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions plotastrodata/plot_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1315,6 +1315,18 @@ def plot3d(levels: list[float] = [3, 6, 12],
def plot_on_wall(sign: int, axis: int, **kwargs):
if kwargs == {}:
return

match axis:
case 2:
shape = np.shape(d.data[:, :, 0])
case 1:
shape = np.shape(d.data[:, 0, :])
case 0:
shape = np.shape(d.data[0, :, :])
if np.shape(kwargs['data']) != shape:
print('The shape of the 2D data is inconsistent with the shape of the 3D data.')
return

_kw = {'levels': [3, 6, 12, 24, 48, 96, 192, 384],
'sigma': 'hist', 'cmap': 'Jet', 'alpha': 0.3}
_kw.update(kwargs)
Expand Down

0 comments on commit 3603c12

Please sign in to comment.