Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work with PSTrace 5.9 #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Calibration Example.pssession
Binary file not shown.
Binary file added EIS dummy cell.pssession
Binary file not shown.
58 changes: 29 additions & 29 deletions PSData.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,8 @@ def _parse(self, filenames):

try:
for file in self.files:
for measurement in parsedData[file].measurements:
currentMethod = self._getMethodType(measurement.method).upper()
for measurement in parsedData[file].Measurements:
currentMethod = self._getMethodType(measurement.Method).upper()
index = len([i for i, s in enumerate(self._experimentList) if currentMethod in s])
self._experimentList.append(currentMethod + ' ' + str(index + 1))
except:
Expand All @@ -255,8 +255,8 @@ def _simplify(self):
experimentIndex = 0
for file in self.files:
rawData = self._parsedData[file]
for measurement in rawData.measurements:
currentMethod = self._getMethodType(measurement.method).upper()
for measurement in rawData.Measurements:
currentMethod = self._getMethodType(measurement.Method).upper()
if currentMethod in self._methodType.SWV or currentMethod in self._methodType.CV:
simplifiedData[self._experimentList[experimentIndex]] = self._getXYDataPoints(measurement)
simplifiedData[self._experimentList[experimentIndex] + ' Details'] = self._getXYUnits(measurement)
Expand All @@ -271,12 +271,12 @@ def _simplify(self):
def _getXYUnits(self, measurement):
unit = {}
try:
xtext = measurement.curves[0].xaxisdataarray.unit.type
ytext = measurement.curves[0].yaxisdataarray.unit.type
xtext = measurement.Curves[0].XAxisDataArray.Unit.Type
ytext = measurement.Curves[0].YAxisDataArray.Unit.Type
if xtext is not None:
unit['x'] = self._unitTextToScale(xtext)
unit['y'] = self._unitTextToScale(ytext)
unit['title'] = measurement.title
unit['title'] = measurement.Title
except:
print('Exception when processing units for SWV or CV.')
unit = {}
Expand Down Expand Up @@ -305,47 +305,47 @@ def _unitTextToScale(self, text):

def _getXYDataPoints(self, measurement):
ax = axis()
for curve in measurement.curves:
for curve in measurement.Curves:
pos = 0
for y in curve.yaxisdataarray.datavalues:
ax.xvalues.append(curve.xaxisdataarray.datavalues[pos].v)
ax.yvalues.append(y.v)
for y in curve.YAxisDataArray.DataValues:
ax.xvalues.append(curve.XAxisDataArray.DataValues[pos].V)
ax.yvalues.append(y.V)
pos = pos + 1
return ax

def _getEISDataPoints(self, measurement):
eisdata = EISMeasurement()
for eis in measurement.eisdatalist:
for value in eis.dataset.values:
if value.unit.q is not None:
for eis in measurement.EISDataList:
for value in eis.DataSet.Values:
if value.Unit.Q is not None:
v = []
for c in value.datavalues:
v.append(c.v)
if value.unit.q == "Frequency":
for c in value.DataValues:
v.append(c.V)
if value.Unit.Q == "Frequency":
eisdata.freq = v
if value.unit.q == "Z'":
if value.Unit.Q == "Z'":
eisdata.zdash = v
if value.unit.q == "Potential'":
if value.Unit.Q == "Potential'":
eisdata.potential = v
if value.unit.q == "-Z''":
if value.Unit.Q == "-Z''":
eisdata.zdashneg = v
if value.unit.q == "Z":
if value.Unit.Q == "Z":
eisdata.Z = v
if value.unit.q == "-Phase":
if value.Unit.Q == "-Phase":
eisdata.phase = v
if value.unit.q == "npoints":
if value.Unit.Q == "npoints":
eisdata.npoints = v
if value.unit.q == "tint":
if value.Unit.Q == "tint":
eisdata.tint = v
if value.unit.q == "ymean":
if value.Unit.Q == "ymean":
eisdata.ymean = v
if value.unit.q == "debugtext":
if value.Unit.Q == "debugtext":
eisdata.debugtext = v
if value.unit.q == "Y":
if value.Unit.Q == "Y":
eisdata.Y = v
if value.unit.q == "Y'":
if value.Unit.Q == "Y'":
eisdata.YRe = v
if value.unit.q == "Y''":
if value.Unit.Q == "Y''":
eisdata.YIm = v

pos = 0
Expand Down