Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write area detectors to proposal directories #27

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions startup/00-base.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@ def _load(file):
# PersistentDict will create the directory if it does not exist
RE.md = PersistentDict(runengine_metadata_dir)

data_session = RE.md.get("data_session")
if data_session is None:
raise ValueError("Data session is None!")

cycle = '2023-3' # TODO: don't hardcode this

proposal_dir = f"/nsls2/data/chx/proposals/{cycle}/{data_session}"
Path(proposal_dir).mkdir(parents=True, exist_ok=True)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This Python process will never have permission to make directories here. You can assume the directory has been created.


# send ophyd debug log to the console
# import logging
#logging.getLogger('ophyd').setLevel('DEBUG')
Expand Down
32 changes: 16 additions & 16 deletions startup/20-area-detectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,8 +648,8 @@ def enable_plugins(det, plugin_names):
set_eiger_defaults(eiger500k_single)
# AD v3.3+ config:
eiger500k_single.cam.ensure_nonblocking()
eiger500k_single.file.write_path_template = '/nsls2/data/chx/assets/eiger500k/%Y/%m/%d/'
eiger500k_single.file.reg_root ='/nsls2/data/chx/assets/eiger500k/'
eiger500k_single.file.write_path_template = f'{proposal_dir}/assets/eiger500k/%Y/%m/%d/'
eiger500k_single.file.reg_root =f'{proposal_dir}/assets/eiger500k/'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you considered making it assets_dir? That would make it harder to accidentally write into the top-level proposals dir (where users have access to move and delete things).

except Exception:
print('eiger500k not configured...')
raise
Expand All @@ -664,8 +664,8 @@ def enable_plugins(det, plugin_names):
# Eiger 4M using internal trigger
eiger4m_single = EigerSingleTrigger_AD37_V2('XF:11IDB-ES{Det:Eig4M}',
name='eiger4m_single')
eiger4m_single.file.write_path_template = '/nsls2/data/chx/assets/eiger4m/%Y/%m/%d/'
eiger4m_single.file.reg_root ='/nsls2/data/chx/assets/eiger4m/'
eiger4m_single.file.write_path_template = f'{proposal_dir}/assets/eiger4m/%Y/%m/%d/'
eiger4m_single.file.reg_root =f'{proposal_dir}/assets/eiger4m/'
set_eiger_defaults(eiger4m_single)
# AD v3.3+ config:
eiger4m_single.cam.ensure_nonblocking()
Expand All @@ -674,22 +674,22 @@ def enable_plugins(det, plugin_names):
# Eiger 500K using fast trigger assembly
eiger500k = EigerFastTrigger('XF:11IDB-ES{Det:Eig500K}', name='eiger500k')
set_eiger_defaults(eiger500k)
eiger500k.file.write_path_template = '/nsls2/data/chx/assets/eiger500k/%Y/%m/%d/'
eiger500k.file.reg_root ='/nsls2/data/chx/assets/eiger500k/'
eiger500k.file.write_path_template = f'{proposal_dir}/assets/eiger500k/%Y/%m/%d/'
eiger500k.file.reg_root =f'{proposal_dir}/assets/eiger500k/'
except Exception:
print('eiger500k not configured...')

# Eiger 1M using fast trigger assembly
eiger1m = EigerFastTrigger('XF:11IDB-ES{Det:Eig1M}', name='eiger1m')
set_eiger_defaults(eiger1m)
eiger1m.file.write_path_template = '/nsls2/data/chx/assets/eiger1m/%Y/%m/%d/'
eiger1m.file.reg_root ='/nsls2/data/chx/assets/eiger1m/'
eiger1m.file.write_path_template = f'{proposal_dir}/assets/eiger1m/%Y/%m/%d/'
eiger1m.file.reg_root =f'{proposal_dir}/assets/eiger1m/'

# Eiger 4M using fast trigger assembly
eiger4m = EigerFastTrigger('XF:11IDB-ES{Det:Eig4M}', name='eiger4m')
set_eiger_defaults(eiger4m)
eiger4m.file.write_path_template = '/nsls2/data/chx/assets/eiger4m/%Y/%m/%d/'
eiger4m.file.reg_root ='/nsls2/data/chx/assets/eiger4m/'
eiger4m.file.write_path_template = f'{proposal_dir}/assets/eiger4m/%Y/%m/%d/'
eiger4m.file.reg_root =f'{proposal_dir}/assets/eiger4m/'

# setup manual eiger for 1d scans
# prototype
Expand All @@ -698,19 +698,19 @@ def enable_plugins(det, plugin_names):
# (only one key name should be used)
eiger4m_manual = EigerManualTrigger('XF:11IDB-ES{Det:Eig4M}', name='eiger4m_single')
set_eiger_defaults(eiger4m_manual)
eiger4m_manual.file.write_path_template = '/nsls2/data/chx/assets/eiger4m/%Y/%m/%d/'
eiger4m_manual.file.reg_root ='/nsls2/data/chx/assets/eiger4m/'
eiger4m_manual.file.write_path_template = f'{proposal_dir}/assets/eiger4m/%Y/%m/%d/'
eiger4m_manual.file.reg_root =f'{proposal_dir}/assets/eiger4m/'

eiger1m_manual = EigerManualTrigger('XF:11IDB-ES{Det:Eig1M}', name='eiger1m_single')
set_eiger_defaults(eiger1m_manual)
eiger1m_manual.file.write_path_template = '/nsls2/data/chx/assets/eiger1m/%Y/%m/%d/'
eiger1m_manual.file.reg_root ='/nsls2/data/chx/assets/eiger1m/'
eiger1m_manual.file.write_path_template = f'{proposal_dir}/assets/eiger1m/%Y/%m/%d/'
eiger1m_manual.file.reg_root =f'{proposal_dir}/assets/eiger1m/'

try:
eiger500k_manual = EigerManualTrigger('XF:11IDB-ES{Det:Eig500K}', name='eiger500k_single')
set_eiger_defaults(eiger500k_manual)
eiger500k_manual.file.write_path_template = '/nsls2/data/chx/assets/eiger500k/%Y/%m/%d/'
eiger500k_manual.file.reg_root ='/nsls2/data/chx/assets/eiger500k/'
eiger500k_manual.file.write_path_template = f'{proposal_dir}/assets/eiger500k/%Y/%m/%d/'
eiger500k_manual.file.reg_root =f'{proposal_dir}/assets/eiger500k/'
except Exception:
print('eiger500k not configured...')

Expand Down
Loading