#!/usr/bin/env python # -*- coding: utf-8 -*- """ Plots results generated by bin/quicksim.py or pro/desi_quicksim.pro Use this program to compare the IDL and python quicksims using, for example: IDL> desi_quicksim, model='lrg', infile='data/spectra/spec-lrg-z0.7-zmag20.00.dat', outfile='idltest.dat' % bin/quicksim.py --infile data/spectra/spec-lrg-z0.7-zmag20.00.dat --model lrg --outfile pytest.dat % bin/quickplot.py pytest.dat idltest.dat Created 26-Jun-2014 by David Kirkby (dkirkby@uci.edu) """ import sys import numpy as np import matplotlib.pyplot as plt def main(): styles = ('r-','g--','b:') nrow,ncol = 3,2 fig = plt.figure("quicksim",figsize=(16,12)) fig.patch.set_facecolor('white') for i,filename in enumerate(sys.argv[1:]): # read data = (wave,flux,ivar,snr,nobj,nsky,rdnoise,psf) data = np.transpose(np.loadtxt(filename)) style = styles[i % len(styles)] plt.subplot(nrow,ncol,1) plt.plot(data[0],data[1],style) plt.xlabel('Wavelength (Ang)') plt.ylabel('Flux (1e-17 erg/s/cm^2/Ang)') plt.subplot(nrow,ncol,2) plt.plot(data[0],data[3],style) plt.xlabel('Wavelength (Ang)') plt.ylabel('SNR') plt.subplot(nrow,ncol,3) plt.plot(data[0],data[4],style) plt.xlabel('Wavelength (Ang)') plt.ylabel('Object Photons') plt.subplot(nrow,ncol,4) plt.plot(data[0],data[5],style) plt.xlabel('Wavelength (Ang)') plt.ylabel('Sky Photons') plt.subplot(nrow,ncol,5) plt.plot(data[0],data[6],style) plt.xlabel('Wavelength (Ang)') plt.ylabel('Read noise (elec)') plt.subplot(nrow,ncol,6) plt.plot(data[0],data[7],style) plt.xlabel('Wavelength (Ang)') plt.ylabel('PSF FWHM (Ang)') plt.subplots_adjust(left=0.05,bottom=0.06,right=0.96,top=0.98,wspace=0.14,hspace=0.18) plt.show() if __name__ == '__main__': main()