Пример #1
0
def get_simulation(scan_size=500):
    """
    Returns a specular simulation with beam and detector defined.
    """

    alpha_distr = ba.RangedDistributionGaussian(n_points, n_sig)
    wavelength_distr = ba.RangedDistributionGaussian(n_points, n_sig)

    scan = ba.AngularSpecScan(wavelength, scan_size, alpha_i_min, alpha_i_max)
    scan.setAbsoluteAngularResolution(alpha_distr, d_ang)
    scan.setAbsoluteWavelengthResolution(wavelength_distr, d_wl)

    simulation = ba.SpecularSimulation()
    simulation.setScan(scan)

    return simulation
Пример #2
0
def get_simulation(scan_size=500):
    """
    Returns a specular simulation with beam and detector defined.
    """
    footprint = ba.FootprintSquare(beam_sample_ratio)
    alpha_distr = ba.RangedDistributionGaussian(n_points, n_sig)

    scan = ba.AngularSpecScan(wavelength, scan_size, alpha_i_min, alpha_i_max)
    scan.setFootprintFactor(footprint)
    scan.setAbsoluteAngularResolution(alpha_distr, d_ang)

    simulation = ba.SpecularSimulation()
    simulation.setScan(scan)

    return simulation
def get_simulation( scan_size=1500 ):
    """
    Defines and returns a specular simulation.
    """
    simulation = ba.SpecularSimulation()
    qzs = numpy.linspace(0.1, 1.5, scan_size)
    
    n_sig = 4.0
    n_samples = 25
    distr = ba.RangedDistributionGaussian(n_samples, n_sig)

    scan = ba.QSpecScan(qzs)
    scan.setAbsoluteQResolution(distr, 0.008)
    
    simulation.setScan(scan)
    return simulation
Пример #4
0
def get_simulation_smeared(qzs, dqzs):
    """
    Defines and returns specular simulation
    with a qz-defined beam
    """
    # 3.5 sigma to sync with refnx
    n_sig = 3.5
    n_samples = 21
    distr = ba.RangedDistributionGaussian(n_samples, n_sig)

    scan = ba.QSpecScan(qzs * 10.0)
    scan.setAbsoluteQResolution(distr, dqzs * 10.0)

    simulation = ba.SpecularSimulation()
    simulation.setScan(scan)

    return simulation
def create_simulation(arg_dict, bin_start, bin_end):
    """
    Creates and returns specular simulation
    """
    wavelength = 1.54 * ba.angstrom
    alpha_distr = ba.RangedDistributionGaussian(30, 3)
    footprint = ba.FootprintFactorGaussian(arg_dict["footprint_factor"])

    scan = ba.AngularSpecScan(wavelength,
                              get_real_data_axis(bin_start, bin_end))
    scan.setAbsoluteAngularResolution(alpha_distr, arg_dict["divergence"])
    scan.setFootprintFactor(footprint)

    simulation = ba.SpecularSimulation()
    simulation.setScan(scan)
    simulation.setBeamIntensity(arg_dict["intensity"])
    return simulation
Пример #6
0
def get_simulation(scan_size=500):
    """
    Defines and returns specular simulation
    with a qz-defined beam
    """
    qzs = np.linspace(0.01, 1.0, scan_size)  # qz-values
    dq = 0.03 * qzs
    n_sig = 2.0
    n_samples = 25

    distr = ba.RangedDistributionGaussian(n_samples, n_sig)

    scan = ba.QSpecScan(qzs)
    scan.setAbsoluteQResolution(distr, dq)

    simulation = ba.SpecularSimulation()
    simulation.setScan(scan)

    return simulation
Пример #7
0
def get_simulation(q_axis, parameters, polarization, analyzer):
    """
    Returns a simulation object.
    Polarization, analyzer and resolution are set
    from given parameters
    """
    simulation = ba.SpecularSimulation()
    q_axis = q_axis + parameters["q_offset"]
    scan = ba.QSpecScan(q_axis)

    dq = parameters["q_res"] * q_axis
    n_sig = 4.0
    n_samples = 25

    distr = ba.RangedDistributionGaussian(n_samples, n_sig)
    scan.setAbsoluteQResolution(distr, parameters["q_res"])

    simulation.setBeamPolarization(polarization)
    simulation.setAnalyzerProperties(analyzer, 1.0, 0.5)

    simulation.setScan(scan)
    return simulation