Ejemplo n.º 1
0
###
###  Construct Coupled Distribution
###
interps = ["LinLinLog", "LogLogLog", "LinLinLin"]
methods = ["Simplified Union", "One D Union", "Two D Union"]

interps = ["LogLogLog", "LinLinLin"]
methods = ["Two D Union"]
for interp in interps:
    print "\n-----", interp, "-----"
    for method in methods:
        coupled_dist = Collision.createLinLinLogCorrelatedCoupledElasticDistribution(
            pb_data, method, 1e-15)
        if interp == "LogLogLog":
            coupled_dist = Collision.createLogLogLogCorrelatedCoupledElasticDistribution(
                pb_data, method, 1e-15)
        elif interp == "LinLinLin":
            coupled_dist = Collision.createLinLinLinCorrelatedCoupledElasticDistribution(
                pb_data, method, 1e-15)

        print "\n----- ", method, " -----\n"

        print "\t -- evaluateLegendreExpandedRutherford --\n"
        etas = [
            2.51317958942017e3, 2.68213671998009, 4.14887699806239e-14,
            2.51317958942017e3
        ]
        angles = [[0.999999], [1.0, 1.0, 1.0], [0.999999], [1.0]]
        energies = [[1.0e-5], [1.0e-4, 5.5e-4, 1.0e-3], [1.0e5], [1.0e-5]]
        for i in range(0, len(etas)):
            print "Eta = ", etas[i]
Ejemplo n.º 2
0
          pdfs = numpy.empty(shape=(len(schemes), length))
          cdfs = numpy.empty(shape=(len(schemes), length))
          samples = numpy.empty(shape=(len(schemes), length))

          labels = []

          for n in range(0, len(schemes)):
            if interpolation == "LogLogLog":
              labels.append(schemes[n] + " - log")
              if schemes[n] == "Unit-base":
                dist = Collision.createLogLogLogUnitBaseCoupledElasticDistribution(native_data, "One D Union", tol)
              if schemes[n] == "Unit-base Correlated":
                dist = Collision.createLogLogLogUnitBaseCorrelatedCoupledElasticDistribution(native_data, "Two D Union", tol)
              if schemes[n] == "Correlated":
                dist = Collision.createLogLogLogCorrelatedCoupledElasticDistribution(native_data, "Two D Union", tol)
            elif interpolation == "LinLinLin":
              labels.append(schemes[n] + " - lin")
              if schemes[n] == "Unit-base":
                dist = Collision.createLinLinLinUnitBaseCoupledElasticDistribution(native_data, "Two D Union", tol)
              if schemes[n] == "Unit-base Correlated":
                dist = Collision.createLinLinLinUnitBaseCorrelatedCoupledElasticDistribution(native_data, "Two D Union", tol)
              if schemes[n] == "Correlated":
                dist = Collision.createLinLinLinCorrelatedCoupledElasticDistribution(native_data, "Two D Union", tol)

            for i in range(0, length):
              pdfs[n, i] = dist.evaluatePDF(energy, angles[i])
              cdfs[n, i] = dist.evaluateCDF(energy, angles[i])

            if schemes[n] == "Unit-base":
              labels[n] = "Lower " + schemes[n] + " - log"