Exemplo n.º 1
0
    )  #set a fitable chi (Martin used this method with value and fitted factor, because he didn't have the oportunity to fit complex values, I just reproduce)
    #cap_chi=pp.newParameter("cap_chi_factor")                                                                         #variant with a complex fit parameter (to realy use a complex parameter, set complex start value and limits in the parameter file)
    cap = SampleRepresentation.LayerObject(
        chitensor=[cap_chi], d=cap_thickness,
        sigma=cap_roughness)  #create the layer object
    hs.setLayer(2, cap)  #add layer to Heterostructure

    #####################################################################################
    ####  set up the EXPERIMENT and how the data files are interpreted

    # create therefore the ReflDatSimulator object
    # set the mode to "cLx" with a xfactor given by contribution_of_xmcd_to_fit (meaning that the logarithm of circular polarized reflection
    # and xmcd are simultaniously handeled by the object and the xmcd is multiplied by the xfactor contribution_of_xmcd_to_fit, to make it more important for the fit)
    # length_scale=1e-9 means every length (thickness, wavelength, rouughness, ...) is measured in nm (this is also the default), for Angstroem you should enter length_scale=1e-10
    simu = Experiment.ReflDataSimulator(mode="cLx" +
                                        str(contribution_of_xmcd_to_fit),
                                        length_scale=1e-10)

    #define the function namereader which delivers the energy belonging to a certain data file from its name as tupel (energy, angle) where angle is set to None because there are different angles in every data file
    namereader = lambda string: (float(string[4:9]), None)

    #create a function "linereader" which delivers angle,reflectivities and xmcd signal from one line of the data files
    #use for this the "ReflDataSimulator.createLinereader" method
    #you can also define a function by yourself. It has to take a string and give a tupel/list [energy,angle,rsigma,rpi,rleft,rright,xmcd]. Unused entries set to "None".
    linereader = simu.createLinereader(angle_column=0,
                                       rleft_column=1,
                                       rright_column=2,
                                       xmcd_column=3)

    #read the experimental data from all files located in the folder "little_fit_program_reloaded_data" (instead you could also specify a list of filenames)
    #energies, anlges, reflectivities and xmcd signals are obtained from filename and the lines of the textfiles using namereader and linereader
Exemplo n.º 2
0
    d=pp.newParameter("contamination_thickness"),
    sigma=pp.newParameter("contamination_roughness"))

###plug layers into heterostructure
print("... plug layers into heterostructure")
hs.setLayer(0, substrate_layer)
hs.setLayer(1, layer_SrRuO3)
hs.setLayer(2, layer_LSMO)
#hs.setLayer(3,layer_MnO2)
hs.setLayer(3, cap_layer)
hs.setLayer(4, carbon_contamination)

#### set up experiment ###########################################################################

# instantiate experiment for linear polarization ("l") and set length scale to Angstroem
simu = Experiment.ReflDataSimulator("lL", length_scale=1e-10)

namereader = lambda string: (float(string[:-4].split("_")[
    -2]), None)  #liefert energy aus den Dateinamen der verwendeten dateien


def pointmodifier(
    point
):  #berechnet winkel aus qz und energy und ersetzt qz dadurch. Alle anderen Werte des Datenpunktes bleiben unveraendert
    point[1] = 180.0 / (numpy.pi) * numpy.arcsin(point[1] * simu.hcfactor /
                                                 (2 * numpy.pi) /
                                                 (2 * point[0]))
    return point


print("... read experimental data")
Exemplo n.º 3
0
            "Al.F",
            SampleRepresentation.FFfromFile.createLinereader(
                complex_numbers=False)))

    al1 = SampleRepresentation.AtomLayerObject(
        {
            "Sr": pp.newParameter("al1_density_Sr"),
            "Al": pp.newParameter("al1_density_Al"),
            "Co": pp.newParameter("al1_density_Co")
        }, pp.newParameter("al1_d"))

    hs.setLayer(8, al1)

    #set up experiment

    simu = Experiment.ReflDataSimulator("l")

    namereader = lambda string: (
        float(string[-9:-4]), None
    )  #liefert energy aus den Dateinamen der verwendeten dateien

    def pointmodifier(
        point
    ):  #berechnet winkel aus qz und energy und ersetzt qz dadurch. Alle anderen Werte des Datenpunktes bleiben unveraendert
        point[1] = 360.0 / (2 * numpy.pi) * numpy.arcsin(
            point[1] * simu.hcfactor / (2 * point[0]))
        return point

    simu.ReadData("data",
                  simu.createLinereader(energy_column=1,
                                        angle_column=0,