-
Notifications
You must be signed in to change notification settings - Fork 0
Need to append extra info in sample/file name #428
Comments
I suggest we define a standard function to modify the sample title, with default of nothing. The user can replace the standard definition from a local This is wanted for data collection next week. |
Will also need a from instrument.devices import sample_title_handler
from instrument.devices import temperature_signal
def mySampleTitle(user_sample_name):
title = user_sample_name # the default setting
# title = f"{user_sample_name}_{temperature_signal.get()}"
return title
# register OUR function as the sample title function now
sample_title_handler.register(mySampleTitle)
# Use default handler as the sample title function now
# sample_title_handler.register() |
broader search ...
|
Also check for
|
Note there exists a
|
The
|
Let's head in a different direction than commit 4a98c67. Instead, create a custom EpicsSignal for the This way, the |
@jilavsky : Here's how it will work:
Example In [8]: def handler(title):
...: return f"USAXS sample: {title}"
...:
In [9]: handler("test")
Out[9]: 'USAXS sample: test'
In [10]: sample_title.set("Glassy Carbon")
I Mon-13:59:35 - self._handler: None
Out[10]: Status(obj=EpicsSampleNameDevice(read_pv='sky:UPTIME.DESC', name='sample_title', value='Air Blank', timestamp=1606161523.630438, auto_monitor=True, string=True, write_pv='sky:UPTIME.DESC', limits=False, put_complete=False), done=False, success=False)
In [11]: sample_title.get()
Out[11]: 'Glassy Carbon'
In [12]: sample_title.register_handler(handler)
D Mon-13:59:52 - Accepted Sample name handler function: handler
In [13]: sample_title.set("AF1410 steel")
I Mon-14:00:12 - self._handler: <function handler at 0x7f9bf53fe280>
Out[13]: Status(obj=EpicsSampleNameDevice(read_pv='sky:UPTIME.DESC', name='sample_title', value='USAXS sample: AF1410 steel', timestamp=1606161611.63044, auto_monitor=True, string=True, write_pv='sky:UPTIME.DESC', limits=False, put_complete=False), done=False, success=False)
In [14]: sample_title.register_handler(handler)
D Mon-14:00:14 - Accepted Sample name handler function: handler
In [15]: sample_title.get()
Out[15]: 'USAXS sample: AF1410 steel' |
The user would write this function in a local file and load it via |
We will need to append some information in the sample name. In this case, for example, sx or sy value. Before each run of a sample.
We will mount sample "Sample1" and append to it specific sx position where data will be collected.
We need to be able to change this code on fly, in spec it is done by redefining the function which does the work.
The text was updated successfully, but these errors were encountered: