Skip to content

Use asymmetric x-axis uncertainties in spectra tools #115

Description

@jgieseler

At the moment the x-axis uncertainties in the spectra tool are defined symmetrically as half the energy channel width, centered around the mean energy. The latter usually is the geometric mean, which makes the uncertainty definition not totally correct. The lower and higher (upper) boundaries of the energy channels are already available, and the x-axis uncertainties should consequently be calculated as already defined (commented) in jgieseler@b52b4d5:

self.E_unc = np.array([self.spec_E - self.low_E,   # left bar magnitude    
                       self.high_E - self.spec_E,  # right bar magnitude
                       ])

But in the following

self.spec_df = pd.DataFrame(dict(Energy=self.spec_E, Intensity=self.final_spec, E_err=self.E_unc, I_err=self.I_unc), index=range(len(self.spec_E)))

needs to be handled differently, so that the data can be saved as as csv file (E_err in the DataFrame needs to be somethting like E_err_plus and E_err_minus).

Finally (and most importantly), the Fit-Spectra tool needs to be updated. It uses the data provided as csv files by the Spectra tool as input, and so far it only works with symmetric uncertainties!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions