################################################################################# # This code sorts a group of images taken with the iKon CCD camera. import os import numpy as np from astropy.io import fits from astropy import units as u from astropy import constants as const from astropy.coordinates import SkyCoord from astropy.wcs import WCS from astropy.visualization.wcsaxes import WCSAxes from astropy import constants as const from astropy.modeling import models, fitting from astropy.io import ascii from astropy.nddata import Cutout2D import matplotlib.pyplot as plt import matplotlib as mpl from matplotlib.patches import Ellipse import astroquery import matplotlib.cm as cm import glob import sys # ignore astropy warnings import warnings from astropy.utils.exceptions import AstropyWarning warnings.simplefilter('ignore', category=AstropyWarning) ################################################################################# ################################################################################# # Use glob to create list: image_dir = '/mnt/imagesbucket/iKon/Night3/' out_dir='/home/cannon/iKon_April05/' out_dir='/home/cannon/iKon_April05/' image_list = sorted(glob.glob(image_dir+'*.fts*',recursive=True)) N_images = len(image_list) print('-----------------------------------------------------------') print(' --> '+str(N_images)+' images found in '+image_dir) print('-----------------------------------------------------------') ################################################################################# for i in range(0,len(image_list)): header=fits.getheader(image_list[i]) if header['IMAGETYP'] == 'Light Frame' and header['OBJECT'] == 'ngc5055': print(image_list[i]) list.append(image_list[i])