How can you visualize ALMA image data using the Viridis colormap?

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 1K views
dcc
Messages
1
Reaction score
0
Homework Statement
I'm making an image from ALMA data for a presentation. My moment 0 image (fits file) is very faint when coded into python. How do I get it to be brighter than the background so it's more visible?

I've tried the vmin, vmax within the plt.imshow() with no change and also so many other things I can't even recall anymore.
Relevant Equations
image_data = fits.getdata(alma_image, ext=0)
plt.figure()
plt.imshow(image_data, cmap='viridis')
plt.xlim(540,640)
plt.ylim(540,640)
plt.colorbar(extend='both')
plt.clim(0, 1)
plt.show()
image_data = fits.getdata(alma_image, ext=0)
plt.figure()
plt.imshow(image_data, cmap='viridis', vmin=-4, vmax=4)
plt.xlim(540,640)
plt.ylim(540,640)
plt.colorbar(extend='both')
plt.clim(0, 1)
plt.show()
 
Physics news on Phys.org
§ Output> § Markdown### 3.2.2§ Codedef gauss2D(x, y, sigma_x, sigma_y): """ Generate a 2D Gaussian with given x- and y-widths Parameters ---------- x: float x position of peak y: float y position of peak sigma_x: float width in x direction sigma_y: float width in y direction Returns ------- 2D array 2D Gaussian """ return np.exp(-(x**2/sigma_x**2 + y**2/sigma_y**2))# Generate mesh grid for x and y coordinatesx_y = np.mgrid[0:image_data.shape[0], 0:image_data.shape[1]]# Define parameters for Gaussianx_mean = image_data.shape[0] / 2y_mean = image_data.shape[1] / 2sigma_x = 10sigma_y = 10# Calculate the Gaussiangaussian_image = gauss2D(x_y[0] - x_mean, x_y[1] - y_mean, sigma_x, sigma_y)# Plot the Gaussianplt.figure()plt.imshow(gaussian_image, cmap='viridis', vmin=0, vmax=1)plt.colorbar()plt.clim(0, 1)plt.xlabel('$x$')plt.ylabel('$y$')plt.show()§ Output> § Markdown### 3.2.3§ Code# Convolve the Gaussian with the imageconvolved_image = signal.convolve2d(image_data, gaussian_image, boundary='wrap', mode='same')# Plot the convolved imageplt.figure()plt.imshow(