Skip to content

Commit c6ef955

Browse files
cleanups
1 parent 7384d1f commit c6ef955

12 files changed

Lines changed: 4 additions & 169 deletions

pica/keithley/delta_mode/Delta_RT_K6221_K2182_L350_Sensing_GUI.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,6 @@
33
Purpose: GUI module for Delta RT K6221 K2182 L350 Sensing GUI v5.
44
"""
55

6-
# -------------------------------------------------------------------------------
7-
# Name: Delta Lakeshore Passive Measurement GUI
8-
# Purpose: Perform a temperature-dependent Delta mode measurement with a
9-
# Keithley 6221/2182 while passively monitoring temperature
10-
# from a Lakeshore 350.
11-
#
12-
# Author: Prathamesh K. Deshmukh
13-
#
14-
# Created: 03/10/2025
15-
#
16-
# Version: 8.1 (JOSS Cleaned)
17-
# -------------------------------------------------------------------------------
18-
19-
# --- Packages for Front end ---
206
import tkinter as tk
217
from tkinter import ttk, Label, Entry, LabelFrame, messagebox, scrolledtext, Canvas, filedialog
228
import sys

pica/keithley/delta_mode/Delta_RT_K6221_K2182_L350_T_Control_GUI.py

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,6 @@
33
Purpose: GUI module for Delta RT K6221 K2182 L350 T Control GUI v5.
44
"""
55

6-
# -------------------------------------------------------------------------------
7-
# Name: Advanced Delta Mode R-T Measurement
8-
# Purpose: Perform a temperature-dependent Delta mode measurement with a
9-
# Keithley 6221/2182 and Lakeshore 350, using an advanced GUI
10-
# and temperature control logic.
11-
#
12-
# Author: Prathamesh K. Deshmukh
13-
# Created: 03/10/2025
14-
#
15-
# Version: 2.1 (JOSS Cleaned)
16-
# -------------------------------------------------------------------------------
17-
18-
# --- Packages ---
196
import tkinter as tk
207
from tkinter import ttk, Label, Entry, LabelFrame, messagebox, scrolledtext, Canvas, filedialog
218
import os
@@ -46,10 +33,7 @@
4633

4734

4835
def run_script_process(script_path):
49-
"""
50-
Wrapper function to execute a script using runpy in its own directory.
51-
This becomes the target for the new, isolated process.
52-
"""
36+
5337
try:
5438
os.chdir(os.path.dirname(script_path))
5539
runpy.run_path(script_path, run_name="__main__")
@@ -60,9 +44,7 @@ def run_script_process(script_path):
6044

6145

