Spaces:
Sleeping
Sleeping
Update app/api_utils.py
Browse files- app/api_utils.py +5 -4
app/api_utils.py
CHANGED
|
@@ -35,7 +35,7 @@ def comp_iv_curve(filename):
|
|
| 35 |
X_scaled, I_list, V_list = processor.preprocess_input([filename], path_data)
|
| 36 |
params, I_model = visualizer.plot_comparaison_courbes(processor, model, X_scaled, I_list, V_list, Plot = False)
|
| 37 |
|
| 38 |
-
param_fit, I_after_fit = fit_after_model(I_list, V_list, params)
|
| 39 |
|
| 40 |
return param_fit, I_after_fit
|
| 41 |
|
|
@@ -59,7 +59,7 @@ def comp_iv_curve_cnn1d(filename):
|
|
| 59 |
|
| 60 |
params, I_model = visualizer.plot_comparaison_courbes(processor, model, X_scaled, I_list, V_list, Plot=False)
|
| 61 |
|
| 62 |
-
param_fit, I_after_fit = fit_after_model(I_list, V_list, params)
|
| 63 |
|
| 64 |
return param_fit, I_after_fit
|
| 65 |
|
|
@@ -108,8 +108,9 @@ def fit_after_model(I_list, V_list, params):
|
|
| 108 |
"Jph":popt[4]}
|
| 109 |
param_fit["n"] = param_fit["nVth"] / Vth
|
| 110 |
I_after_fit = -iv_curve(V_list[0], param_fit['Rsh'], param_fit['Rs'], param_fit['n']*Vth, param_fit['J0'], param_fit['Jph'])
|
| 111 |
-
|
| 112 |
-
|
|
|
|
| 113 |
def read_iv_csv(filepath):
|
| 114 |
points = []
|
| 115 |
with open(filepath, newline='') as csvfile:
|
|
|
|
| 35 |
X_scaled, I_list, V_list = processor.preprocess_input([filename], path_data)
|
| 36 |
params, I_model = visualizer.plot_comparaison_courbes(processor, model, X_scaled, I_list, V_list, Plot = False)
|
| 37 |
|
| 38 |
+
param_fit, I_after_fit, ssd = fit_after_model(I_list, V_list, params)
|
| 39 |
|
| 40 |
return param_fit, I_after_fit
|
| 41 |
|
|
|
|
| 59 |
|
| 60 |
params, I_model = visualizer.plot_comparaison_courbes(processor, model, X_scaled, I_list, V_list, Plot=False)
|
| 61 |
|
| 62 |
+
param_fit, I_after_fit, ssd = fit_after_model(I_list, V_list, params)
|
| 63 |
|
| 64 |
return param_fit, I_after_fit
|
| 65 |
|
|
|
|
| 108 |
"Jph":popt[4]}
|
| 109 |
param_fit["n"] = param_fit["nVth"] / Vth
|
| 110 |
I_after_fit = -iv_curve(V_list[0], param_fit['Rsh'], param_fit['Rs'], param_fit['n']*Vth, param_fit['J0'], param_fit['Jph'])
|
| 111 |
+
ssd = np.mean((I_list[0] - I_after_fit) ** 2)
|
| 112 |
+
return param_fit, I_after_fit, ssd
|
| 113 |
+
|
| 114 |
def read_iv_csv(filepath):
|
| 115 |
points = []
|
| 116 |
with open(filepath, newline='') as csvfile:
|