How to use the pyxrf.core.map_processing.snip_method_numba function in pyxrf

To help you get started, we’ve selected a few pyxrf examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github NSLS-II / PyXRF / pyxrf / model / guessparam.py View on Github external
dict of array
    area_dict : dict
        dict of area for elements and other peaks
    """
    # Need to use deepcopy here to avoid unexpected change on parameter dict
    fitting_parameters = copy.deepcopy(param)

    total_list, matv, area_dict = construct_linear_model(x,
                                                         fitting_parameters,
                                                         elemental_lines,
                                                         default_area=default_area)

    temp_d = {k: v for (k, v) in zip(total_list, matv.transpose())}

    # add background
    bg = snip_method_numba(y,
                           fitting_parameters['e_offset']['value'],
                           fitting_parameters['e_linear']['value'],
                           fitting_parameters['e_quadratic']['value'],
                           width=fitting_parameters['non_fitting_values']['background_width'])
    temp_d['background'] = bg

    x_energy = (fitting_parameters['e_offset']['value']
                + fitting_parameters['e_linear']['value'] * x
                + fitting_parameters['e_quadratic']['value'] * x**2)

    return x_energy, temp_d, area_dict