Exemplo n.º 1
0
def param_table(e=None, query_str=QSTR, debug=False, rho_limits=None,
                use_cache=True):
    cached_table = files['params_cache']
    if path.isfile(cached_table) and use_cache:
        return pd.read_msgpack(cached_table)
    if e is None:
        if debug:
            e = test_events()
        else:
            e = pip2015events()
    if rho_limits is None:
        rho_limits = rholimits
    data = e.summary(col='paper', split_date=pd.datetime(2014,7,1))
    del(e)
    gc.collect()
    data = sf.apply_rho_intervals(data, rho_limits)
    if len(query_str)<1:
        return data
    return data.query(query_str)
Exemplo n.º 2
0
                                  rhomax * read.RHO_SCALE)
        ax = axarr[i]
        datarho = data[data.rhomin == rhomin]  #.loc['second']
        datarho.plot.scatter(x=d0_col, y='log_nw', c='', ax=axarr[i])
        lfit = fit.LinFit(x=datarho[d0_col], y=datarho.log_nw, xname='D_0')
        lfit.find_fit()
        lfit.plot(source_style=None, ax=ax)
        #efit = fit.ExponentialFit(x=datarho.D_0, y=datarho.N_w)
        #efit.find_fit()
        #efit.plot(source_style='raw', ax=ax)
        ax.legend()
        ax.set_title(limitstr)
        ax.set_xlabel('')
    axarr[0].set_ylabel('$log(N_w)$')
    axarr[1].set_xlabel('$D_0$, mm')
    axarr[-1].set_title('$\\rho > %s$' % (rhomin * read.RHO_SCALE))
    plt.axis([0, 5, 1, 6])
    #remove_subplot_gaps(fig, axis='row')
    return fig, axarr


data = param_table(debug=debug)
data['log_nw'] = np.log10(data['N_w'])
data = sf.apply_rho_intervals(data, limits=rholims)
fig, axarr = d0_nw_paper(data, rholimits=rholims)
if debug:
    savepath += '/test'
read.ensure_dir(savepath)
fig.savefig(path.join(savepath, 'nw_d0_rhoranges.eps'))
#fig.savefig(path.join(paperpath, 'nw_d0_rhoranges.eps'))
Exemplo n.º 3
0
        limitstr = rhorangestr % (rhomin*read.RHO_SCALE, rhomax*read.RHO_SCALE)
        ax = axarr[i]
        datarho = data[data.rhomin==rhomin]#.loc['second']
        datarho.plot.scatter(x=d0_col, y='log_nw', c='', ax=axarr[i])
        lfit = fit.LinFit(x=datarho[d0_col], y=datarho.log_nw, xname='D_0')
        lfit.find_fit()
        lfit.plot(source_style=None, ax=ax)
        #efit = fit.ExponentialFit(x=datarho.D_0, y=datarho.N_w)
        #efit.find_fit()
        #efit.plot(source_style='raw', ax=ax)
        ax.legend()
        ax.set_title(limitstr)
        ax.set_xlabel('')
    axarr[0].set_ylabel('$log(N_w)$')
    axarr[1].set_xlabel('$D_0$, mm')
    axarr[-1].set_title('$\\rho > %s$' % (rhomin*read.RHO_SCALE))
    plt.axis([0, 5, 1, 6])
    #remove_subplot_gaps(fig, axis='row')
    return fig, axarr


data = param_table(debug=debug)
data['log_nw'] = np.log10(data['N_w'])
data = sf.apply_rho_intervals(data, limits=rholims)
fig, axarr = d0_nw_paper(data, rholimits=rholims)
if debug:
    savepath += '/test'
read.ensure_dir(savepath)
fig.savefig(path.join(savepath, 'nw_d0_rhoranges.eps'))
#fig.savefig(path.join(paperpath, 'nw_d0_rhoranges.eps'))