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

AI Thread Summary
To visualize ALMA image data using the Viridis colormap, the image data is loaded with `fits.getdata()`, and displayed using `plt.imshow()` with specified limits. The x and y limits are set to focus on a specific region of the image, while a colorbar is added for reference. A 2D Gaussian function is generated to enhance the image, which is then convolved with the original image data using `signal.convolve2d()`. The resulting convolved image is also displayed with the Viridis colormap. This process allows for effective visualization and analysis of ALMA data.
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(
 
Thread 'Help with Time-Independent Perturbation Theory "Good" States Proof'
(Disclaimer: this is not a HW question. I am self-studying, and this felt like the type of question I've seen in this forum. If there is somewhere better for me to share this doubt, please let me know and I'll transfer it right away.) I am currently reviewing Chapter 7 of Introduction to QM by Griffiths. I have been stuck for an hour or so trying to understand the last paragraph of this proof (pls check the attached file). It claims that we can express Ψ_{γ}(0) as a linear combination of...

Similar threads

Back
Top