Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CCS
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Marko Mecina
CCS
Compare revisions
2d027583b15e1bbcda2b10847d442d8f142fadf5 to 7aa92c757c3a54a10a5d4c325da3e3e4578e48f0
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
mecinam2/ccs
Select target project
No results found
7aa92c757c3a54a10a5d4c325da3e3e4578e48f0
Select Git revision
Branches
release
workshop
2 results
Swap
Target
mecinam2/ccs
Select target project
mecinam2/ccs
1 result
2d027583b15e1bbcda2b10847d442d8f142fadf5
Select Git revision
Branches
release
workshop
2 results
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (2)
update test script generator
· 36353023
Marko Mecina
authored
10 months ago
36353023
update SMILE calibration functions
· 7aa92c75
Marko Mecina
authored
10 months ago
7aa92c75
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Ccs/calibrations_SMILE.py
+21
-2
21 additions, 2 deletions
Ccs/calibrations_SMILE.py
Tst/json_to_barescript.py
+6
-3
6 additions, 3 deletions
Tst/json_to_barescript.py
with
27 additions
and
5 deletions
Ccs/calibrations_SMILE.py
View file @
7aa92c75
...
...
@@ -254,6 +254,7 @@ class Rse:
# fit polynomial of degree POLY_DEG through CCD ADU-degC relation (operational range)
# IASW coefs for EQM: [-3.55073060e+02, 2.04890302e-02, 3.32985037e-06, -2.20945595e-10, 6.07858723e-15]
# IASW coefs for PFM nom: ['-4.02587E+02', '4.33198E-02', '-9.26990E-07', '1.53423E-10', '-6.16102E-15']
# IASW coefs for PFM red: ['-3.78077E+02', '2.99914E-02', '1.66375E-06', '-7.20486E-11', '1.17412E-15']
POLY_DEG
=
4
...
...
@@ -262,7 +263,8 @@ _ccd_temp_fit_adu = np.polynomial.polynomial.Polynomial.fit(_ccd_temp_adu_array[
POLY_DEG
).
convert
()
_ccd_temp_fit_adu_inv
=
np
.
polynomial
.
polynomial
.
Polynomial
.
fit
(
_ccd_temp_adu_array
[
0
],
_ccd_temp_adu_array
[
2
],
POLY_DEG
).
convert
()
_ccd_temp_interp_adu_inv
=
sp
.
interpolate
.
interp1d
(
_ccd_temp_adu_array
[
0
],
_ccd_temp_adu_array
[
2
],
kind
=
'
cubic
'
,
fill_value
=
'
extrapolate
'
)
# cubic-spline interpolation of PSU ADU-degC relation (nominal values)
_psu_temp_adu_array
=
np
.
array
(
PSU_TEMP
).
T
# (degC, ADC_V, ADU_dec, ADU_hex)
...
...
@@ -283,7 +285,7 @@ def t_ccd_deg_to_adu_oper(t, warn=True):
if
not
((
_ccd_temp_adu_array
[
0
].
min
()
<=
t
)
&
(
t
<=
_ccd_temp_adu_array
[
0
].
max
())).
all
()
and
warn
:
print
(
'
WARNING! Value(s) outside operational range ({} - {})!
'
.
format
(
_ccd_temp_adu_array
[
0
].
min
(),
_ccd_temp_adu_array
[
0
].
max
()))
return
np
.
rint
(
_ccd_temp_
fit
_adu_inv
(
t
)).
astype
(
int
)
return
np
.
rint
(
_ccd_temp_
interp
_adu_inv
(
t
)).
astype
(
int
)
def
t_ccd_adu_to_deg_nonoper
(
adu
):
...
...
@@ -565,6 +567,23 @@ class Limits:
# raw ambient CCD limits
ADC_TEMP_CCD_AMB
=
(
0x1968
,
0x19DD
,
0x29DB
,
0x2A49
)
@classmethod
def
limitparametersformram
(
cls
):
MRAM_ORDER
=
[
"
ADC_P3V9
"
,
"
ADC_P3V3
"
,
"
ADC_P3V3_LVDS
"
,
"
ADC_P2V5
"
,
"
ADC_P1V8
"
,
"
ADC_P1V2
"
,
"
ADC_REF
"
,
"
ADC_TEMP1
"
,
"
ADC_TEMP_CCD
"
,
"
ADC_TEMP_FEE
"
,
"
ADC_I_FEE_ANA
"
,
"
ADC_I_FEE_DIG
"
,
"
ADC_I_DPU
"
,
"
ADC_I_RSE
"
,
"
ADC_I_HEATER
"
,
"
ADC_PSU_TEMP
"
]
out
=
[]
cmd
=
[]
for
par
in
MRAM_ORDER
:
ll
,
lw
,
uw
,
ul
=
getattr
(
Limits
,
par
)
line
=
'
{nn}WarnLowerLimit = {}
\n
{nn}AlarmLowerLimit = {}
\n
{nn}WarnUpperLimit = {}
\n
{nn}AlarmUpperLimit = {}
'
.
format
(
lw
,
ll
,
uw
,
ul
,
nn
=
par
)
out
.
append
(
line
)
cmd
.
append
(
'
{nn}WarnLowerLimit, {nn}AlarmLowerLimit, {nn}WarnUpperLimit, {nn}AlarmUpperLimit
'
.
format
(
nn
=
par
))
print
(
'
\n
'
.
join
(
out
)
+
'
\n\n\n
'
+
'
,
'
.
join
(
cmd
))
class
LimitTables
:
...
...
This diff is collapsed.
Click to expand it.
Tst/json_to_barescript.py
View file @
7aa92c75
...
...
@@ -13,7 +13,7 @@ import os
import
json
import
sys
MIB_VERSION
=
'
1.
5
'
MIB_VERSION
=
'
1.
8.1
'
def
run
(
jfile
,
outfile
,
reportfunc
=
False
,
specfile
=
None
):
...
...
@@ -45,7 +45,10 @@ def run(jfile, outfile, reportfunc=False, specfile=None):
script
+=
'
ask_tc_exec = True
\n
'
script
+=
'
report = cfl.TestReport(specfile, rep_version, mib_version, gui=True)
\n\n
'
script
+=
'
# Precond.
\n
# {}
\n
#! CCS.BREAKPOINT
\n\n
'
.
format
(
replace_newline
(
data
[
'
_precon_descr
'
]))
# init code
script
+=
'
# INIT CODE
\n
{}
\n
#! CCS.BREAKPOINT
\n\n
'
.
format
(
data
[
'
_custom_imports
'
])
script
+=
'
# PRECONDITIONS
\n
# {}
\n
#! CCS.BREAKPOINT
\n\n
'
.
format
(
replace_newline
(
data
[
'
_precon_descr
'
]))
# script += '{}\n\n\n'.format(data['_precon_code'].strip()) # Add the precondition code
for
step
in
data
[
'
sequences
'
][
0
][
'
steps
'
]:
...
...
@@ -74,7 +77,7 @@ def run(jfile, outfile, reportfunc=False, specfile=None):
script
+=
txt
script
+=
'
# P
ostcond.
\n
# {}
\n
'
.
format
(
replace_newline
(
data
[
'
_postcon_descr
'
]))
script
+=
'
# P
OSTCONDITIONS
\n
# {}
\n
'
.
format
(
replace_newline
(
data
[
'
_postcon_descr
'
]))
# script += data['_postcon_code'].strip() # Add the postcondition code
if
reportfunc
:
...
...
This diff is collapsed.
Click to expand it.