From 4fe43e59f33dad26bf7c67a2a17fcfce57c7d9f7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gr=C3=B6ne=2C=20Tjark=20Leon=20Raphael?=
 <tjark.leon.raphael.groene@uni-hamburg.de>
Date: Wed, 2 Apr 2025 09:42:03 +0000
Subject: [PATCH] Update 3 files

- /pure code not instalable as environment/backbone/PDF_generation_class.py
- /pure code not instalable as environment/backbone/functions/export.py
- /pure code not instalable as environment/PDF_generator.py
---
 .../PDF_generator.py                          | 22 +++++++------------
 .../backbone/PDF_generation_class.py          |  2 +-
 .../backbone/functions/export.py              |  6 +++++
 3 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/pure code not instalable as environment/PDF_generator.py b/pure code not instalable as environment/PDF_generator.py
index 55b56c9..d3c387f 100644
--- a/pure code not instalable as environment/PDF_generator.py	
+++ b/pure code not instalable as environment/PDF_generator.py	
@@ -36,7 +36,7 @@ bg_Reload = None #rootdir + '/processed/' + meas_sampleName + '/Reload_files/bg_
 meas_Reload = None #rootdir + '/processed/' + meas_sampleName + '/Reload_files/meas_Reload/' + meas_sampleName + '.mat'
 
 # Correction factors to subtract as well empty glas to counter deviations in cell manufacturing
-empty_glas_int =0 # -0.0009683967395722652#-0.01#*(1/120) #0.01 # 0.014 #0.0210336
+empty_glas_int = 0 # -0.0009683967395722652#-0.01#*(1/120) #0.01 # 0.014 #0.0210336
 empty_glas = None #'C:/Users/admin/Nextcloud/Beamtimes/bt_0423/XRD_detailed/empty_ac_cell_inlet_180_10_Av120.chi'
 
 scatter_supression = 0.0001 # Small correction to dampen deviations from the BG subtraction calculated factor. 
@@ -87,16 +87,18 @@ Rmin = 0.5
 Rmax = 30 #maximal R to process the PDF to
 Rpoly = 1.7 #polynomal degree which affects getPDFx bg subtraction
 
+
+# You can crop the data if nescissary, anyhow the BG-subtration discards pre ramp
+# and cooldown data if not changed in the options
+startScan = 0
+endScan = 1e10 # Default setting for normal temperature ramps
+
 #----------------------------------------------------------------------------------------#
 #                                                                                        #
 #                                    Process data set                                    #
 #                                                                                        #
 #----------------------------------------------------------------------------------------#
 
-# You can crop the data if nescissary, anyhow the BG-subtration discards pre ramp
-# and cooldown data if not changed in the options
-startScan = 0
-endScan = 1e10 # Default setting for normal temperature ramps
 
 #Loading the background data
 bg = PDF_generation_class(path=bg_path, tempPath=bg_tempPath, sampleName=bg_sampleName, startScan=startScan, endScan=endScan, ends_with=ends_with, reload=bg_Reload, average=average, counter_PDF=counter_PDF)
@@ -132,10 +134,7 @@ bg.PrintLogFile(rootdir + '/processed/' + meas_sampleName + '/Log_files/bg_Log/'
 # Finish for the BG part: Now to the real sample
 #-----------------------------------------------------------------------------------------#
 
-#Loading the measurment data same as the BG
-startScan = 0
-endScan = 1e10 
-meas = PDF_generation_class(path=meas_path, tempPath=meas_tempPath, sampleName=meas_sampleName, startScan=startScan, endScan=1e10, ends_with=ends_with, reload=meas_Reload, without_dark=False, average=average,
+meas = PDF_generation_class(path=meas_path, tempPath=meas_tempPath, sampleName=meas_sampleName, startScan=startScan, endScan=endScan, ends_with=ends_with, reload=meas_Reload, without_dark=False, average=average,
                             Composition=Composition,Qmax=Qmax,Qmaxinst=Qmaxinst, Qmin=Qmin, Rmax=Rmax, Rmin=Rmin, Rpoly=Rpoly, Rstep=0.01, counter_PDF=counter_PDF)
 
 # Similar aproches to get the temperature points
@@ -151,11 +150,6 @@ endScan = meas.platoend_index
 # And saving to a .mat
 # meas.saveReload(rootdir + '/processed/' + meas_sampleName + '/Reload_files/meas_Reload/')
 
-# Getting feedback: Not solved nicely I kwon, but it works 
-print('\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~')
-print('           Reload files created, fast loading possible')
-print(' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n')
-
 # Also here we process and save to .dat
 meas.outputDatFile(rootdir + '/processed/' + meas_sampleName + '/Dat_files/meas_type1_uncorrected_Dat/')
 original = meas.I
diff --git a/pure code not instalable as environment/backbone/PDF_generation_class.py b/pure code not instalable as environment/backbone/PDF_generation_class.py
index 1b5ac0c..9488c3d 100644
--- a/pure code not instalable as environment/backbone/PDF_generation_class.py	
+++ b/pure code not instalable as environment/backbone/PDF_generation_class.py	
@@ -31,7 +31,7 @@ class PDF_generation_class(Plotting_XRD,Processing_Data,Export_PDF_Gen,Import_PD
     """
     
     # The init function declairs all to be set varibles for the class.
-    def __init__(self, path: str,tempPath: str,sampleName: str,startScan: int,endScan: int, timeOfset=0, ends_with = '.chi', without_dark=True, 
+    def __init__(self, path: str,tempPath: str,sampleName: str,startScan: int=0,endScan: int=1e10, timeOfset=0, ends_with = '.chi', without_dark=True, 
                 figratio1D=[16,9], figratio2D=[7, 4], reload: str = None, number_of_steps: int=1, skiprows_of_files: int = 23, average: int=1, counter_PDF: dict=None,
                 Composition: str="ZnS", Qmaxinst: float=30, Qmin: float=0.1, Qmax: float=30, Rpoly: float=0.9, Rstep: float=0.01, Rmin: float=0.5, Rmax: float=30):
         """ Class type object to automate the generation the PDF (.gr) from TS scans using PDFgetX3 within python.
diff --git a/pure code not instalable as environment/backbone/functions/export.py b/pure code not instalable as environment/backbone/functions/export.py
index d6a0019..d1c3a65 100644
--- a/pure code not instalable as environment/backbone/functions/export.py	
+++ b/pure code not instalable as environment/backbone/functions/export.py	
@@ -27,6 +27,12 @@ class Export_PDF_Plot:
         # Save the data
         sp_io.savemat(outputPath + "/" + self.sampleName +'.mat', {'G_of_r': self.G, 'r': self.r,'time': self.time_array ,'time_averaged': self.time_averaged_array,'temp': self.temp_array, 'temp_averaged':self.temp_averaged_array})
 
+
+        # Getting feedback: Not solved nicely I kwon, but it works 
+        print('\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~')
+        print(f'           Reload files created for {self.sampleName}, fast loading possible')
+        print(' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n')
+
     #----------------------------------------------------------------------------------------#
     #                                  export temp as xy                                     #
     #----------------------------------------------------------------------------------------#
-- 
GitLab