Skip to content

Commit

Permalink
Merge branch 'master' into workaround-dcct-reliable
Browse files Browse the repository at this point in the history
  • Loading branch information
ximenes committed Mar 6, 2024
2 parents 6acdaa4 + a6d441d commit 21b3029
Show file tree
Hide file tree
Showing 14 changed files with 222 additions and 123 deletions.
2 changes: 1 addition & 1 deletion siriuspy/siriuspy/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.85.0
2.86.0
33 changes: 33 additions & 0 deletions siriuspy/siriuspy/clientconfigdb/configdb_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import json as _json
import datetime as _datetime
import re as _re
from urllib import parse as _parse
from urllib.request import Request as _Request, urlopen as _urlopen
from urllib.error import URLError as _URLError
Expand Down Expand Up @@ -170,6 +171,38 @@ def check_valid_value(self, value, config_type=None):
config_type = self._process_config_type(config_type)
return _templates.check_value(config_type, value)

@staticmethod
def compare_configs(config1, config2, pos_pattern=None, neg_pattern=None):
"""Compare "pvs" attribute of configs 1 and 2.
Print the differences.
Args:
config1 (dict): Valid configuration with "pvs" attribute.
config2 (dict): Valid configuration with "pvs" attribute.
pos_pattern (str, optional): Only PVs with this pattern will be
checked. Defaults to None. None means all PVs will be compared.
neg_pattern (_type_, optional): PVs which match this pattern will
not be checked. Defaults to None. None means no PV will be
excluded from comparison. In case of conflict with
`pos_pattern`, it will take precedence.
"""
pos_re = _re.compile('' if pos_pattern is None else pos_pattern)
# In case of None in neg_pattern, create a regexp that never matches:
# https://stackoverflow.com/questions/1723182/a-regex-that-will-never-be-matched-by-anything
neg_re = _re.compile(r'(?!x)x' if neg_pattern is None else neg_pattern)

cf1pvs = {n: v for n, v, _ in config1['pvs']}
cf2pvs = {n: v for n, v, _ in config2['pvs']}

for pv in cf1pvs.keys() | cf2pvs.keys():
if not pos_re.match(pv) or neg_re.match(pv):
continue
val1 = str(cf1pvs.get(pv, 'Not present'))
val2 = str(cf2pvs.get(pv, 'Not present'))
if val1 != val2:
print(f'{pv:50s} {val1[:30]:30s} {val2[:30]:30s}')

@classmethod
def check_valid_configname(cls, name):
"Check if `name` is a valid name for configurations."
Expand Down
137 changes: 103 additions & 34 deletions siriuspy/siriuspy/clientconfigdb/types/as_rf.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def get_dict():

