chopper phases defaults, e2h_2025

This commit is contained in:
2025-06-08 15:50:08 +02:00
parent bbac3bc943
commit 6102ed7123
5 changed files with 26 additions and 29 deletions

View File

@@ -144,8 +144,7 @@ class Meta:
year_date = str(datetime.today()).split(' ')[0].replace("-", "/", 1)
# deside from where to take the control paralemters
#try:
if True:
try:
self.mu = float(np.take(fh['/entry1/Amor/instrument_control_parameters/mu'], 0))
self.nu = float(np.take(fh['/entry1/Amor/instrument_control_parameters/nu'], 0))
self.kap = float(np.take(fh['/entry1/Amor/instrument_control_parameters/kap'], 0))
@@ -155,26 +154,26 @@ class Meta:
chopperPhase = float(np.take(fh['/entry1/Amor/chopper/phase'], 0))
ch1TriggerPhase = float(np.take(fh['/entry1/Amor/chopper/ch1_trigger_phase'], 0))
polarizationConfigLabel = float(np.take(fh['/entry1/Amor/polarization/configuration/value'], 0))
#except (KeyError, IndexError):
# logging.warning(f" using parameters from nicos cache")
# cachePath = '/home/amor/cache/'
# value = str(subprocess.getoutput('/usr/bin/grep "value" '+cachePath+'nicos-mu/'+year_date)).split('\t')[-1]
# self.mu = float(value)
# value = str(subprocess.getoutput('/usr/bin/grep "value" '+cachePath+'nicos-nu/'+year_date)).split('\t')[-1]
# self.nu = float(value)
# value = str(subprocess.getoutput('/usr/bin/grep "value" '+cachePath+'nicos-kap/'+year_date)).split('\t')[-1]
# self.kap = float(value)
# value = str(subprocess.getoutput('/usr/bin/grep "value" '+cachePath+'nicos-kad/'+year_date)).split('\t')[-1]
# self.kad = float(value)
# value = str(subprocess.getoutput('/usr/bin/grep "value" '+cachePath+'nicos-div/'+year_date)).split('\t')[-1]
# self.div = float(value)
# value = str(subprocess.getoutput('/usr/bin/grep "value" '+cachePath+'nicos-ch1_speed/'+year_date)).split('\t')[-1]
# chopperSpeed = float(value)
# value = str(subprocess.getoutput('/usr/bin/grep "value" '+cachePath+'nicos-chopper_speed'+year_date)).split('\t')[-1]
# chopperPhase = float(value)
# value = str(subprocess.getoutput('/usr/bin/grep "value" '+cachePath+'nicos-chopper_phase'+year_date)).split('\t')[-1]
# ch1TriggerPhase = float(value)
# value = str(subprocess.getoutput('/usr/bin/grep "value" '+cachePath+'nicos-ch1_trigger_phase'+year_date)).split('\t')[-1]
except (KeyError, IndexError):
logging.warning(f" using parameters from nicos cache")
cachePath = '/home/amor/cache/'
value = str(subprocess.getoutput('/usr/bin/grep "value" '+cachePath+'nicos-mu/'+year_date)).split('\t')[-1]
self.mu = float(value)
value = str(subprocess.getoutput('/usr/bin/grep "value" '+cachePath+'nicos-nu/'+year_date)).split('\t')[-1]
self.nu = float(value)
value = str(subprocess.getoutput('/usr/bin/grep "value" '+cachePath+'nicos-kap/'+year_date)).split('\t')[-1]
self.kap = float(value)
value = str(subprocess.getoutput('/usr/bin/grep "value" '+cachePath+'nicos-kad/'+year_date)).split('\t')[-1]
self.kad = float(value)
value = str(subprocess.getoutput('/usr/bin/grep "value" '+cachePath+'nicos-div/'+year_date)).split('\t')[-1]
self.div = float(value)
value = str(subprocess.getoutput('/usr/bin/grep "value" '+cachePath+'nicos-ch1_speed/'+year_date)).split('\t')[-1]
chopperSpeed = float(value)
value = str(subprocess.getoutput('/usr/bin/grep "value" '+cachePath+'nicos-chopper_speed'+year_date)).split('\t')[-1]
chopperPhase = float(value)
value = str(subprocess.getoutput('/usr/bin/grep "value" '+cachePath+'nicos-chopper_phase'+year_date)).split('\t')[-1]
ch1TriggerPhase = float(value)
value = str(subprocess.getoutput('/usr/bin/grep "value" '+cachePath+'nicos-ch1_trigger_phase'+year_date)).split('\t')[-1]
self.tau = 30. / chopperSpeed

View File

@@ -3,5 +3,5 @@ Package to handle data redction at AMOR instrument to be used by eos.py script.
"""
__version__ = '3.0.0'
__date__ = '2025-05-28'
__date__ = '2025-06-08'

View File

@@ -185,6 +185,7 @@ def command_line_options():
)
experiment_config = ExperimentConfig(
sampleModel = clas.sampleModel,
chopperSpeed = clas.chopperSpeed,
chopperPhase = clas.chopperPhase,
chopperPhaseOffset = clas.chopperPhaseOffset,
yRange = clas.yRange,

View File

@@ -378,8 +378,7 @@ class AmorData:
try:
self.mu = float(np.take(self.hdf['/entry1/Amor/instrument_control_parameters/mu'], 0))
self.nu = float(np.take(self.hdf['/entry1/Amor/instrument_control_parameters/nu'], 0))
self.kap = 0.245
#self.kap = float(np.take(self.hdf['/entry1/Amor/instrument_control_parameters/kap/value'], 0))
self.kap = float(np.take(self.hdf['/entry1/Amor/instrument_control_parameters/kap'], 0))
self.kad = float(np.take(self.hdf['/entry1/Amor/instrument_control_parameters/kad'], 0))
self.div = float(np.take(self.hdf['/entry1/Amor/instrument_control_parameters/div'], 0))
self.chopperSpeed = float(np.take(self.hdf['/entry1/Amor/chopper/rotation_speed'], 0))
@@ -393,8 +392,6 @@ class AmorData:
logging.warning(" using parameters from nicos cache")
year_date = str(self.start_date).replace('-', '/', 1)
# TODO: check new cache pathes
#cachePath = '/home/amor/nicosdata/amor/cache/'
#cachePath = '/home/nicos/amorcache/'
cachePath = '/home/amor/cache/'
value = str(subprocess.getoutput(f'/usr/bin/grep "value" {cachePath}nicos-mu/{year_date}')).split('\t')[-1]
self.mu = float(value)

View File

@@ -31,8 +31,8 @@ class Defaults:
yRange = [11, 41]
qzRange = [0.005, 0.30]
chopperSpeed = 500
chopperPhase = -13.5
chopperPhaseOffset = 7
chopperPhase = 0.0
chopperPhaseOffset = -9.1
muOffset = 0
mu = 0
nu = 0