Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
raser
Manage
Activity
Members
Labels
Plan
Issues
1
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RASER-TEAM
raser
Commits
f81ef88c
Commit
f81ef88c
authored
5 months ago
by
Chenxi Fu
Browse files
Options
Downloads
Patches
Plain Diff
整理电路文件命名
parent
9ea1d312
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!38
ngspice功能整理&画图配置更新
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
__main__.py
+1
-0
1 addition, 0 deletions
__main__.py
elec/__init__.py
+4
-3
4 additions, 3 deletions
elec/__init__.py
elec/ngspice_set_input.py
+5
-2
5 additions, 2 deletions
elec/ngspice_set_input.py
elec/ngspice_set_tmp_cir.py
+1
-1
1 addition, 1 deletion
elec/ngspice_set_tmp_cir.py
with
11 additions
and
6 deletions
__main__.py
+
1
−
0
View file @
f81ef88c
...
...
@@ -34,6 +34,7 @@ parser_draw.add_argument('label', help='LABEL to identify root files')
parser_elec
=
subparsers
.
add_parser
(
'
elec
'
,
help
=
'
electronic readout
'
)
parser_elec
.
add_argument
(
'
label
'
,
help
=
'
LABEL to identify electronics operations
'
)
parser_elec
.
add_argument
(
'
name
'
,
help
=
'
LABEL to identify electronics files
'
)
parser_elec
.
add_argument
(
'
-tct
'
,
help
=
'
signal from TCT
'
,
action
=
"
store_true
"
)
parser_field
=
subparsers
.
add_parser
(
'
field
'
,
help
=
'
calculate field/weight field and iv/cv
'
)
parser_field
.
add_argument
(
'
label
'
,
help
=
'
LABEL to identify operation
'
)
...
...
This diff is collapsed.
Click to expand it.
elec/__init__.py
+
4
−
3
View file @
f81ef88c
...
...
@@ -5,6 +5,7 @@ from util.output import output
def
main
(
kwargs
):
label
=
kwargs
[
'
label
'
]
# Operation label or detector name
name
=
kwargs
[
'
name
'
]
is_tct
=
kwargs
[
'
tct
'
]
os
.
makedirs
(
'
output/elec/{}
'
.
format
(
name
),
exist_ok
=
True
)
if
label
==
'
trans
'
:
...
...
@@ -18,10 +19,10 @@ def main(kwargs):
readout
.
main
(
label
)
else
:
from
.
import
ngspice_set_input
from
.
import
ngspice
input_p
=
ngspice_set_input
.
set_input
(
label
)
from
.
import
ngspice
_set_tmp_cir
input_p
=
ngspice_set_input
.
set_input
(
label
,
is_tct
)
input_c
=
'
,
'
.
join
(
input_p
)
ngspice
.
ngspice
(
input_c
,
label
,
name
)
ngspice
_set_tmp_cir
.
ngspice_set_tmp_cir
(
input_c
,
label
,
name
)
subprocess
.
run
([
'
ngspice -b output/elec/{}/{}_tmp.cir
'
.
format
(
label
,
name
)],
shell
=
True
)
file_path
=
output
(
__file__
,
label
)
from
.
import
ngspice_get_fig
...
...
This diff is collapsed.
Click to expand it.
elec/ngspice_set_input.py
+
5
−
2
View file @
f81ef88c
...
...
@@ -7,13 +7,16 @@ ROOT.gROOT.SetBatch(True)
from
util.output
import
output
# TODO: Need to be TOTALLY rewritten
def
set_input
(
det_name
,
key
=
None
):
def
set_input
(
det_name
,
is_tct
=
False
,
key
=
None
):
current
=
[]
time
=
[]
if
key
==
None
:
key
=
""
path
=
"
output/current/{}
"
.
format
(
det_name
)
myFile
=
ROOT
.
TFile
(
os
.
path
.
join
(
path
,
"
sim-current
"
+
str
(
key
))
+
"
.root
"
)
if
is_tct
:
myFile
=
ROOT
.
TFile
(
os
.
path
.
join
(
path
,
"
sim-current-TCT
"
+
str
(
key
))
+
"
.root
"
)
else
:
myFile
=
ROOT
.
TFile
(
os
.
path
.
join
(
path
,
"
sim-current
"
+
str
(
key
))
+
"
.root
"
)
myt
=
myFile
.
tree
for
entry
in
myt
:
...
...
This diff is collapsed.
Click to expand it.
elec/ngspice.py
→
elec/ngspice
_set_tmp_cir
.py
+
1
−
1
View file @
f81ef88c
import
re
def
ngspice
(
input_c
,
det_name
,
ele_name
):
def
ngspice
_set_tmp_cir
(
input_c
,
det_name
,
ele_name
):
with
open
(
'
./param_file/circuit/{}.cir
'
.
format
(
ele_name
),
'
r
'
)
as
f
:
lines
=
f
.
readlines
()
for
i
in
range
(
len
(
lines
)):
...
...
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