def seeing_hist(): plot_params() FWHM, sdate = load_sdata(year=[2015,2016],month=[3,6],day=[6,14]) plt.ion() plt.clf() plt.figure(1) plt.hist(FWHM,bins=50) plt.xlim(0,5) plt.xlabel('FWHM',fontsize=18) plt.ylabel('Frequency',fontsize=18) med = np.median(FWHM) plt.annotate('Median = %.2f' % med, [.85,.8], horizontalalignment='right',xycoords='figure fraction',fontsize=15) return FWHM, sdate
import thacherphot as tp import numpy as np import matplotlib.pyplot as plt from length import length import quick_image as qi import glob from fitgaussian import * from astropy.stats import sigma_clipped_stats from photutils import daofind from plot_params import * plot_params() path = './' name='fiber_raw4*fit' files = glob.glob(path+name) def get_fiber_flux(file,fwhm=20,threshold=100): image,header = qi.readimage(file,plot=False) mean, median, std = sigma_clipped_stats(image, sigma=3.0) source = daofind(image - median, fwhm=fwhm, threshold=threshold*std) xcen = np.int(np.round(source['xcentroid'][0])) ycen = np.int(np.round(source['ycentroid'][0])) plt.plot([xcen],[ycen],'rx',markersize=20) params = fitgaussian(image) y,x = params[1],params[2]