From 01a73c69084435885e78d5e0e9f6a5022fe84204 Mon Sep 17 00:00:00 2001
From: farid <farid.mohammadi@iws.uni-stuttgart.de>
Date: Sun, 20 Jun 2021 16:41:16 +0200
Subject: [PATCH] [PA-A] save post_plot only in pdf format.

---
 .../tests/PA-A/ffpm_validation_stokespnm.py     | 17 +++++++++--------
 BayesValidRox/tests/PA-A/post_plot.py           |  2 +-
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/BayesValidRox/tests/PA-A/ffpm_validation_stokespnm.py b/BayesValidRox/tests/PA-A/ffpm_validation_stokespnm.py
index c33684ce4..559da9846 100755
--- a/BayesValidRox/tests/PA-A/ffpm_validation_stokespnm.py
+++ b/BayesValidRox/tests/PA-A/ffpm_validation_stokespnm.py
@@ -156,8 +156,8 @@ def run(params, averaging=True,errorPerc=0.05, PCEEDMethod='normal'):
     # The degree with the lowest Leave-One-Out cross-validation (LOO)
     # error (or the highest score=1-LOO)estimator is chosen as the final
     # metamodel.
-    MetaModelOpts.MinPceDegree = 10 # default = 1 10
-    MetaModelOpts.MaxPceDegree = 10 #10
+    MetaModelOpts.MinPceDegree = 7 # default = 1 10
+    MetaModelOpts.MaxPceDegree = 7 #10
 
     # q-quasi-norm 0<q<1 (default=1)
     MetaModelOpts.q = 0.75 #np.linspace(0.3,0.6,3)
@@ -306,14 +306,15 @@ def run(params, averaging=True,errorPerc=0.05, PCEEDMethod='normal'):
 
     # Select the inference method
     BayesOptsCalib.SamplingMethod = 'MCMC'
-    # import emcee
-    # BayesOptsCalib.MCMCmoves = emcee.moves.StretchMove()
+    import emcee
+    BayesOptsCalib.MCMCmoves =[(emcee.moves.DEMove(), 0.8), 
+                           (emcee.moves.DESnookerMove(), 0.2),]
     BayesOptsCalib.MCMCnwalkers = 500 #300
     # BayesOptsCalib.MCMCnSteps = 1500 #5000
     # Maximum a Posteriori based on primary analysis
-    theta_MAP = np.array([1e-3,5.26480244078e-06,1.7642875191945115e-05,
-                          35237.668793254459160])
-    BayesOptsCalib.MCMCinitSamples = theta_MAP
+    # theta_MAP = np.array([1e-3,5.26480244078e-06,1.7642875191945115e-05,
+    #                       35237.668793254459160])
+    # BayesOptsCalib.MCMCinitSamples = theta_MAP
     
     BayesOptsCalib.MAP ='mean'
     BayesOptsCalib.PlotPostDist = True
@@ -366,7 +367,7 @@ def run(params, averaging=True,errorPerc=0.05, PCEEDMethod='normal'):
     #=====================================================
     # Plot posterior predictive
     postPredictiveplot(PCEModel.ModelObj.Name, errorPerc, averaging, case='Calib')
-
+    return BayesCalib
     #=====================================================
     #==================  VALIDATION  =====================
     #=====================================================
diff --git a/BayesValidRox/tests/PA-A/post_plot.py b/BayesValidRox/tests/PA-A/post_plot.py
index 8ecda790b..f49c1694a 100755
--- a/BayesValidRox/tests/PA-A/post_plot.py
+++ b/BayesValidRox/tests/PA-A/post_plot.py
@@ -138,7 +138,7 @@ def postPredictiveplot(modelName, errorPrec, averaging=True, case='Calib', bins=
             plt.title(title,fontdict=font)
             fig.subplots_adjust(top=0.95)
             plotname = OutputName if OutputName == 'p' else 'velocity'
-            fig.savefig('./'+OutputDir+'/PointID_'+str(idx+1)+'_'+plotname+'.svg', bbox_inches='tight')
+            # fig.savefig('./'+OutputDir+'/PointID_'+str(idx+1)+'_'+plotname+'.svg', bbox_inches='tight')
             fig.savefig('./'+OutputDir+'/PointID_'+str(idx+1)+'_'+plotname+'.pdf', bbox_inches='tight')
             plt.close()
 
-- 
GitLab