#81 make t1 data real and catch more errors;
This commit is contained in:
parent
775b5e7e8a
commit
4268bdc5ae
@ -133,7 +133,7 @@ class FCReader:
|
|||||||
no_bevo = True
|
no_bevo = True
|
||||||
break
|
break
|
||||||
|
|
||||||
if str(k.parent) != 'ACC_ABS_FID_sig (group)':
|
if str(k.parent) != 'ABS_ACC_FID_sig (group)':
|
||||||
continue
|
continue
|
||||||
|
|
||||||
tevo = k.parameter['tevo']
|
tevo = k.parameter['tevo']
|
||||||
@ -144,14 +144,14 @@ class FCReader:
|
|||||||
if bevo not in _temp:
|
if bevo not in _temp:
|
||||||
_temp[bevo] = []
|
_temp[bevo] = []
|
||||||
|
|
||||||
_temp[bevo].append((tevo, *[pp[1] for pp in pts]))
|
_temp[bevo].append((tevo, *[np.real(pp[1]) for pp in pts]))
|
||||||
|
|
||||||
if no_bevo:
|
if no_bevo:
|
||||||
break
|
break
|
||||||
|
|
||||||
if no_bevo:
|
if no_bevo:
|
||||||
# hopefully only for old scripts
|
# hopefully only for old scripts
|
||||||
sig = reader.get_selected('/data/B=*/ACC_ABS_FID*', dtype='signal')
|
sig = reader.get_selected('/data/B=*/ABS_ACC_FID*', dtype='signal')
|
||||||
_temp = {}
|
_temp = {}
|
||||||
for s in sig:
|
for s in sig:
|
||||||
pts = s.points([region])
|
pts = s.points([region])
|
||||||
@ -159,7 +159,7 @@ class FCReader:
|
|||||||
if b not in _temp:
|
if b not in _temp:
|
||||||
_temp[b] = []
|
_temp[b] = []
|
||||||
|
|
||||||
_temp[b].append([s.value, *[pp[1] for pp in pts]])
|
_temp[b].append([s.value, *[np.real(pp[1]) for pp in pts]])
|
||||||
|
|
||||||
for b, m in sorted(_temp.items()):
|
for b, m in sorted(_temp.items()):
|
||||||
m = np.array(m)
|
m = np.array(m)
|
||||||
@ -192,15 +192,16 @@ class FCReader:
|
|||||||
freqs = []
|
freqs = []
|
||||||
|
|
||||||
for k, v in sorted(self.data[temperature].items()):
|
for k, v in sorted(self.data[temperature].items()):
|
||||||
freqs.append(k)
|
|
||||||
|
|
||||||
# fit
|
# fit
|
||||||
p0 = [v.y[0], v.y[-1]-v.y[0], v.x[int(0.5*len(v.x) - 0.5)], 1]
|
p0 = [v.y[0], v.y[-1]-v.y[0], v.x[int(0.5*len(v.x) - 0.5)], 1]
|
||||||
try:
|
try:
|
||||||
p0, pcov = curve_fit(FCReader.kww, v.x, v.y, p0=p0, bounds=bounds, max_nfev=500*len(v))
|
p0, pcov = curve_fit(FCReader.kww, v.x, v.y, p0=p0, bounds=bounds, max_nfev=500*len(v))
|
||||||
except RuntimeError:
|
except Exception as e:
|
||||||
|
logger.error(f'Fit of field {k} failed with exception', exc_info=e)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
freqs.append(k)
|
||||||
|
|
||||||
perr = np.sqrt(np.diag(pcov))
|
perr = np.sqrt(np.diag(pcov))
|
||||||
params.append(p0)
|
params.append(p0)
|
||||||
errors.append(perr)
|
errors.append(perr)
|
||||||
|
Loading…
Reference in New Issue
Block a user