Code: Select all
import numpy as np
from astropy.io import fits
from astropy.visualization import simple_norm
from astropy.wcs import WCS
import matplotlib.pyplot as plt
hdul = fits.open("test.fits")
img = hdul[0].data
hdr = hdul[0].header
wcs = WCS(hdr)
def displayimage(img, wcs):
fig, ax = plt.subplots(figsize=(5, 5), subplot_kw={"projection": wcs.celestial})
norm = simple_norm(img, vmin=0, vmax=np.nanmax(img), stretch="linear")
im = ax.imshow(img, norm=norm, cmap="viridis", origin="lower")
lon = ax.coords[0]
lat = ax.coords[1]
lon.set_axislabel("RA")
lat.set_axislabel("Dec")
plt.show()
displayimage(img, wcs)
Jetzt möchte ich einige hohle Kreise basierend auf Koordinaten und Größe wie:
verstreuen
Code: Select all
(RA, Dec, Size) = (120*u.deg, 30*u.deg, 25*u.arcmin)