OECT Transfer Curve Analysis
A Python package for analyzing Organic Electrochemical Transistor (OECT) transfer characteristic curves. This library provides comprehensive tools for extracting key device parameters including transconductance, threshold voltage, and device performance metrics.
🚀 Features
- Transconductance Analysis: Calculate transconductance (gm) using robust numerical differentiation
- Threshold Voltage Extraction: Automatic Von calculation using logarithmic slope method
- Device Type Support: Support for both N-type and P-type devices
- Robust Data Processing: Built-in validation and error handling for noisy data
- Forward/Reverse Analysis: Separate analysis of forward and reverse sweep directions
- Performance Metrics: Extract maximum/minimum current points and related parameters
📦 Installation
Prerequisites
- Python 3.7 or higher
- NumPy
- Standard library dependencies
Install from source
git clone https://github.com/Durian-leader/oect_transfer/oect-transfer.git
cd oect-transfer
pip install -e .
Dependencies
pip install numpy
🔧 Quick Start
Basic Usage
import numpy as np
from oect_transfer import Transfer
# Example data: Gate voltage (Vg) and drain current (Id)
vg = np.linspace(-0.5, 0.5, 100) # Gate voltage in V
id = np.exp(vg * 10) * 1e-6 # Drain current in A (example)
# Create Transfer object
transfer = Transfer(vg, id, device_type="N")
# Access computed parameters
print(f"Maximum transconductance: {transfer.gm_max.raw:.2e} S")
print(f"Threshold voltage: {transfer.Von.raw:.3f} V")
print(f"Maximum current: {transfer.I_max.raw:.2e} A")
Advanced Analysis
# Analyze forward and reverse sweeps separately
print(f"Forward gm_max: {transfer.gm_max.forward:.2e} S")
print(f"Reverse gm_max: {transfer.gm_max.reverse:.2e} S")
# Check where maximum transconductance occurs
print(f"gm_max location: {transfer.gm_max.where}") # 'forward', 'reverse', or 'turning_point'
# Access raw data sequences
print(f"Gate voltage range: {transfer.Vg.raw.min():.2f} to {transfer.Vg.raw.max():.2f} V")
print(f"Current range: {transfer.I.raw.min():.2e} to {transfer.I.raw.max():.2e} A")
P-type Device Analysis
# For P-type devices, specify device_type="P"
transfer_p = Transfer(vg, id, device_type="P")
print(f"P-type Von: {transfer_p.Von.raw:.3f} V")
📚 API Reference
Classes
Transfer
Main class for transfer curve analysis.
Constructor:
Transfer(x, y, device_type="N")
Parameters:
x(array-like): Gate voltage data (Vg)y(array-like): Drain current data (Id)device_type(str): Device type, "N" for N-type, "P" for P-type
Attributes:
Vg(Sequence): Gate voltage data (raw, forward, reverse)I(Sequence): Drain current data (raw, forward, reverse)gm(Sequence): Transconductance datagm_max(Point): Maximum transconductance pointI_max(Point): Maximum current pointI_min(Point): Minimum current pointVon(Point): Threshold voltage point
Sequence
Data container for raw, forward, and reverse sweep data.
Attributes:
raw(NDArray): Complete datasetforward(NDArray): Forward sweep (up to maximum Vg)reverse(NDArray): Reverse sweep (from maximum Vg)
Point
Container for parameter values at specific points.
Attributes:
raw(float): Value from complete datasetwhere(str): Location ("forward", "reverse", or "turning_point")forward(float): Value from forward sweepreverse(float): Value from reverse sweep
Methods
safe_diff(f, x)
Static method for robust numerical differentiation.
Parameters:
f(array): Function valuesx(array): Independent variable values
Returns:
NDArray: Computed derivatives
🧪 Examples
Example 1: Analyzing Experimental Data
import numpy as np
import matplotlib.pyplot as plt
from oect_transfer import Transfer
# Load your experimental data
vg_data = np.loadtxt('gate_voltage.txt')
id_data = np.loadtxt('drain_current.txt')
# Create transfer object
transfer = Transfer(vg_data, id_data, device_type="N")
# Plot results
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(12, 5))
# Transfer curve
ax1.semilogy(transfer.Vg.raw, np.abs(transfer.I.raw))
ax1.axvline(transfer.Von.raw, color='red', linestyle='--',
label=f'Von = {transfer.Von.raw:.3f} V')
ax1.set_xlabel('Gate Voltage (V)')
ax1.set_ylabel('|Drain Current| (A)')
ax1.legend()
ax1.grid(True)
# Transconductance
ax2.plot(transfer.Vg.raw[:-1], transfer.gm.raw)
ax2.axhline(transfer.gm_max.raw, color='red', linestyle='--',
label=f'gm_max = {transfer.gm_max.raw:.2e} S')
ax2.set_xlabel('Gate Voltage (V)')
ax2.set_ylabel('Transconductance (S)')
ax2.legend()
ax2.grid(True)
plt.tight_layout()
plt.show()
Example 2: Comparing Forward and Reverse Sweeps
# Analyze hysteresis
forward_von = transfer.Von.forward
reverse_von = transfer.Von.reverse
hysteresis = abs(forward_von - reverse_von)
print(f"Forward Von: {forward_von:.3f} V")
print(f"Reverse Von: {reverse_von:.3f} V")
print(f"Hysteresis: {hysteresis:.3f} V")
# Plot forward vs reverse
plt.figure(figsize=(8, 6))
plt.semilogy(transfer.Vg.forward, np.abs(transfer.I.forward),
'b-', label='Forward')
plt.semilogy(transfer.Vg.reverse, np.abs(transfer.I.reverse),
'r--', label='Reverse')
plt.axvline(forward_von, color='blue', alpha=0.7, linestyle=':')
plt.axvline(reverse_von, color='red', alpha=0.7, linestyle=':')
plt.xlabel('Gate Voltage (V)')
plt.ylabel('|Drain Current| (A)')
plt.legend()
plt.grid(True)
plt.title('Transfer Curve: Forward vs Reverse')
plt.show()
⚠️ Important Notes
Data Requirements
- Input arrays must be 1D and of equal length
- No NaN or infinite values are allowed
- Minimum 2 data points required for meaningful analysis
- Data should span a reasonable voltage range including the device turn-on region
Device Type Selection
-
N-type devices: Use
device_type="N"(default)- Von calculated using maximum logarithmic slope
- Suitable for enhancement-mode n-channel devices
-
P-type devices: Use
device_type="P"- Von calculated using minimum logarithmic slope
- Suitable for enhancement-mode p-channel devices
Transconductance Calculation
The transconductance is calculated using a robust numerical differentiation method that:
- Uses forward, backward, and central difference schemes appropriately
- Handles turning points with averaged derivatives
- Includes safeguards against division by zero
🤝 Contributing
We welcome contributions! Please see our Contributing Guidelines for details.
Development Setup
git clone https://github.com/Durian-leader/oect_transfer.git
cd oect-transfer
pip install -e .[dev]
Running Tests
pytest tests/
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
👥 Authors
- lidonghao - Initial work - lidonghao100@outlook.com
🙏 Acknowledgments
- Thanks to the OECT research community for valuable feedback
- Inspired by standard practices in organic electronics characterization
📞 Support
If you encounter any issues or have questions:
- Check the Issues page
- Create a new issue with detailed description
- Contact the maintainer at lidonghao100@outlook.com
📈 Roadmap
- Add support for output characteristic analysis
- Implement mobility extraction methods
- Add data export functionality
- Develop GUI interface
- Add more device parameter extraction methods
Keywords: OECT, Organic Electrochemical Transistor, Transfer Curve, Transconductance, Threshold Voltage, Device Characterization, Python, Analysis
Metadata
Release files for oect-transfer 0.4.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| oect_transfer-0.4.2.tar.gz | 11.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| oect_transfer-0.4.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.9 kB
Release files / oect_transfer-0.4.2.tar.gz
| Download URL | oect_transfer-0.4.2.tar.gz |
|---|---|
| Size | 11.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1875feaf8d7791f19900370cb28fe969e6c65eaf74fa9ededa529f5892fdfb75
|
|
BLAKE2b-256 checksum How to use checksums |
c4134b63a5c62668fcdec17eed7f15e646a32599cb1cff4223234aa8d630ccfb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Release files / oect_transfer-0.4.2-py3-none-any.whl
| Download URL | oect_transfer-0.4.2-py3-none-any.whl |
|---|---|
| Size | 7.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5099a4b7da016b828d6c30feda6d4e485af53ea69bc0ab2e72a90d5d1c96fe52
|
|
BLAKE2b-256 checksum How to use checksums |
a4cd51dd4770c460c309913cee4271c2abef0645c23357ac2342452aeb5e2c85
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Security for oect-transfer 0.4.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.