6246
def launch_plotter_utility():
63-
"""Finds and launches the plotter utility script in a new process."""
6447
try:
65-
# Assumes the plotter is in a standard location relative to this script
6648
script_dir = os.path.dirname(os.path.abspath(__file__))
6749
plotter_path = os.path.join(
6850
script_dir,
@@ -81,9 +63,7 @@ def launch_plotter_utility():
8163

8264

8365
def launch_gpib_scanner():
84-
"""Finds and launches the GPIB scanner utility in a new process."""
8566
try:
86-
# Assumes the scanner is in a standard location relative to this script
8767
script_dir = os.path.dirname(os.path.abspath(__file__))
8868
scanner_path = os.path.join(
8969
script_dir,
@@ -103,7 +83,6 @@ def launch_gpib_scanner():
10383

10484

10585
def resource_path(relative_path):
106-
""" Get absolute path to resource, works for dev and for PyInstaller """
10786
try:
10887
base_path = sys._MEIPASS
10988
except Exception:
@@ -116,7 +95,6 @@ def resource_path(relative_path):
11695
# -------------------------------------------------------------------------------
11796

11897
class Active_Delta_Backend:
119-
""" Manages both Keithley 6221 and Lakeshore 350 for active measurements. """
12098

12199
def __init__(self):
122100
self.keithley = None
@@ -195,7 +173,6 @@ def get_delta_measurement(self):
195173
return voltage
196174

197175
def close_instruments(self):
198-
""" CRITICAL: Turns off heater and closes all connections. """
199176
print("--- [Backend] Closing instrument connections. ---")
200177
try:
201178
if self.lakeshore:
@@ -226,7 +203,6 @@ class Advanced_Delta_GUI:
226203
PROGRAM_VERSION = "2.1"
227204
LOGO_SIZE = 110
228205
try:
229-
# Robust path finding for assets relative to the script's location
230206
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
231207
LOGO_FILE_PATH = os.path.join(
232208
SCRIPT_DIR,
@@ -878,7 +854,6 @@ def _start_hardware_ramp(self):
878854
self.start_time = time.time()
879855
self.root.after(1000, self._update_measurement_loop)
880856

881-
# --- Performance Improvement: Capture static background for blitting ---
882857
self.canvas.draw()
883858
self.plot_backgrounds = [
884859
self.canvas.copy_from_bbox(
@@ -911,7 +886,6 @@ def _update_measurement_loop(self):
911886
self.data_storage['voltage'].append(voltage)
912887
self.data_storage['resistance'].append(res)
913888

914-
# --- Performance Improvement: Use blitting for fast graph updates if background is captured ---
915889
if self.plot_backgrounds:
916890
# Restore the clean background
917891
self.canvas.restore_region(self.plot_backgrounds[0])
@@ -995,8 +969,7 @@ def _process_visa_queue(self):
995969
self.scan_button.config(state='normal')
996970

997971
except queue.Empty:
998-
# If the queue is empty, it means the worker is still running.
999-
# We schedule another check.
972+
1000973
self.root.after(100, self._process_visa_queue)
1001974

1002975
def _browse_file_location(self):

pica/keithley/delta_mode/Instrument_Control/Delta_K6221_K2182_L350_T_Sensing_Instrument_Control.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,6 @@
33
Purpose: GUI module for Delta K6221 K2182 L350 T Sensing Backend v1.
44
"""
55

6-
# -------------------------------------------------------------------------------
7-
# Name: Combined Delta and Lakeshore Measurement
8-
# Purpose: Perform a Delta mode measurement with a Keithley 6221 while
9-
# simultaneously monitoring temperature with a Lakeshore 350.
10-
# Author: Prathamesh K. Deshmukh
11-
# Created: 09/09/2025
12-
# Version: 1.0
13-
# -------------------------------------------------------------------------------
146
import pyvisa
157
import time
168

pica/keithley/delta_mode/Instrument_Control/Delta_K6221_K2182_Simple.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,7 @@
22
Backend module for Delta Mode measurements using Keithley 6221 and 2182.
33
Handles simplified communication protocols.
44
"""
5-
# -------------------------------------------------------------------------------
6-
# Name: Delta Mode Measurement (Improved)
7-
# Purpose: Perform a Delta mode measurement with robust error handling
8-
# and a guaranteed graceful shutdown.
9-
# Author: Prathamesh K. Deshmukh
10-
# Created: 01/09/2024
11-
# -------------------------------------------------------------------------------
5+
126
import pyvisa
137
import time
148

pica/keithley/k2400/IV_K2400_GUI.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,6 @@
33
Purpose: GUI module for IV K2400 GUI v5.
44
"""
55

6-
# -------------------------------------------------------------------------------
7-
# Name: Keithley 2400 I-V Measurement GUI
8-
# Purpose: Perform an automated I-V sweep using a Keithley 2400.
9-
# (Grid-based layout for stability)
10-
# Author: Prathamesh K. Deshmukh
11-
# Created: 10/09/2025
12-
# Version: 12.2 (Added GPIB Scanner Utility)
13-
# -------------------------------------------------------------------------------
14-
15-
# --- Packages for Front end ---
166
import tkinter as tk
177
from tkinter import ttk, Label, Entry, LabelFrame, filedialog, messagebox, scrolledtext, Canvas
188
import numpy as np

pica/keithley/k2400/Instrument_Control/IV_K2400_Loop_Instrument_Control.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,7 @@
22
This script interfaces with a Keithley 2400 SourceMeter to perform
33
Current-Voltage (I-V) characterization of a device.
44
5-
The script prompts the user for a current range and step size, then configures
6-
the instrument to source a current and measure the corresponding voltage.
7-
It sweeps the current through a predefined pattern from a negative to a
8-
positive value and back, collecting I-V data points. Finally, it saves the
9-
collected data to a tab-separated .txt file and generates a plot of the
10-
I-V curve.
115
"""
12-
# -------------------------------------------------------------------------------
13-
# Name: #interfacing only Keithley2400(current source) for IV
14-
# Last Update :27/09/2024
15-
# Purpose: IV Measurement
16-
#
17-
# Author: Instrument-DSL
18-
#
19-
# Created: 30/09/2024
20-
# Changes_done:Working
21-
# ------------------------------------------------------------------------
226

237
import os
248
import numpy as np

pica/keithley/k2400/RT_K2400_L350_T_Control_GUI.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,6 @@
33
Purpose: GUI module for RT K2400 L350 T Control GUI v3.
44
"""
55

6-
# -------------------------------------------------------------------------------
7-
# Name: Active R-T Measurement for Keithley 2400
8-
# Purpose: Provide a GUI for automated R-T sweeps using a K2400 and LS350
9-
# with active temperature control (stabilize then ramp).
10-
# Author: Prathamesh K. Deshmukh (Adapted from 6517B & 2400 scripts)
11-
# Created: 05/10/2025
12-
# Version: 1.0
13-
# -------------------------------------------------------------------------------
14-
15-
# --- GUI and Plotting Packages ---
166
import tkinter as tk
177
from tkinter import ttk, filedialog, messagebox, scrolledtext, Canvas
188
import os

pica/keithley/k2400/RT_K2400_L350_T_Sensing_GUI.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,6 @@
33
Purpose: GUI module for RT K2400 L350 T Sensing GUI v4.
44
"""
55

6-
# -------------------------------------------------------------------------------
7-
# Name: Passive R-T for Keithley 2400
8-
# Purpose: Provide a GUI for passively logging R-T data using a K2400
9-
# and LS350. This version does not control temperature.
10-
# Author: Prathamesh K. Deshmukh (Adapted from 6517B & 2400 scripts)
11-
# Created: 05/10/2025
12-
# Version: 1.0
13-
# -------------------------------------------------------------------------------
14-
15-
# --- GUI and Plotting Packages ---
166
import tkinter as tk
177
from tkinter import ttk, filedialog, messagebox, scrolledtext, Canvas
188
import os

pica/keysight/CV_KE4980A_GUI.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,8 @@
11
'''
2-
===============================================================================
32
PROGRAM: Keysight E4980A C-V Measurement GUI
43
54
PURPOSE: Provide a user-friendly interface for automating C-V sweeps.
65
7-
DESCRIPTION: This program provides a graphical user interface (GUI) for
8-
automating a Capacitance-Voltage (C-V) sweep using a Keysight
9-
E4980A LCR Meter. It allows users to define sweep parameters,
10-
visualize the C-V curve in real-time, and save the data
11-
automatically.
12-
13-
AUTHOR: Prathamesh K. Deshmukh
14-
15-
VERSION: 1.0
16-
LAST EDITED: 05/10/2025
17-
===============================================================================
186
'''
197

208
# --- Packages for Front end ---

pica/lakeshore/Instrument_Control/T_Control_L350_Simple_Instrument_Control.py

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,7 @@
11
'''
2-
File: lakeshore_350_ramp_control.py
3-
Author: Prathamesh K. Deshmukh
4-
Date: 10/09/2025
5-
Version: 2.0
6-
7-
Description:
8-
This script provides a robust framework for automating a linear temperature ramp
9-
experiment using a Lakeshore Model 350 Temperature Controller.
10-
11-
The program connects to the instrument via its VISA address and interactively
12-
prompts the user for all experiment parameters, including start/end temperatures,
13-
ramp rate, and a safety cutoff. It uses the instrument's built-in setpoint
14-
ramping feature to ensure a smooth, linear temperature rise.
15-
16-
During the experiment, it continuously logs the timestamp, elapsed time, and
17-
temperature from a specified sensor to a user-selected CSV file. A live,
18-
updating plot provides immediate visual feedback of the ramp's progress.
19-
20-
The experiment terminates safely under all conditions (completion, safety cutoff,
21-
user interruption, or error), guaranteeing that the heater is turned off and the
22-
instrument connection is properly closed.
23-
24-
Dependencies:
25-
- pyvisa: For instrument communication.
26-
- matplotlib: For live data plotting.
27-
- tkinter: For the graphical file-save dialog.
28-
- A VISA backend (e.g., NI-VISA) must be installed.
29-
'''
30-
# -------------------------------------------------------------------------------
312
# Name: Interfacing Lakeshore 350 Temperature Controller
323
# Purpose: Automate and log a linear temperature ramp with live plotting.
33-
# Changes_done: V2.0 - Complete restructure for robustness and usability.
34-
# -------------------------------------------------------------------------------
35-
4+
'''
365
import pyvisa
376
import time
387
import csv

0 commit comments

Comments
 (0)