Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always set imshow origin to "lower" #1950

Merged
merged 2 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions photutils/aperture/bounding_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,10 @@ def as_artist(self, **kwargs):
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
rng = np.random.default_rng(0)
ax.imshow(rng.random((10, 10)), interpolation='nearest',
cmap='viridis')
ax.imshow(rng.random((10, 10)), origin='lower',
interpolation='nearest')
ax.add_patch(bbox.as_artist(facecolor='none', edgecolor='white',
lw=2.))
lw=2.0))
"""
from matplotlib.patches import Rectangle

Expand Down
2 changes: 1 addition & 1 deletion photutils/profiles/curve_of_growth.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ class CurveOfGrowth(ProfileBase):

norm = simple_norm(data, 'sqrt')
plt.figure(figsize=(5, 5))
plt.imshow(data, norm=norm)
plt.imshow(data, norm=norm, origin='lower')
cog.apertures[5].plot(color='C0', lw=2)
cog.apertures[10].plot(color='C1', lw=2)
cog.apertures[15].plot(color='C3', lw=2)
Expand Down
2 changes: 1 addition & 1 deletion photutils/profiles/radial_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ class RadialProfile(ProfileBase):

norm = simple_norm(data, 'sqrt')
plt.figure(figsize=(5, 5))
plt.imshow(data, norm=norm)
plt.imshow(data, norm=norm, origin='lower')
rp.apertures[5].plot(color='C0', lw=2)
rp.apertures[10].plot(color='C1', lw=2)
rp.apertures[15].plot(color='C3', lw=2)
Expand Down
2 changes: 1 addition & 1 deletion photutils/psf/image_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class ImagePSF(Fittable2DModel):
psf_data = gaussian_psf(xx, yy)
psf_model = ImagePSF(psf_data, x_0=12, y_0=12, flux=10)
data = psf_model(xx, yy)
plt.imshow(data)
plt.imshow(data, origin='lower')
"""

flux = Parameter(default=1,
Expand Down
11 changes: 5 additions & 6 deletions photutils/psf/matching/windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class SplitCosineBellWindow:

taper = SplitCosineBellWindow(alpha=0.4, beta=0.3)
data = taper((101, 101))
plt.imshow(data, cmap='viridis', origin='lower')
plt.imshow(data, origin='lower')
plt.colorbar()

A 1D cut across the image center:
Expand Down Expand Up @@ -129,7 +129,7 @@ class HanningWindow(SplitCosineBellWindow):

taper = HanningWindow()
data = taper((101, 101))
plt.imshow(data, cmap='viridis', origin='lower')
plt.imshow(data, origin='lower')
plt.colorbar()

A 1D cut across the image center:
Expand Down Expand Up @@ -173,7 +173,7 @@ class TukeyWindow(SplitCosineBellWindow):

taper = TukeyWindow(alpha=0.4)
data = taper((101, 101))
plt.imshow(data, cmap='viridis', origin='lower')
plt.imshow(data, origin='lower')
plt.colorbar()

A 1D cut across the image center:
Expand Down Expand Up @@ -212,7 +212,7 @@ class CosineBellWindow(SplitCosineBellWindow):

taper = CosineBellWindow(alpha=0.3)
data = taper((101, 101))
plt.imshow(data, cmap='viridis', origin='lower')
plt.imshow(data, origin='lower')
plt.colorbar()

A 1D cut across the image center:
Expand Down Expand Up @@ -252,8 +252,7 @@ class TopHatWindow(SplitCosineBellWindow):

taper = TopHatWindow(beta=0.4)
data = taper((101, 101))
plt.imshow(data, cmap='viridis', origin='lower',
interpolation='nearest')
plt.imshow(data, origin='lower', interpolation='nearest')
plt.colorbar()

A 1D cut across the image center:
Expand Down
4 changes: 2 additions & 2 deletions photutils/utils/depths.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,11 @@ class ImageDepth:

fig, ax = plt.subplots(nrows=1, ncols=2, figsize=(9, 3))
norm = simple_norm(data, 'sqrt', percent=99.)
ax[0].imshow(data, norm=norm)
ax[0].imshow(data, norm=norm, origin='lower')
color = 'orange'
depth.apertures[0].plot(ax[0], color=color)
ax[0].set_title('Data with blank apertures')
ax[1].imshow(mask, interpolation='none')
ax[1].imshow(mask, origin='lower', interpolation='none')
depth.apertures[0].plot(ax[1], color=color)
ax[1].set_title('Mask with blank apertures')

Expand Down