Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
mbtrack2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PA
Collective Effects
mbtrack2
Commits
9ab5a7a3
Commit
9ab5a7a3
authored
4 months ago
by
Sudhanshu THAKUR
Browse files
Options
Downloads
Patches
Plain Diff
modified formatter
parent
ba7d42a8
Branches
Branches containing commit
No related tags found
1 merge request
!39
Draft: read_wakis function to read Impedance/wakepotential from wakis
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
mbtrack2/utilities/read_impedance.py
+17
-15
17 additions, 15 deletions
mbtrack2/utilities/read_impedance.py
with
17 additions
and
15 deletions
mbtrack2/utilities/read_impedance.py
+
17
−
15
View file @
9ab5a7a3
...
...
@@ -414,10 +414,12 @@ def read_wakis(file, component_type='long', divide_by=None, imp=True):
sep
=
r
'
\s+
'
,
names
=
[
"
Frequency
"
,
"
Z
"
])
# read as string
df
[
"
Frequency
"
]
=
df
[
"
Frequency
"
].
apply
(
lambda
x
:
complex
(
x
.
strip
(
"
()
"
)))
# Convert both columns from strings to complex numbers
df
[
"
Frequency
"
]
=
df
[
"
Frequency
"
].
apply
(
lambda
x
:
complex
(
x
.
strip
(
"
()
"
)))
# Convert both columns from strings to complex numbers
df
[
"
Z
"
]
=
df
[
"
Z
"
].
apply
(
lambda
x
:
complex
(
x
.
strip
(
"
()
"
)))
df
[
"
Frequency
"
]
=
df
[
"
Frequency
"
].
apply
(
lambda
z
:
z
.
real
)
# Remove imaginary parts from frequency column (they're all 0j)
df
[
"
Frequency
"
]
=
df
[
"
Frequency
"
].
apply
(
lambda
z
:
z
.
real
)
# Remove imaginary parts from frequency column (they're all 0j)
if
divide_by
is
not
None
:
# Normalize if needed
df
[
"
Z
"
]
=
df
[
"
Z
"
]
/
divide_by
if
component_type
==
'
long
'
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment