def mk_tvis_fig( obsdat=_datfile ): import plotsetup plotsetup.halfpaperfig( figsize=[5,5] ) ax1 = pl.subplot( 111 ) # dat1 = 'snIa_F140W_12min_tvis.dat' # plot_tvis_contours( dat=dat1, obsdat=obsdat, points=points, ls='dashdot' ) dat1 = 'snIa_F140W_20min_tvis.dat' plot_tvis_contours( dat=dat1, obsdat=obsdat, points=True, ls='solid' ) # dat1 = 'snII_F110W_20min_tvis.dat' # plot_tvis_contours( dat=dat1, obsdat=obsdat, points=True, ls='dashed' ) # dat1 = 'snIa_F140W_30min_tvis.dat' # plot_tvis_contours( dat=dat1, obsdat=obsdat, points=False, ls='solid' ) # plot_tvis_contours( dat=dat3, obsdat=obsdat, expand=expand, points=points, ls='dashed' ) ax1.text( 0.05, 0.95, 'Type Ia\n Visibility\n Windows\n for 20 min \n F140W snaps', transform=ax1.transAxes, ha='left', va='top', fontsize='large' ) #ax1.text( 1.85,22.4,r'130 days', rotation=75, color='darkred', backgroundcolor='w', ha='center', fontsize=12 ) ax1.text( 2.9,25.,'t$_{vis}$=100 days', va='bottom', ha='right', rotation=0, color='darkred', fontsize=12 ) ax1.text( 3.1,25.,'50', va='bottom', ha='center', rotation=0, color='darkcyan', fontsize=12 ) ax1.text( 3.32,25.,'10', va='bottom', ha='center', rotation=0, color='darkorchid', fontsize=12 ) # ax1.text( 2.97,22.4,'40', ha='center', rotation=85, color='darkblue', backgroundcolor='w',fontsize=12 ) # # ax2 = pl.subplot( 122 ) # # plot_tvis_contours( dat=dat2, obsdat=obsdat, expand=expand, points=points, ls='solid' ) # plot_tvis_contours( dat=dat2, obsdat=obsdat, points=points, ls='solid' ) # # ax2.text( 0.05, 0.95, 'Type II', transform=ax2.transAxes, ha='left', va='top', fontsize='large' ) # ax2.text( 0.05, 0.95, 'Type II\n Visibility\n Windows\n for %02i min \n F110W snaps'%etime, transform=ax2.transAxes, ha='left', va='top', fontsize='large' ) # ax2.text( 1.72,22.4,'130 days', rotation=74, color='darkred', backgroundcolor='w', ha='center', fontsize=12 ) # ax2.text( 1.87,22.4,'100', ha='center', rotation=72, color='darkorange', backgroundcolor='w',fontsize=12 ) # ax2.text( 2.25,22.4,'70', ha='center', rotation=74, color='darkcyan', backgroundcolor='w',fontsize=12 ) # ax2.text( 2.75,22.4,'40', ha='center', rotation=76, color='darkblue', backgroundcolor='w',fontsize=12 ) # ax2.text( 3.1, 22.4,'10', ha='center', rotation=78, color='darkorchid', backgroundcolor='w',fontsize=12 ) # # ax2.yaxis.set_ticks_position('right') # ax2.yaxis.set_ticks_position('both') # ax2.yaxis.set_label_position('right') # ax2.set_ylabel( 'Magnification, $\mu$', labelpad=20, rotation=-90 ) fig = pl.gcf() fig.subplots_adjust( left=0.12,bottom=0.13, right=0.92, top=0.9, wspace=0.05 ) pl.draw()
import array import math from astropy.cosmology import FlatLambdaCDM import matplotlib import wmom import string from numpy.polynomial import polynomial as P from scipy.interpolate import interp1d from scipy.optimize import curve_fit import matplotlib import plotsetup import matplotlib.ticker as ticker from scipy.stats import pearsonr from matplotlib import gridspec import linef plotsetup.halfpaperfig() def func(x, a, b): return a * x + b def grabfitres(file1, variable, num): g = open(file1, 'r') co = 0 coall = 0 for line in g: if variable in line: x = string.split(line) if ((('g10.fitres' in file1) | ('g12.fitres' in file1)) and (variable == 'beta0')):