_pvs_bo_rfcal = [
# Offsets and conv coeffs
['BR-RF-DLLRF-01:CAV:Const:OFS:S', 0, 0.0],
['BR-RF-DLLRF-01:CAV:Const:OFS:S', 0, 0.0], # [dB]
['BR-RF-DLLRF-01:CAV:Const:Raw-U:C0:S', 0, 0.0],
['BR-RF-DLLRF-01:CAV:Const:Raw-U:C1:S', 0, 0.0],
['BR-RF-DLLRF-01:CAV:Const:Raw-U:C2:S', 0, 0.0],
Expand All @@ -227,7 +227,7 @@ def get_dict():
['BR-RF-DLLRF-01:CAV:Const:U-Raw:C2:S', 0, 0.0],
['BR-RF-DLLRF-01:CAV:Const:U-Raw:C3:S', 0, 0.0],
['BR-RF-DLLRF-01:CAV:Const:U-Raw:C4:S', 0, 0.0],
['BR-RF-DLLRF-01:FWDCAV:Const:OFS:S', 0, 0.0],
['BR-RF-DLLRF-01:FWDCAV:Const:OFS:S', 0, 0.0], # [dB]
['BR-RF-DLLRF-01:FWDCAV:Const:Raw-U:C0:S', 0, 0.0],
['BR-RF-DLLRF-01:FWDCAV:Const:Raw-U:C1:S', 0, 0.0],
['BR-RF-DLLRF-01:FWDCAV:Const:Raw-U:C2:S', 0, 0.0],
Expand All @@ -238,19 +238,19 @@ def get_dict():
['BR-RF-DLLRF-01:FWDCAV:Const:U-Raw:C2:S', 0, 0.0],
['BR-RF-DLLRF-01:FWDCAV:Const:U-Raw:C3:S', 0, 0.0],
['BR-RF-DLLRF-01:FWDCAV:Const:U-Raw:C4:S', 0, 0.0],
['BR-RF-DLLRF-01:REVCAV:Const:OFS:S', 0, 0.0],
['BR-RF-DLLRF-01:REVCAV:Const:OFS:S', 0, 0.0], # [dB]
['BR-RF-DLLRF-01:REVCAV:Const:Raw-U:C0:S', 0, 0.0],
['BR-RF-DLLRF-01:REVCAV:Const:Raw-U:C1:S', 0, 0.0],
['BR-RF-DLLRF-01:REVCAV:Const:Raw-U:C2:S', 0, 0.0],
['BR-RF-DLLRF-01:REVCAV:Const:Raw-U:C3:S', 0, 0.0],
['BR-RF-DLLRF-01:REVCAV:Const:Raw-U:C4:S', 0, 0.0],
['BR-RF-DLLRF-01:MO:Const:OFS:S', 0, 0.0],
['BR-RF-DLLRF-01:MO:Const:OFS:S', 0, 0.0], # [dB]
['BR-RF-DLLRF-01:MO:Const:Raw-U:C0:S', 0, 0.0],
['BR-RF-DLLRF-01:MO:Const:Raw-U:C1:S', 0, 0.0],
['BR-RF-DLLRF-01:MO:Const:Raw-U:C2:S', 0, 0.0],
['BR-RF-DLLRF-01:MO:Const:Raw-U:C3:S', 0, 0.0],
['BR-RF-DLLRF-01:MO:Const:Raw-U:C4:S', 0, 0.0],
['BR-RF-DLLRF-01:FWDSSA1:Const:OFS:S', 0, 0.0],
['BR-RF-DLLRF-01:FWDSSA1:Const:OFS:S', 0, 0.0], # [dB]
['BR-RF-DLLRF-01:FWDSSA1:Const:Raw-U:C0:S', 0, 0.0],
['BR-RF-DLLRF-01:FWDSSA1:Const:Raw-U:C1:S', 0, 0.0],
['BR-RF-DLLRF-01:FWDSSA1:Const:Raw-U:C2:S', 0, 0.0],
Expand All @@ -261,61 +261,61 @@ def get_dict():
['BR-RF-DLLRF-01:FWDSSA1:Const:U-Raw:C2:S', 0, 0.0],
['BR-RF-DLLRF-01:FWDSSA1:Const:U-Raw:C3:S', 0, 0.0],
['BR-RF-DLLRF-01:FWDSSA1:Const:U-Raw:C4:S', 0, 0.0],
['BR-RF-DLLRF-01:REVSSA1:Const:OFS:S', 0, 0.0],
['BR-RF-DLLRF-01:REVSSA1:Const:OFS:S', 0, 0.0], # [dB]
['BR-RF-DLLRF-01:REVSSA1:Const:Raw-U:C0:S', 0, 0.0],
['BR-RF-DLLRF-01:REVSSA1:Const:Raw-U:C1:S', 0, 0.0],
['BR-RF-DLLRF-01:REVSSA1:Const:Raw-U:C2:S', 0, 0.0],
['BR-RF-DLLRF-01:REVSSA1:Const:Raw-U:C3:S', 0, 0.0],
['BR-RF-DLLRF-01:REVSSA1:Const:Raw-U:C4:S', 0, 0.0],
['BR-RF-DLLRF-01:CELL2:Const:OFS:S', 0, 0.0],
['BR-RF-DLLRF-01:CELL2:Const:OFS:S', 0, 0.0], # [dB]
['BR-RF-DLLRF-01:CELL2:Const:Raw-U:C0:S', 0, 0.0],
['BR-RF-DLLRF-01:CELL2:Const:Raw-U:C1:S', 0, 0.0],
['BR-RF-DLLRF-01:CELL2:Const:Raw-U:C2:S', 0, 0.0],
['BR-RF-DLLRF-01:CELL2:Const:Raw-U:C3:S', 0, 0.0],
['BR-RF-DLLRF-01:CELL2:Const:Raw-U:C4:S', 0, 0.0],
['BR-RF-DLLRF-01:CELL4:Const:OFS:S', 0, 0.0],
['BR-RF-DLLRF-01:CELL4:Const:OFS:S', 0, 0.0], # [dB]
['BR-RF-DLLRF-01:CELL4:Const:Raw-U:C0:S', 0, 0.0],
['BR-RF-DLLRF-01:CELL4:Const:Raw-U:C1:S', 0, 0.0],
['BR-RF-DLLRF-01:CELL4:Const:Raw-U:C2:S', 0, 0.0],
['BR-RF-DLLRF-01:CELL4:Const:Raw-U:C3:S', 0, 0.0],
['BR-RF-DLLRF-01:CELL4:Const:Raw-U:C4:S', 0, 0.0],
['BR-RF-DLLRF-01:CELL1:Const:OFS:S', 0, 0.0],
['BR-RF-DLLRF-01:CELL1:Const:OFS:S', 0, 0.0], # [dB]
['BR-RF-DLLRF-01:CELL1:Const:Raw-U:C0:S', 0, 0.0],
['BR-RF-DLLRF-01:CELL1:Const:Raw-U:C1:S', 0, 0.0],
['BR-RF-DLLRF-01:CELL1:Const:Raw-U:C2:S', 0, 0.0],
['BR-RF-DLLRF-01:CELL1:Const:Raw-U:C3:S', 0, 0.0],
['BR-RF-DLLRF-01:CELL1:Const:Raw-U:C4:S', 0, 0.0],
['BR-RF-DLLRF-01:CELL5:Const:OFS:S', 0, 0.0],
['BR-RF-DLLRF-01:CELL5:Const:OFS:S', 0, 0.0], # [dB]
['BR-RF-DLLRF-01:CELL5:Const:Raw-U:C0:S', 0, 0.0],
['BR-RF-DLLRF-01:CELL5:Const:Raw-U:C1:S', 0, 0.0],
['BR-RF-DLLRF-01:CELL5:Const:Raw-U:C2:S', 0, 0.0],
['BR-RF-DLLRF-01:CELL5:Const:Raw-U:C3:S', 0, 0.0],
['BR-RF-DLLRF-01:CELL5:Const:Raw-U:C4:S', 0, 0.0],
['BR-RF-DLLRF-01:INPRE:Const:OFS:S', 0, 0.0],
['BR-RF-DLLRF-01:INPRE:Const:OFS:S', 0, 0.0], # [dB]
['BR-RF-DLLRF-01:INPRE:Const:Raw-U:C0:S', 0, 0.0],
['BR-RF-DLLRF-01:INPRE:Const:Raw-U:C1:S', 0, 0.0],
['BR-RF-DLLRF-01:INPRE:Const:Raw-U:C2:S', 0, 0.0],
['BR-RF-DLLRF-01:INPRE:Const:Raw-U:C3:S', 0, 0.0],
['BR-RF-DLLRF-01:INPRE:Const:Raw-U:C4:S', 0, 0.0],
['BR-RF-DLLRF-01:FWDPRE:Const:OFS:S', 0, 0.0],
['BR-RF-DLLRF-01:FWDPRE:Const:OFS:S', 0, 0.0], # [dB]
['BR-RF-DLLRF-01:FWDPRE:Const:Raw-U:C0:S', 0, 0.0],
['BR-RF-DLLRF-01:FWDPRE:Const:Raw-U:C1:S', 0, 0.0],
['BR-RF-DLLRF-01:FWDPRE:Const:Raw-U:C2:S', 0, 0.0],
['BR-RF-DLLRF-01:FWDPRE:Const:Raw-U:C3:S', 0, 0.0],
['BR-RF-DLLRF-01:FWDPRE:Const:Raw-U:C4:S', 0, 0.0],
['BR-RF-DLLRF-01:REVPRE:Const:OFS:S', 0, 0.0],
['BR-RF-DLLRF-01:REVPRE:Const:OFS:S', 0, 0.0], # [dB]
['BR-RF-DLLRF-01:REVPRE:Const:Raw-U:C0:S', 0, 0.0],
['BR-RF-DLLRF-01:REVPRE:Const:Raw-U:C1:S', 0, 0.0],
['BR-RF-DLLRF-01:REVPRE:Const:Raw-U:C2:S', 0, 0.0],
['BR-RF-DLLRF-01:REVPRE:Const:Raw-U:C3:S', 0, 0.0],
['BR-RF-DLLRF-01:REVPRE:Const:Raw-U:C4:S', 0, 0.0],
['BR-RF-DLLRF-01:FWDCIRC:Const:OFS:S', 0, 0.0],
['BR-RF-DLLRF-01:FWDCIRC:Const:OFS:S', 0, 0.0], # [dB]
['BR-RF-DLLRF-01:FWDCIRC:Const:Raw-U:C0:S', 0, 0.0],
['BR-RF-DLLRF-01:FWDCIRC:Const:Raw-U:C1:S', 0, 0.0],
['BR-RF-DLLRF-01:FWDCIRC:Const:Raw-U:C2:S', 0, 0.0],
['BR-RF-DLLRF-01:FWDCIRC:Const:Raw-U:C3:S', 0, 0.0],
['BR-RF-DLLRF-01:FWDCIRC:Const:Raw-U:C4:S', 0, 0.0],
['BR-RF-DLLRF-01:REVCIRC:Const:OFS:S', 0, 0.0],
['BR-RF-DLLRF-01:REVCIRC:Const:OFS:S', 0, 0.0], # [dB]
['BR-RF-DLLRF-01:REVCIRC:Const:Raw-U:C0:S', 0, 0.0],
['BR-RF-DLLRF-01:REVCIRC:Const:Raw-U:C1:S', 0, 0.0],
['BR-RF-DLLRF-01:REVCIRC:Const:Raw-U:C2:S', 0, 0.0],
Expand Down Expand Up @@ -349,6 +349,33 @@ def get_dict():
['RA-RaBO01:RF-LLRF:Hw2AmpVCavCoeff2-SP', 0, 0.0],
['RA-RaBO01:RF-LLRF:Hw2AmpVCavCoeff3-SP', 0, 0.0],
['RA-RaBO01:RF-LLRF:Hw2AmpVCavCoeff4-SP', 0, 0.0],
# CalSys Offsets
['RA-RaBO01:RF-RFCalSys:OFSdB1-Mon', 0, 0.0], # [dB]
['RA-RaBO01:RF-RFCalSys:OFSdB2-Mon', 0, 0.0],
['RA-RaBO01:RF-RFCalSys:OFSdB3-Mon', 0, 0.0],
['RA-RaBO01:RF-RFCalSys:OFSdB4-Mon', 0, 0.0],
['RA-RaBO01:RF-RFCalSys:OFSdB5-Mon', 0, 0.0],
['RA-RaBO01:RF-RFCalSys:OFSdB6-Mon', 0, 0.0],
['RA-RaBO01:RF-RFCalSys:OFSdB7-Mon', 0, 0.0],
['RA-RaBO01:RF-RFCalSys:OFSdB8-Mon', 0, 0.0],
['RA-RaBO01:RF-RFCalSys:OFSdB9-Mon', 0, 0.0],
['RA-RaBO01:RF-RFCalSys:OFSdB10-Mon', 0, 0.0],
['RA-RaBO01:RF-RFCalSys:OFSdB11-Mon', 0, 0.0],
['RA-RaBO01:RF-RFCalSys:OFSdB12-Mon', 0, 0.0],
['RA-RaBO01:RF-RFCalSys:OFSdB13-Mon', 0, 0.0],
['RA-RaBO01:RF-RFCalSys:OFSdB14-Mon', 0, 0.0],
['RA-RaBO01:RF-RFCalSys:OFSdB15-Mon', 0, 0.0],
['RA-RaBO01:RF-RFCalSys:OFSdB16-Mon', 0, 0.0],
]


