Added stuff, renamed xrd_you to xrd in eco
This commit is contained in:
@@ -229,7 +229,7 @@ namespace.append_obj(
|
||||
Id="SARES21-XRD",
|
||||
configuration=config_berninamesp["xrd_config"],
|
||||
diff_detector={"jf_id": "JF01T03V01"},
|
||||
name="xrd_you",
|
||||
name="xrd",
|
||||
lazy=True,
|
||||
)
|
||||
|
||||
|
||||
+11
-5
@@ -16,7 +16,9 @@ class DataApi:
|
||||
if add_to_cnf:
|
||||
ecocnf.archiver = self
|
||||
|
||||
def get_data_time_range(self, channels=[], start=None, end=None, plot=False):
|
||||
def get_data_time_range(
|
||||
self, channels=[], start=None, end=None, plot=False, **kwargs
|
||||
):
|
||||
if not end:
|
||||
end = datetime.datetime.now()
|
||||
if isinstance(start, datetime.timedelta):
|
||||
@@ -27,6 +29,9 @@ class DataApi:
|
||||
elif isinstance(start, Number):
|
||||
start = datetime.timedelta(seconds=start)
|
||||
start = end + start
|
||||
else:
|
||||
start = datetime.timedelta(**kwargs)
|
||||
start = end + start
|
||||
|
||||
data = get_data(channels, start=start, end=end, range_type="time")
|
||||
if plot:
|
||||
@@ -36,10 +41,11 @@ class DataApi:
|
||||
x = data.index[sel]
|
||||
y = data[chan][sel]
|
||||
ah.step(x, y, ".-", label=chan, where="post")
|
||||
plt.xticks(rotation=30)
|
||||
plt.legend()
|
||||
plt.tight_layout()
|
||||
plt.xlabel(data.index.name)
|
||||
plt.xticks(rotation=30)
|
||||
plt.legend()
|
||||
plt.tight_layout()
|
||||
plt.xlabel(data.index.name)
|
||||
ah.figure.tight_layout()
|
||||
return data
|
||||
|
||||
def get_data_pulse_id_range(self, channels=[], start=None, end=None, plot=False):
|
||||
|
||||
@@ -105,14 +105,19 @@ class GPS(Assembly):
|
||||
)
|
||||
|
||||
self._append(
|
||||
MotorRecord, pvname + ":MOT_MY_RYTH", name="alpha", is_setting=True
|
||||
MotorRecord, pvname + ":MOT_NY_RY2TH", name="nu", is_setting=True
|
||||
)
|
||||
self._append(
|
||||
MotorRecord, pvname + ":MOT_NY_RY2TH", name="gamma", is_setting=False, is_status=False,
|
||||
)
|
||||
self._append(
|
||||
MotorRecord, pvname + ":MOT_MY_RYTH", name="mu", is_setting=True
|
||||
)
|
||||
self._append(
|
||||
MotorRecord, pvname + ":MOT_MY_RYTH", name="alpha", is_setting=False, is_status=False,
|
||||
)
|
||||
self.set_base_off = DeltaTauCurrOff("SARES22-GPS:asyn2.AOUT")
|
||||
|
||||
### motors XRD detector arm ###
|
||||
self._append(
|
||||
MotorRecord, pvname + ":MOT_NY_RY2TH", name="gamma", is_setting=True
|
||||
)
|
||||
|
||||
if "phi_table" in self.configuration:
|
||||
### motors phi table ###
|
||||
|
||||
@@ -2,14 +2,16 @@ from eco import ecocnf
|
||||
|
||||
|
||||
def get_from_archive(Obj, attribute_name="pvname"):
|
||||
def get_archiver_time_range(self, start=None, end=None, plot=True):
|
||||
def get_archiver_time_range(self, start=None, end=None, plot=True, **kwargs):
|
||||
"""Try to retrieve data within timerange from archiver. A time delta from now is assumed if end time is missing."""
|
||||
channelname = self.__dict__[attribute_name]
|
||||
return ecocnf.archiver.get_data_time_range(
|
||||
channels=[channelname], start=start, end=end, plot=plot
|
||||
channels=[channelname],
|
||||
start=start,
|
||||
end=end,
|
||||
plot=plot,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
Obj.get_archiver_time_range = get_archiver_time_range
|
||||
return Obj
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user