From ad7a8bcfd33c19a7a93d72e298af4d81d3f2be77 Mon Sep 17 00:00:00 2001
From: alexanderott <a.ott@student.uni-tuebingen.de>
Date: Sun, 10 Jan 2021 00:08:40 +0100
Subject: [PATCH] increase f_zero points weight

---
 fitting/ModelFit.py | 2 ++
 run_Fitter.py       | 8 ++++----
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/fitting/ModelFit.py b/fitting/ModelFit.py
index adb344d..64d58eb 100644
--- a/fitting/ModelFit.py
+++ b/fitting/ModelFit.py
@@ -235,6 +235,8 @@ class ModelFit:
         if save_path is None:
             plt.show()
         else:
+            if not os.path.exists(save_path):
+                os.makedirs(save_path)
             plt.savefig(save_path + cell.get_cell_name() + "_master_plot.pdf")
         plt.close()
 
diff --git a/run_Fitter.py b/run_Fitter.py
index dceabf1..b849357 100644
--- a/run_Fitter.py
+++ b/run_Fitter.py
@@ -14,13 +14,13 @@ from my_util.helperFunctions import plot_errors
 
 import multiprocessing as mp
 
-SAVE_DIRECTORY = "./results/final_sam/"
-SAVE_DIRECTORY_BEST = "./results/final_sam_best/"
+SAVE_DIRECTORY = "./results/final_sam2/"
+# SAVE_DIRECTORY_BEST = "./results/final_sam2_best/"
 
 # SAVE_DIRECTORY = "./results/ref_and_tau/no_dend_tau/"
 # SAVE_DIRECTORY_BEST = "./results/ref_and_tau/ndt_best/"
 # [vs, sc, cv, isi_hist, bursty, f_inf, f_inf_slope, f_zero, f_zero_slope, f0_curve]
-ERROR_WEIGHTS = (1, 1, 1, 1, 1, 1, 1, 1, 0, 1)
+ERROR_WEIGHTS = (1, 1, 1, 1, 1, 1, 1, 10, 0, 1)
 
 
 def main():
@@ -108,7 +108,7 @@ def fit_cell_parallel(cell_data, start_parameters):
     del cell_data
 
     best_fit = get_best_fit(save_path_cell)
-    best_fit.generate_master_plot(SAVE_DIRECTORY_BEST)
+    # best_fit.generate_master_plot(SAVE_DIRECTORY_BEST)
     best_fit.generate_master_plot(SAVE_DIRECTORY)