Changed formatting, some conflicts yet to be resolved
This commit is contained in:
parent
f887c94a70
commit
645d908000
5
Data.py
5
Data.py
@ -9,11 +9,9 @@ class Data:
|
||||
self.datasets = []
|
||||
|
||||
with h5py.File(self.filename, "r") as h5:
|
||||
|
||||
if 1:
|
||||
print(f"Atribuudid grupis '{group_key}'")
|
||||
grp = h5[group_key]
|
||||
|
||||
self.current = grp["current_raw"][()] / grp.attrs["c_mem"]
|
||||
self.current_t = grp["current_t"][()]
|
||||
self.ECal = grp.attrs["vrev"]
|
||||
@ -21,5 +19,6 @@ class Data:
|
||||
self.eid = group_key
|
||||
|
||||
def get_current_slice(self, times: np.ndarray):
|
||||
interpolator = interp1d(self.current_t, self.current, fill_value="extrapolate")
|
||||
interpolator = interp1d(self.current_t, self.current,
|
||||
fill_value="extrapolate")
|
||||
return interpolator(times)
|
||||
|
@ -65,7 +65,6 @@ class Fitter:
|
||||
err = np.mean(res**2) # mean squared error
|
||||
self.iteration += 1
|
||||
print(self.iteration, parameters.tolist(), "err", err)
|
||||
|
||||
# measured_fluo = self.data.fluo
|
||||
# fluo_interplolator = interp1d(self.time_domain, model.calculated_fluo)
|
||||
# calculated_fluo = fluo_interplolator(self.data.fluo_time)
|
||||
@ -122,7 +121,6 @@ class Fitter:
|
||||
'offset': offset,
|
||||
'mean_squared_error': err})
|
||||
|
||||
|
||||
model = self.model()
|
||||
|
||||
model.ECaL = ECal
|
||||
@ -177,6 +175,7 @@ class Fitter:
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
|
||||
filename = "ltcc_current.h5"
|
||||
eid = "0033635a51b096dc449eb9964e70443a67fc16b9587ae3ff6564eea1fa0e3437_2018.06.18 14:48:40"
|
||||
|
||||
@ -191,7 +190,6 @@ if __name__ == "__main__":
|
||||
res_filename = res_filename.replace(" ", "_").replace(":", "-")
|
||||
fit_hist.to_csv(res_filename, index=True)
|
||||
|
||||
|
||||
eid_cleaned = re.sub(r'[^\w.-]', '', eid) # Eemalda kõik eritähed ja jääb alles alphanumbrilised tähed, sidekriipsud ja punktid
|
||||
fig.savefig(f"plot_{eid_cleaned}.png")
|
||||
fig.savefig(f"plot_{eid_cleaned}.pdf")
|
||||
|
Loading…
Reference in New Issue
Block a user