This is my code and it only opens one fits image, I don't know why if I'm reading all the images inside my folder (there are 10). Does anyone know how to solve it? Thank you.
f_name = sorted(glob.glob('/home/citlali/img_servicio/*.fits'))
for location in f_name:
with fits.open(location) as image:
DATOS = image["FLUX_ELINES"].data
img = DATOS[45, :, :]
plt.imshow(img)
image.close()