Export nan for area value/error in case of a bad fit
This commit is contained in:
@ -267,16 +267,18 @@ def export_1D(data, path, area_method=AREA_METHODS[0], lorentz=False, hkl_precis
|
|||||||
|
|
||||||
for name, param in scan["fit"].params.items():
|
for name, param in scan["fit"].params.items():
|
||||||
if "amplitude" in name:
|
if "amplitude" in name:
|
||||||
|
if param.stderr is None:
|
||||||
|
area_n = np.nan
|
||||||
|
area_s = np.nan
|
||||||
|
else:
|
||||||
area_n = param.value
|
area_n = param.value
|
||||||
area_s = param.stderr
|
area_s = param.stderr
|
||||||
|
# TODO: take into account multiple peaks
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
area_n = 0
|
# no peak functions in a fit model
|
||||||
area_s = 0
|
area_n = np.nan
|
||||||
|
area_s = np.nan
|
||||||
if area_n is None or area_s is None:
|
|
||||||
print(f"Couldn't export scan: {scan['idx']}")
|
|
||||||
continue
|
|
||||||
|
|
||||||
# apply lorentz correction to area
|
# apply lorentz correction to area
|
||||||
if lorentz:
|
if lorentz:
|
||||||
|
Reference in New Issue
Block a user