_pvs_bo_pow_sensor = [
#Keysight U2021xa Power Sensor config
['RA-RF:PowerSensor1:GainOffsetStat-Sel', 0, 0.0],
['RA-RF:PowerSensor1:GainOffset-SP', 0, 0.0],
['RA-RF:PowerSensor1:Egu-SP', 0, 0.0],
['RA-RF:PowerSensor1:TracTime-SP', 0, 0.0],
['RA-RF:PowerSensor1:Freq-SP', 0, 0.0],
]


Expand Down Expand Up @@ -510,15 +537,7 @@ def get_dict():
# ['RA-ToSIA01:OffsetConfig:UpperReflectedPower', 0, 0.0],
# ['RA-ToSIA01:OffsetConfig:LowerIncidentPower', 0, 0.0],
# ['RA-ToSIA01:OffsetConfig:LowerReflectedPower', 0, 0.0],
# ['RA-ToSIA01:OffsetConfig:InputIncidentPower', 0, 0.0],
# ['RA-ToSIA01:OffsetConfig:InputReflectedPower', 0, 0.0],
# ['RA-ToSIA01:OffsetConfig:OutputIncidentPower', 0, 0.0],
# ['RA-ToSIA01:OffsetConfig:OutputReflectedPower', 0, 0.0],
# SSA tower 1 pwr alarm limits
# ['RA-ToSIA01:AlarmConfig:GeneralPowerLimHiHi', 0, 0.0],
# ['RA-ToSIA01:AlarmConfig:GeneralPowerLimHigh', 0, 0.0],
# ['RA-ToSIA01:AlarmConfig:GeneralPowerLimLow', 0, 0.0],
# ['RA-ToSIA01:AlarmConfig:GeneralPowerLimLoLo', 0, 0.0],
# ['RA-ToSIA01:AlarmConfig:InnerPowerLimHiHi', 0, 0.0],
# ['RA-ToSIA01:AlarmConfig:InnerPowerLimHigh', 0, 0.0],
# ['RA-ToSIA01:AlarmConfig:InnerPowerLimLow', 0, 0.0],
Expand All @@ -533,15 +552,7 @@ def get_dict():
# ['RA-ToSIA02:OffsetConfig:UpperReflectedPower', 0, 0.0],
# ['RA-ToSIA02:OffsetConfig:LowerIncidentPower', 0, 0.0],
# ['RA-ToSIA02:OffsetConfig:LowerReflectedPower', 0, 0.0],
# ['RA-ToSIA02:OffsetConfig:InputIncidentPower', 0, 0.0],
# ['RA-ToSIA02:OffsetConfig:InputReflectedPower', 0, 0.0],
# ['RA-ToSIA02:OffsetConfig:OutputIncidentPower', 0, 0.0],
# ['RA-ToSIA02:OffsetConfig:OutputReflectedPower', 0, 0.0],
# SSA tower 2 pwr alarm limits
# ['RA-ToSIA02:AlarmConfig:GeneralPowerLimHiHi', 0, 0.0],
# ['RA-ToSIA02:AlarmConfig:GeneralPowerLimHigh', 0, 0.0],
# ['RA-ToSIA02:AlarmConfig:GeneralPowerLimLow', 0, 0.0],
# ['RA-ToSIA02:AlarmConfig:GeneralPowerLimLoLo', 0, 0.0],
# SSA tower 2 pwr alarm limits
# ['RA-ToSIA02:AlarmConfig:InnerPowerLimHiHi', 0, 0.0],
# ['RA-ToSIA02:AlarmConfig:InnerPowerLimHigh', 0, 0.0],
# ['RA-ToSIA02:AlarmConfig:InnerPowerLimLow', 0, 0.0],
Expand All @@ -551,6 +562,46 @@ def get_dict():
# ['RA-ToSIA02:AlarmConfig:CurrentLimHigh', 0, 0.0],
# ['RA-ToSIA02:AlarmConfig:CurrentLimLow', 0, 0.0],
# ['RA-ToSIA02:AlarmConfig:CurrentLimLoLo', 0, 0.0],
# SSA tower 3 offsets
['RA-ToSIA03:OffsetConfig:UpperIncidentPower', 0, 0.0],
['RA-ToSIA03:OffsetConfig:UpperReflectedPower', 0, 0.0],
['RA-ToSIA03:OffsetConfig:LowerIncidentPower', 0, 0.0],
['RA-ToSIA03:OffsetConfig:LowerReflectedPower', 0, 0.0],
# SSA tower 3 pwr alarm limits
['RA-ToSIA03:AlarmConfig:InnerPowerLimHiHi', 0, 0.0],
['RA-ToSIA03:AlarmConfig:InnerPowerLimHigh', 0, 0.0],
['RA-ToSIA03:AlarmConfig:InnerPowerLimLow', 0, 0.0],
['RA-ToSIA03:AlarmConfig:InnerPowerLimLoLo', 0, 0.0],
# SSA tower 3 current alarm limits
['RA-ToSIA03:AlarmConfig:CurrentLimHiHi', 0, 0.0],
['RA-ToSIA03:AlarmConfig:CurrentLimHigh', 0, 0.0],
['RA-ToSIA03:AlarmConfig:CurrentLimLow', 0, 0.0],
['RA-ToSIA03:AlarmConfig:CurrentLimLoLo', 0, 0.0],
# SSA tower 4 offsets
['RA-ToSIA04:OffsetConfig:UpperIncidentPower', 0, 0.0],
['RA-ToSIA04:OffsetConfig:UpperReflectedPower', 0, 0.0],
['RA-ToSIA04:OffsetConfig:LowerIncidentPower', 0, 0.0],
['RA-ToSIA04:OffsetConfig:LowerReflectedPower', 0, 0.0],
# SSA tower 4 pwr alarm limits
['RA-ToSIA04:AlarmConfig:InnerPowerLimHiHi', 0, 0.0],
['RA-ToSIA04:AlarmConfig:InnerPowerLimHigh', 0, 0.0],
['RA-ToSIA04:AlarmConfig:InnerPowerLimLow', 0, 0.0],
['RA-ToSIA04:AlarmConfig:InnerPowerLimLoLo', 0, 0.0],
# SSA tower 4 current alarm limits
['RA-ToSIA04:AlarmConfig:CurrentLimHiHi', 0, 0.0],
['RA-ToSIA04:AlarmConfig:CurrentLimHigh', 0, 0.0],
['RA-ToSIA04:AlarmConfig:CurrentLimLow', 0, 0.0],
['RA-ToSIA04:AlarmConfig:CurrentLimLoLo', 0, 0.0],
# SSA1 Pwr Cal Coeff
# ['RA-ToSIA01:RF-SSAmpTower:Hw2PwrFwdInCoeff-Cte', az, 0.0],
# ['RA-ToSIA01:RF-SSAmpTower:Hw2PwrRevInCoeff-Cte', az, 0.0],
# ['RA-ToSIA01:RF-SSAmpTower:Hw2PwrFwdOutCoeff-Cte', az, 0.0],
# ['RA-ToSIA01:RF-SSAmpTower:Hw2PwrRevOutCoeff-Cte', az, 0.0],
# SSA2 Pwr Cal Coeff
# ['RA-ToSIA02:RF-SSAmpTower:Hw2PwrFwdInCoeff-Cte', az, 0.0],
# ['RA-ToSIA02:RF-SSAmpTower:Hw2PwrRevInCoeff-Cte', az, 0.0],
# ['RA-ToSIA02:RF-SSAmpTower:Hw2PwrFwdOutCoeff-Cte', az, 0.0],
# ['RA-ToSIA02:RF-SSAmpTower:Hw2PwrRevOutCoeff-Cte', az, 0.0],
# SSA3 Pwr Cal Coeff
['RA-ToSIA03:RF-SSAmpTower:Hw2PwrFwdInCoeff-Cte', az, 0.0],
['RA-ToSIA03:RF-SSAmpTower:Hw2PwrRevInCoeff-Cte', az, 0.0],
Expand Down Expand Up @@ -714,12 +765,30 @@ def get_dict():
['RA-RaSIA01:RF-LLRF:AmpVCav2HwCoeff4-SP', 0, 0.0],
# Cavity Shunt impedance
['SI-02SB:RF-P7Cav:Rsh-SP', 0, 0.0], # [Ohm]
# CalSys Offsets
['RA-RaSIA01:RF-RFCalSys:OFSdB1-Mon', 0, 0.0], # [dB]
['RA-RaSIA01:RF-RFCalSys:OFSdB2-Mon', 0, 0.0],
['RA-RaSIA01:RF-RFCalSys:OFSdB3-Mon', 0, 0.0],
['RA-RaSIA01:RF-RFCalSys:OFSdB4-Mon', 0, 0.0],
['RA-RaSIA01:RF-RFCalSys:OFSdB5-Mon', 0, 0.0],
['RA-RaSIA01:RF-RFCalSys:OFSdB6-Mon', 0, 0.0],
['RA-RaSIA01:RF-RFCalSys:OFSdB7-Mon', 0, 0.0],
['RA-RaSIA01:RF-RFCalSys:OFSdB8-Mon', 0, 0.0],
['RA-RaSIA01:RF-RFCalSys:OFSdB9-Mon', 0, 0.0],
['RA-RaSIA01:RF-RFCalSys:OFSdB10-Mon', 0, 0.0],
['RA-RaSIA01:RF-RFCalSys:OFSdB11-Mon', 0, 0.0],
['RA-RaSIA01:RF-RFCalSys:OFSdB12-Mon', 0, 0.0],
['RA-RaSIA01:RF-RFCalSys:OFSdB13-Mon', 0, 0.0],
['RA-RaSIA01:RF-RFCalSys:OFSdB14-Mon', 0, 0.0],
['RA-RaSIA01:RF-RFCalSys:OFSdB15-Mon', 0, 0.0],
['RA-RaSIA01:RF-RFCalSys:OFSdB16-Mon', 0, 0.0],
]


