Пример #1
0
def test_standard_plots(xsec_file, outdir='./'):
    from pisa.utils.plotter import Plotter
    xsec = genie.get_combined_xsec(xsec_file)

    e_bins = MultiDimBinning(
        [OneDimBinning(name='true_energy', tex=r'E_\nu', num_bins=150,
                       domain=(1E-1, 1E3)*ureg.GeV, is_log=True)]
    )
    xsec.compute_maps(e_bins)

    logging.info('Making plots for genie xsec_maps')
    plot_obj = Plotter(outdir=outdir, stamp='Cross-Section', fmt='png',
                       log=True, size=(12, 8),
                       label=r'Cross-Section ($m^{2}$)')
    maps = xsec.return_mapset()
    plot_obj.plot_xsec(maps, ylim=(1E-43, 1E-37))
Пример #2
0
def test_per_e_plot(xsec_file, outdir='./'):
    from pisa.utils.plotter import Plotter
    xsec = genie.get_combined_xsec(xsec_file)

    e_bins = MultiDimBinning(
        [OneDimBinning(name='true_energy', tex=r'E_\nu', num_bins=200,
                       domain=(1E-1, 1E3)*ureg.GeV, is_log=True)]
    )
    xsec.compute_maps(e_bins)
    xsec.scale_maps(1/e_bins.true_energy.bin_widths.magnitude)

    logging.info('Making plots for genie xsec_maps per energy')
    plot_obj = Plotter(outdir=outdir, stamp='Cross-Section / Energy',
                       fmt='png', log=False, size=(12, 8),
                       label=r'Cross-Section / Energy ($m^{2} GeV^{-1}$)')
    maps = xsec.return_mapset()
    plot_obj.plot_xsec(maps, ylim=(3.5E-41, 3E-40))