cena_f2c_integral
ΒΆ
F2C in integral way.
''' F2C in integral way.
'''
import os
import sys
import logging
logging.basicConfig()
import datetime
import math
import matplotlib.pyplot as plt
import numpy as np
import scipy as sp
from scipy.integrate import quad
import irfpy.cena.cena_flux
import irfpy.cena.energy
def main():
f2c = irfpy.cena.cena_flux.Flux2Count_Integral('simple_triangle')
ie = 8
ic = 3
f2c.calculate_diff_gf(ie, ic)
estep = np.logspace(0, 4)
gfact = f2c.diff_gf[ie][ic].differential_gfactor(estep)
plt.plot(estep, gfact)
print(quad(f2c.diff_gf[ie][ic].differential_gfactor, 0, 10000))
energy_in_ev = irfpy.cena.energy.getEnergyE16()
gfactors = f2c.diff_gf[ie][ic].differential_gfactor(energy_in_ev)
print(gfactors / gfactors.max())
if __name__ == '__main__':
main()