_template_dict = {
'pvs':
_pvs_as_rf +
_pvs_li_llrf + _pvs_bo_llrf + _pvs_bo_rfssa + _pvs_bo_rfcal +
_pvs_as_rf + _pvs_li_llrf +
_pvs_bo_pow_sensor + _pvs_bo_llrf + _pvs_bo_rfssa + _pvs_bo_rfcal +
_pvs_si_llrf + _pvs_si_rfssa + _pvs_si_rfcav + _pvs_si_rfcal
}

3 changes: 2 additions & 1 deletion siriuspy/siriuspy/devices/bpm_fam.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,8 @@ def config_mturn_acquisition(
'adcswp': self._csbpm.AcqChan.ADCSwp,
'adc': self._csbpm.AcqChan.ADC,
}
acq_rate = dic.get(acq_rate.lower(), acq_rate)
if isinstance(acq_rate, str):
acq_rate = dic.get(acq_rate.lower())
if acq_rate not in self._csbpm.AcqChan:
raise ValueError(
str(acq_rate) + ' is not a valid acquisition rate.')
Expand Down
4 changes: 3 additions & 1 deletion siriuspy/siriuspy/devices/idff.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Insertion Devices Feedforward Devices."""
"""Insertion Device Feedforward Devices."""

from ..namesys import SiriusPVName as _SiriusPVName
from ..search import IDSearch as _IDSearch
Expand Down Expand Up @@ -155,6 +155,8 @@ def implement_setpoints(
self.calculate_setpoints(
pparameter_value=None,
kparameter_value=None)
else:
polarization, pparameter_value, kparameter_value = [None, ] * 3
if corrdevs is None:
corrdevs = self._devsch + self._devscv + self._devsqs
for pvname, value in setpoints.items():
Expand Down
13 changes: 8 additions & 5 deletions siriuspy/siriuspy/devices/ids.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Define Insertion Devices."""
"""Insertion Devices."""

