Skip to content

Commit

Permalink
Merge branch 'dev' into ENH/pydantic_v2
Browse files Browse the repository at this point in the history
  • Loading branch information
gadorlhiac committed Dec 5, 2024
2 parents 6c7d210 + ccd4ced commit f7f443f
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 3 deletions.
17 changes: 17 additions & 0 deletions config/mfx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,23 @@ SubmitSMD:
#detnames: []
#epicsPV: []
#ttCalib: []
# Provide detector image sum algorithms.
# If detSumAlgos is not defined, it will default to calib, calib_dropped and
# calib_dropped_square for every detector. You can add processing algorithms for
# single detectors (e.g. epix10k2M or Rayonix) as below, or add algorithms which
# will apply to every detector defined in detnames by placing them under "all"
#detSumAlgos:
# all:
# - "calib"
# - "calib_dropped"
# - "calib_dropped_square"
# - "calib_thresADU1"
# epix10k2M:
# - "calib_thresADU5"
# - "calib_max"
# Rayonix:
# - "calib_skipFirst_thresADU1"
# - "calib_skipFirst_max"
#getROIs:
# jungfrau1M: # Change to detector name
# ROIs: [[[1, 2], [157, 487], [294, 598]]]
Expand Down
22 changes: 20 additions & 2 deletions config/templates/smd_producer_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,24 @@ def define_dets(run):
if detname in svd:
det.addFunc(svdFit(**svd[detname]))

{%- if detSumAlgos is defined %}
{%- for detector, det_algos in detSumAlgos.items() %}
{%- if detector == "all" %}
{%- for algo in det_algos %}
det.storeSum(sumAlgo='{{ algo }}')
{% endfor %}
{% else %}
if detname.find("{{ detector }}") >= 0:
{% for algo in det_algos %}
det.storeSum(sumAlgo='{{ algo }}')
{% endfor %}
{% endif %}
{% endfor %}
{% else %}
det.storeSum(sumAlgo='calib')
det.storeSum(sumAlgo='calib_dropped')
det.storeSum(sumAlgo='calib_dropped_square')
{% endif %}
#det.storeSum(sumAlgo='calib_img')
dets.append(det)
return dets
Expand Down Expand Up @@ -985,7 +1002,7 @@ def get_sd_file(write_dir, exp, hutch):
dets_time_end = (end_setup_dets-start_job)/60
evt_time_start = (start_evt_loop-start_job)/60
evt_time_end = (end_evt_loop-start_job)/60
logger.debug(f"##### Timing benchmarks core {ds.rank}: ##### """)
logger.debug(f"##### Timing benchmarks core {ds.rank}: #####")
logger.debug(f'Setup dets: \n\tStart: {dets_time_start:.2f} min\n\tEnd: {dets_time_end:.2f} min')
logger.debug(f'\tDuration:{dets_time_end-dets_time_start:.2f}')
logger.debug(f'Event loop: \n\tStart: {evt_time_start:.2f} min\n\tEnd: {evt_time_end:.2f} min')
Expand All @@ -1001,6 +1018,7 @@ def get_sd_file(write_dir, exp, hutch):
#finishing up here....
logger.debug('rank {0} on {1} is finished'.format(ds.rank, hostname))
small_data.save()
small_data.close()
if os.environ.get('ARP_JOB_ID', None) is not None:
if ds.size > 1:
if ds.rank == 0:
Expand Down Expand Up @@ -1036,7 +1054,7 @@ def get_sd_file(write_dir, exp, hutch):
else:
with open('/cds/home/opr/%s/forElogPost.txt'%user,'r') as reader:
answer = reader.readline()
r = requests.post(ws_url, params={"run_num": args.run}, json=runtable_data,
r = requests.post(ws_url, params={"run_num": args.run}, json=runtable_data,
auth=HTTPBasicAuth(args.experiment[:3]+'opr', answer[:-1]))
print(r)
if det_presence!={}:
Expand Down
17 changes: 17 additions & 0 deletions config/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,23 @@ SubmitSMD:
#detnames: []
#epicsPV: []
#ttCalib: []
# Provide detector image sum algorithms.
# If detSumAlgos is not defined, it will default to calib, calib_dropped and
# calib_dropped_square for every detector. You can add processing algorithms for
# single detectors (e.g. epix10k2M or Rayonix) as below, or add algorithms which
# will apply to every detector defined in detnames by placing them under "all"
#detSumAlgos:
# all:
# - "calib"
# - "calib_dropped"
# - "calib_dropped_square"
# - "calib_thresADU1"
# epix10k2M:
# - "calib_thresADU5"
# - "calib_max"
# Rayonix:
# - "calib_skipFirst_thresADU1"
# - "calib_skipFirst_max"
#getROIs:
# jungfrau1M: # Change to detector name
# ROIs: [[[1, 2], [157, 487], [294, 598]]]
Expand Down
17 changes: 17 additions & 0 deletions config/xcs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,23 @@ SubmitSMD:
#detnames: []
#epicsPV: []
#ttCalib: []
# Provide detector image sum algorithms.
# If detSumAlgos is not defined, it will default to calib, calib_dropped and
# calib_dropped_square for every detector. You can add processing algorithms for
# single detectors (e.g. epix10k2M or Rayonix) as below, or add algorithms which
# will apply to every detector defined in detnames by placing them under "all"
#detSumAlgos:
# all:
# - "calib"
# - "calib_dropped"
# - "calib_dropped_square"
# - "calib_thresADU1"
# epix10k2M:
# - "calib_thresADU5"
# - "calib_max"
# Rayonix:
# - "calib_skipFirst_thresADU1"
# - "calib_skipFirst_max"
#getROIs:
# jungfrau1M: # Change to detector name
# ROIs: [[[1, 2], [157, 487], [294, 598]]]
Expand Down
17 changes: 17 additions & 0 deletions config/xpp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,23 @@ SubmitSMD:
#detnames: []
#epicsPV: []
#ttCalib: []
# Provide detector image sum algorithms.
# If detSumAlgos is not defined, it will default to calib, calib_dropped and
# calib_dropped_square for every detector. You can add processing algorithms for
# single detectors (e.g. epix10k2M or Rayonix) as below, or add algorithms which
# will apply to every detector defined in detnames by placing them under "all"
#detSumAlgos:
# all:
# - "calib"
# - "calib_dropped"
# - "calib_dropped_square"
# - "calib_thresADU1"
# epix10k2M:
# - "calib_thresADU5"
# - "calib_max"
# Rayonix:
# - "calib_skipFirst_thresADU1"
# - "calib_skipFirst_max"
#getROIs:
# jungfrau1M: # Change to detector name
# ROIs: [[[1, 2], [157, 487], [294, 598]]]
Expand Down
2 changes: 1 addition & 1 deletion utilities/src/dbview/dbview.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def pull_table_data(self, table: DataTable) -> DataTable:
return table

def action_toggle_dark(self) -> None:
self.dark = not self.dark
self.dark: bool = not self.dark


if __name__ == "__main__":
Expand Down

0 comments on commit f7f443f

Please sign in to comment.