diff --git a/pure code not instalable as environment/workspaces/jupyter/PDF-batch_plot.ipynb b/pure code not instalable as environment/workspaces/jupyter/PDF-batch_plot.ipynb index 541e78e4d45db88b9e082c330d07e8e332c4de73..3e4be1734887e27af74ed1da12fd403a1a1067f0 100644 --- a/pure code not instalable as environment/workspaces/jupyter/PDF-batch_plot.ipynb +++ b/pure code not instalable as environment/workspaces/jupyter/PDF-batch_plot.ipynb @@ -4,12 +4,12 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "# Plot PDF of recorded in-situ runs in diffrent sytles\n", + "# Plot PDF of recorded in-situ runs in different styles\n", "\n", - "This code is used to load and plot pdf data\n", - "- There for exitu data we will load the class called exituPDF\n", + "This code is used to load and plot PDF data\n", + "- For exsitu data we will load the class called exituPDF\n", "- To display insitu data the insituPDF class is suitable\n", - "- Last there is the insituPDFfitted class you can use to display \n", + "- Lastly there is the insituPDFfitted class which you can use to display \n", " the different properties that the diffpy-cmi will print in the result files" ] }, @@ -83,13 +83,13 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 1, "metadata": {}, "outputs": [], "source": [ - "startScan = 1 #Define the first fscan to process for the plot\n", - "endScan = 10000 #Define the last fscan to process for the plot\n", - "step_width = 6 #To shortan the number of scans in a 1D plot step lenght can be increased\n", + "startScan = 1 #Define the first fscan to be processed for the plot\n", + "endScan = 10000 #Define the last fscan to processed for the plot\n", + "step_width = 6 #To decrease the number of scans in a 1D plot the step width can be increased\n", "\n", "\n", "figratio1D =[4,3] #Define the window size ratio for a 1D plot\n", @@ -105,14 +105,18 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 2, "metadata": {}, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "241.75182481751824\n" + "ename": "NameError", + "evalue": "name 'rootdir' is not defined", + "output_type": "error", + "traceback": [ + "\u001b[31m---------------------------------------------------------------------------\u001b[39m", + "\u001b[31mNameError\u001b[39m Traceback (most recent call last)", + "\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[2]\u001b[39m\u001b[32m, line 4\u001b[39m\n\u001b[32m 1\u001b[39m \u001b[38;5;66;03m# Here we call our data set, which we want to look at. --> Needs to undergo the PDF generation first ;)\u001b[39;00m\n\u001b[32m 2\u001b[39m sample_name = \u001b[33m'\u001b[39m\u001b[33mlk_zns_insitu_1_00001\u001b[39m\u001b[33m'\u001b[39m \u001b[38;5;66;03m#filename\u001b[39;00m\n\u001b[32m----> \u001b[39m\u001b[32m4\u001b[39m path_to_Temp = \u001b[43mrootdir\u001b[49m + \u001b[33m\"\u001b[39m\u001b[33m/processed/\u001b[39m\u001b[33m\"\u001b[39m + sample_name + \u001b[33m\"\u001b[39m\u001b[33m/Reload_files/meas_Reload/\u001b[39m\u001b[33m\"\u001b[39m + sample_name + \u001b[33m\"\u001b[39m\u001b[33m.mat\u001b[39m\u001b[33m\"\u001b[39m\n\u001b[32m 6\u001b[39m \u001b[38;5;66;03m# Here we can choose which type of PDF generation we want to look at. \u001b[39;00m\n\u001b[32m 7\u001b[39m path = rootdir + \u001b[33m\"\u001b[39m\u001b[33m/processed/\u001b[39m\u001b[33m\"\u001b[39m + sample_name + \u001b[33m\"\u001b[39m\u001b[33m/PDF_files/meas_PDF/\u001b[39m\u001b[33m\"\u001b[39m \n", + "\u001b[31mNameError\u001b[39m: name 'rootdir' is not defined" ] } ], @@ -125,8 +129,8 @@ "# Here we can choose which type of PDF generation we want to look at. \n", "path = rootdir + \"/processed/\" + sample_name + \"/PDF_files/meas_PDF/\" \n", "\n", - "# Here the everthing is transfered to the class used for plotting the PDF:\n", - "# One can flip (y = -y) certain scans by using -- , reverse_data=[1,7], reverse_style=\"list\") -- if nessicary\n", + "# Here all variables are transfered to the class used for plotting the PDF:\n", + "# One can flip (y = -y) certain scans by using -- , reverse_data=[1,7], reverse_style=\"list\") -- if necessary\n", "meas = InsituPDF(path=path, sampleName=sample_name, startScan=startScan, endScan=endScan,\n", " timeOfset=0, tempPath=path_to_Temp,\n", " figratio1D=figratio1D,figratio2D=figratio2D)" @@ -172,7 +176,7 @@ "metadata": {}, "source": [ "#### Save in .mat file if needed\n", - "You can also save the loaded .dat files in a .mat reload file for faster reloading (often I just reprocess)" + "You can also save the loaded .dat files in a .mat reload file for faster reloading (often I simply reprocess the data)" ] }, { @@ -252,10 +256,10 @@ ], "source": [ "# Waterfall like 1D plot (each scan is offset by the intercept value and color coded to the time scale)\n", - "meas.plot1dvsTimeProjectedOntop(offsetTime=0,savefig=\"svg\",outputPath=rootdir + \"/processed/\" + sample_name + \"//PDF_Plots/PDF_1D_projected_plot/\",step_width=step_width, minR=1.65, maxR=10, intercept=0.2) #plot in 1D, insitu=True will define color change and hides ledgend\n", + "meas.plot1dvsTimeProjectedOntop(offsetTime=0,savefig=\"svg\",outputPath=rootdir + \"/processed/\" + sample_name + \"//PDF_Plots/PDF_1D_projected_plot/\",step_width=step_width, minR=1.65, maxR=10, intercept=0.2) #plot in 1D, insitu=True will define color change and hide legend\n", "\n", - "# # 1D plot over time with temperature label (if many scans are take and the averaging is low^and you still want to use a small step width the labels can be removed)\n", - "meas.plot1dvsTime(offsetTime=0,savefig=\"svg\",outputPath=rootdir + \"/processed/\" + sample_name + \"/PDF_Plots/PDF_1D_plot/\",step_width=step_width, minR=1, maxR=15) #plot in 1D, insitu=True will define color change and hides ledgend\n", + "# # 1D plot over time with temperature label (if you use many scnas and the averaging is low and you still want to use a small step width the labels can be removed)\n", + "meas.plot1dvsTime(offsetTime=0,savefig=\"svg\",outputPath=rootdir + \"/processed/\" + sample_name + \"/PDF_Plots/PDF_1D_plot/\",step_width=step_width, minR=1, maxR=15) #plot in 1D, insitu=True will define color change and hide legend\n", "\n", "# 2D plot over time with temperature curve\n", "meas.plot2dTemp(vmin=-1.5,vmax=5,savefig=\"svg\",outputPath= rootdir + '/processed/' + sample_name + '/PDF_Plots/PDF_2D_plot/', maxR=15) #rect=rectangle)\n" @@ -264,7 +268,7 @@ ], "metadata": { "kernelspec": { - "display_name": "XDiff", + "display_name": "pdfgui", "language": "python", "name": "python3" }, @@ -278,7 +282,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.16" + "version": "3.13.2" } }, "nbformat": 4,