import time as _time
import inspect as _inspect
Expand Down Expand Up @@ -609,7 +609,7 @@ def cmd_move(self, pparam=None, kparam=None, timeout=None):
timeout = max(timeout - (t1_ - t0_), 0)

# calc timeout
timeout = self._calc_move_timeout(None, None, timeout)
timeout = self.calc_move_timeout(pparam, kparam, timeout)

# wait for movement within timeout based on movement ETA
return self.wait_move_config(pparam, kparam, timeout)
Expand Down Expand Up @@ -649,7 +649,8 @@ def calc_move_eta(self, pparam_goal=None, kparam_goal=None):
if None not in (param_goal, param_val):
dparam = abs(param_goal - param_val)
dparam = 0 if dparam < param_tol else dparam
pparam_eta = IDBase._calc_move_eta_model(dparam, param_vel, param_acc)
pparam_eta = IDBase._calc_move_eta_model(
dparam, param_vel, param_acc)
else:
pparam_eta = 0.0

Expand All @@ -660,19 +661,22 @@ def calc_move_eta(self, pparam_goal=None, kparam_goal=None):
if None not in (param_goal, param_val):
dparam = abs(abs(param_goal) - abs(param_val)) # abs for DELTA
dparam = 0 if dparam < param_tol else dparam
kparam_eta = IDBase._calc_move_eta_model(dparam, param_vel, param_acc)
kparam_eta = IDBase._calc_move_eta_model(
dparam, param_vel, param_acc)
else:
kparam_eta = 0.0

return pparam_eta, kparam_eta

def calc_move_eta_composed(self, pparam_eta, kparam_eta):
"""."""
# model: here pparam and kparam as serial in time
eta = pparam_eta + kparam_eta
return eta

def calc_move_timeout(
self, pparam_goal=None, kparam_goal=None, timeout=None):
"""."""
# calc timeout
pparam_eta, kparam_eta = self.calc_move_eta(pparam_goal, kparam_goal)
eta = self.calc_move_eta_composed(pparam_eta, kparam_eta)
Expand Down Expand Up @@ -744,7 +748,6 @@ def _calc_move_eta_model(dparam, param_vel, param_acc=None):
return dtime_total



class APU(IDBase):
"""APU Insertion Device."""

Expand Down
Loading

0 comments on commit 21b3029

Please sign in to comment.