Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
EST
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
osherso2
EST
Commits
bfca98fe
Commit
bfca98fe
authored
5 years ago
by
osherso2
Browse files
Options
Downloads
Patches
Plain Diff
Helper lib: does simple ADU <-> Voltage or amps computation.
parent
abbceeba
No related branches found
No related tags found
1 merge request
!1
S4 design
Pipeline
#184832
canceled
5 years ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
adu_conversion.py
+43
-0
43 additions, 0 deletions
adu_conversion.py
with
43 additions
and
0 deletions
adu_conversion.py
0 → 100644
+
43
−
0
View file @
bfca98fe
import
numpy
def
feedback_ADU_to_A
(
val
,
fb_bits
=
14
,
fb_maxV
=
.
965
,
fb_R
=
15200
,
m
=
8
):
b
=
fb_bits
v
=
fb_maxV
r
=
fb_R
val
=
val
*
(
2.0
**-
b
)
*
v
/
(
r
*
m
)
return
val
def
bias_ADU_to_A
(
val
,
bias_bits
=
16
,
bias_maxV
=
2.5
,
bias_R
=
1096
):
b
=
bias_bits
v
=
bias_maxV
r
=
bias_R
val
=
val
*
(
2.0
**-
b
)
*
v
/
r
return
val
def
feedback_A_to_ADU
(
val
,
fb_bits
=
14
,
fb_maxV
=
.
965
,
fb_R
=
1050
,
m
=
8
):
b
=
fb_bits
v
=
fb_maxV
r
=
fb_R
val
=
(
val
*
r
*
m
/
v
)
*
(
2.0
**
b
)
return
val
def
bias_A_to_ADU
(
val
,
bias_bits
=
16
,
bias_maxV
=
2.5
,
bias_R
=
1096
):
b
=
bias_bits
v
=
bias_maxV
r
=
bias_R
val
=
(
val
*
r
/
v
)
*
(
2.0
**
b
)
return
val
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