Skip to content

Commit

Permalink
add wait=True to count_stream
Browse files Browse the repository at this point in the history
  • Loading branch information
XPD Operator committed Aug 30, 2024
1 parent bf3a73d commit bee5c37
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 16 deletions.
8 changes: 4 additions & 4 deletions scripts/_LDRD_Kafka.py
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ def macro_11_absorbance(self, stream_name):
## Apply percnetile filtering for absorption spectra, defaut percent_range = [15, 85]
abs_per = da.percentile_abs(self.qepro_dic['QEPro_x_axis'],
self.qepro_dic['QEPro_output'],
percent_range=[5, 65])
percent_range=[10, 70])

print(f'\n*** start to check absorbance at 365b nm in stream: {stream_name} is positive or not***\n')
# abs_array = qepro_dic['QEPro_output'][1:].mean(axis=0)
Expand Down Expand Up @@ -1056,10 +1056,10 @@ def macro_17_add_queue(self, stream_name, qserver_process, RM):
pump_list=qin.pump_list,
precursor_list=qin.precursor_list,
mixer=qin.mixer)
RM.item_add(scanplan, pos=1)
RM.item_add(scanplan, pos=0)

restplan = BPlan('sleep_sec_q', 5)
RM.item_add(restplan, pos=2)
restplan = BPlan('sleep_sec_q', 2)
RM.item_add(restplan, pos=0)

RM.queue_start()

Expand Down
2 changes: 1 addition & 1 deletion scripts/_synthesis_queue_RM.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def synthesis_queue_xlsx(parameter_obj):
#### Kafka check data here.

## 5. Sleep for 5 seconds for Kafak to check good/bad data
restplan = BPlan('sleep_sec_q', 5)
restplan = BPlan('sleep_sec_q', 2)
RM.item_add(restplan, pos=pos)


Expand Down
Binary file modified scripts/inputs_qserver_kafka_v2.xlsx
Binary file not shown.
20 changes: 9 additions & 11 deletions startup/31-flow_plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def count_stream(det, stream_name="primary", md=None):
@bpp.stage_decorator([det])
@bpp.run_decorator(md=md)
def _inner_count():
yield from bps.trigger(det)
yield from bps.trigger(det, wait=True)
yield from bps.create(name=stream_name)
reading = (yield from bps.read(det))
yield from bps.save()
Expand Down Expand Up @@ -261,28 +261,26 @@ def take_a_uvvis_csv_q(sample_type='test', plot=False, csv_path=None, data_agent

if spectrum_type == 'Absorbtion':
if LED.get()=='Low' and UV_shutter.get()=='High' and qepro.correction.get()==correction_type and qepro.spectrum_type.get()==spectrum_type:
uid = (yield from count([qepro], md=_md))
pass
else:
yield from bps.abs_set(qepro.correction, correction_type, wait=True)
yield from bps.abs_set(qepro.spectrum_type, spectrum_type, wait=True)
# yield from LED_off()
# yield from shutter_open()
yield from bps.mv(LED, 'Low', UV_shutter, 'High')
yield from bps.sleep(2)
uid = (yield from count_stream(qepro, stream_name="take_a_uvvis", md=_md))

yield from bps.sleep(2)
uid = (yield from count_stream(qepro, stream_name="take_a_uvvis", md=_md))


else:
if LED.get()=='High' and UV_shutter.get()=='Low' and qepro.correction.get()==correction_type and qepro.spectrum_type.get()==spectrum_type:
uid = (yield from count([qepro], md=_md))
pass
else:
yield from bps.abs_set(qepro.correction, correction_type, wait=True)
yield from bps.abs_set(qepro.spectrum_type, spectrum_type, wait=True)
# yield from shutter_close()
# yield from LED_on()
yield from bps.mv(LED, 'High', UV_shutter, 'Low')
yield from bps.sleep(2)
uid = (yield from count_stream(qepro, stream_name="take_a_uvvis", md=_md))

yield from bps.sleep(2)
uid = (yield from count_stream(qepro, stream_name="take_a_uvvis", md=_md))

yield from bps.mv(LED, 'Low', UV_shutter, 'Low')

Expand Down

0 comments on commit bee5c37

Please sign in to comment.