Skip to content

Commit 7fd4195

Browse files
committed
Update file write paths on all other detectors
1 parent 7b74a96 commit 7fd4195

File tree

2 files changed

+25
-21
lines changed

2 files changed

+25
-21
lines changed

startup/30-detectors.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ class MyDetector(SingleTrigger, AreaDetector):
152152
hdf5 = Cpt(
153153
HDF5PluginWithFileStore,
154154
suffix="HDF1:",
155-
write_path_template="/nsls2/data/esm/legacy/image_files/", # trailing slash!
156-
root="/nsls2/data/esm/legacy/",
155+
write_path_template=f"/nsls2/data/esm/proposals/{RE.md["cycle"]}/{RE.md["data_session"]}/assets/default/", # trailing slash!
156+
root=f"/nsls2/data/esm/proposals/{RE.md["cycle"]}/{RE.md["data_session"]}/assets/default/",
157157
)
158158

159159
def set_primary(self, n, value=None):
@@ -461,67 +461,67 @@ def collect_asset_docs(self) -> SyncOrAsyncIterator[Asset]:
461461
mbs = SpectrumAnalyzerFileStore("XF:21ID1-ES{A1Soft}", name="mbs")
462462

463463
Diag1_CamH = MyDetector("XF:21IDA-BI{Diag:1-Cam:H}", name="Diag1_CamH")
464-
Diag1_CamH.hdf5.write_path_template = "/nsls2/data/esm/legacy/image_files/cam01/"
464+
Diag1_CamH.hdf5.write_path_template = f"/nsls2/data/esm/proposals/{RE.md["cycle"]}/{RE.md["data_session"]}/assets/{Diag1_CamH.name}/"
465465

466466
#Diag1_CamV = MyDetector("XF:21IDA-BI{Diag:1-Cam:V}", name="Diag1_CamV")
467-
#Diag1_CamV.hdf5.write_path_template = "/nsls2/data/esm/legacy/image_files/cam02/"
467+
#Diag1_CamV.hdf5.write_path_template = f"/nsls2/data/esm/proposals/{RE.md["cycle"]}/{RE.md["data_session"]}/assets/{Diag1_CamV.name}/"
468468

469469
Lock23A_CamEA3_1 = MyDetector('XF:21IDD-BI{ES-Cam:3}', name='Lock23A_CamEA3_1')
470-
Lock23A_CamEA3_1.hdf5.write_path_template = '/nsls2/data/esm/legacy/image_files/cam03/'
470+
Lock23A_CamEA3_1.hdf5.write_path_template = f"/nsls2/data/esm/proposals/{RE.md["cycle"]}/{RE.md["data_session"]}/assets/{Lock23A_CamEA3_1.name}/"
471471

472472
#Lock23A_CamEA3_1 = MyDetector(
473473
# "XF:21IDD-BI{Lock2:3A-Cam:EA3_1}", name="Lock23A_CamEA3_1"
474474
#)
475-
#Lock23A_CamEA3_1.hdf5.write_path_template = "/nsls2/data/esm/legacy/image_files/cam03/"
475+
#Lock23A_CamEA3_1.hdf5.write_path_template = f"/nsls2/data/esm/proposals/{RE.md["cycle"]}/{RE.md["data_session"]}/assets/{Lock23A_CamEA3_1.name}/"
476476

477477

478478
#Lock14A_CamEA4_1 = MyDetector(
479479
# "XF:21IDD-BI{Lock1:4A-Cam:EA4_1}", name="Lock14A_CamEA4_1"
480480
#)
481-
#Lock14A_CamEA4_1.hdf5.write_path_template = "/nsls2/data/esm/legacy/image_files/cam04/"
481+
#Lock14A_CamEA4_1.hdf5.write_path_template = f"/nsls2/data/esm/proposals/{RE.md["cycle"]}/{RE.md["data_session"]}/assets/{Lock14A_CamEA4_1.name}/"
482482

483483
#Prep2A_CamEA2_1 = MyDetector("XF:21IDD-BI{Prep:2A-Cam:EA2_1}", name="Prep2A_CamEA2_1")
484-
#Prep2A_CamEA2_1.hdf5.write_path_template = "/nsls2/data/esm/legacy/image_files/cam05/"
484+
#Prep2A_CamEA2_1.hdf5.write_path_template = f"/nsls2/data/esm/proposals/{RE.md["cycle"]}/{RE.md["data_session"]}/assets/{Prep2A_CamEA2_1.name}/"
485485

486486
Mir3_Cam10_U_1 = MyDetector("XF:21IDB-BI{Mir:3-Cam:6}", name="Mir3_Cam10_U_1")
487-
Mir3_Cam10_U_1.hdf5.write_path_template = "/nsls2/data/esm/legacy/image_files/cam06/"
487+
Mir3_Cam10_U_1.hdf5.write_path_template = f"/nsls2/data/esm/proposals/{RE.md["cycle"]}/{RE.md["data_session"]}/assets/{Mir3_Cam10_U_1.name}/"
488488

489489

490490
# BC1_Diag1_U_1 = MyDetector('XF:21IDA-BI{BC:1-Diag:1_U_1}', name='BC1_Diag1_U_1')
491-
# BC1_Diag1_U_1.hdf5.write_path_template = '/nsls2/data/esm/legacy/image_files/cam07/'
491+
# BC1_Diag1_U_1.hdf5.write_path_template = f"/nsls2/data/esm/proposals/{RE.md["cycle"]}/{RE.md["data_session"]}/assets/{BC1_Diag1_U_1.name}/"
492492

493493
#Anal1A_Camlens = MyDetector("XF:21IDD-BI{Anal:1A-Cam:lens}", name="Anal1A_Camlens")
494-
#Anal1A_Camlens.hdf5.write_path_template = "/nsls2/data/esm/legacy/image_files/cam07/"
494+
#Anal1A_Camlens.hdf5.write_path_template = f"/nsls2/data/esm/proposals/{RE.md["cycle"]}/{RE.md["data_session"]}/assets/{Anal1A_Camlens.name}/"
495495

496496
#Anal1A_Cambeam = MyDetector("XF:21IDD-BI{Anal:1A-Cam:beam}", name="Anal1A_Cambeam")
497-
#Anal1A_Cambeam.hdf5.write_path_template = "/nsls2/data/esm/legacy/image_files/cam08/"
497+
#Anal1A_Cambeam.hdf5.write_path_template = f"/nsls2/data/esm/proposals/{RE.md["cycle"]}/{RE.md["data_session"]}/assets/{Anal1A_Cambeam.name}/"
498498

499499
Prep2A_CamLEED = MyDetector("XF:21IDD-BI{ES-Cam:9}", name="Prep2A_CamLEED")
500-
Prep2A_CamLEED.hdf5.write_path_template = "/nsls2/data/esm/legacy/image_files/cam09/"
500+
Prep2A_CamLEED.hdf5.write_path_template = f"/nsls2/data/esm/proposals/{RE.md["cycle"]}/{RE.md["data_session"]}/assets/{Prep2A_CamLEED.name}/"
501501

502502
#Prep2A_Camevap1 = MyDetector("XF:21IDD-BI{Prep:2A-Cam:evap1}", name="Prep2A_Camevap1")
503-
#Prep2A_Camevap1.hdf5.write_path_template = "/nsls2/data/esm/legacy/image_files/cam10/"
503+
#Prep2A_Camevap1.hdf5.write_path_template = f"/nsls2/data/esm/proposals/{RE.md["cycle"]}/{RE.md["data_session"]}/assets/{Prep2A_Camevap1.name}/"
504504

505505
#Prep2A_Camevap2 = MyDetector("XF:21IDD-BI{Prep:2A-Cam:evap2}", name="Prep2A_Camevap2")
506-
#Prep2A_Camevap2.hdf5.write_path_template = "/nsls2/data/esm/legacy/image_files/cam11/"
506+
#Prep2A_Camevap2.hdf5.write_path_template = f"/nsls2/data/esm/proposals/{RE.md["cycle"]}/{RE.md["data_session"]}/assets/{Prep2A_Camevap2.name}/"
507507

508508
LOWT_5A_Cam1 = MyDetector("XF:21IDD-OP{ES-Cam:16}", name="LOWT_5A_Cam1")
509-
LOWT_5A_Cam1.hdf5.write_path_template = "/nsls2/data/esm/legacy/image_files/cam14/"
509+
LOWT_5A_Cam1.hdf5.write_path_template = f"/nsls2/data/esm/proposals/{RE.md["cycle"]}/{RE.md["data_session"]}/assets/{LOWT_5A_Cam1.name}/"
510510

511511
#LOWT_5A_Cam2 = MyDetector("XF:21IDD-OP{LOWT:5A-Cam:2}", name="LOWT_5A_Cam2")
512-
#LOWT_5A_Cam2.hdf5.write_path_template = "/nsls2/data/esm/legacy/image_files/cam15/"
512+
#LOWT_5A_Cam2.hdf5.write_path_template = f"/nsls2/data/esm/proposals/{RE.md["cycle"]}/{RE.md["data_session"]}/assets/{LOWT_5A_Cam2.name}/"
513513

514514
#BTA2_Cam1 = MyDetector("XF:21IDD-OP{BT:A2-Cam:1}", name="BTA2_Cam1")
515-
#BTA2_Cam1.hdf5.write_path_template = "/nsls2/data/esm/legacy/image_files/cam16/"
515+
#BTA2_Cam1.hdf5.write_path_template = f"/nsls2/data/esm/proposals/{RE.md["cycle"]}/{RE.md["data_session"]}/assets/{BTA2_Cam1.name}/"
516516

517517
#BTB2_Cam1 = MyDetector("XF:21IDD-OP{BT:B2-Cam:1}", name="B2BT_Cam1")
518-
#BTB2_Cam1.hdf5.write_path_template = "/nsls2/data/esm/legacy/image_files/cam17/"
518+
#BTB2_Cam1.hdf5.write_path_template = f"/nsls2/data/esm/proposals/{RE.md["cycle"]}/{RE.md["data_session"]}/assets/{BTB2_Cam1.name}/"
519519

520520
#PEEM1B_Cam1 = MyDetector("XF:21IDD-OP{PEEM:1B-Cam:1}", name="PEEM1B_Cam1")
521-
#PEEM1B_Cam1.hdf5.write_path_template = "/nsls2/data/esm/legacy/image_files/cam18/"
521+
#PEEM1B_Cam1.hdf5.write_path_template = f"/nsls2/data/esm/proposals/{RE.md["cycle"]}/{RE.md["data_session"]}/assets/{PEEM1B_Cam1.name}/"
522522

523523
#BTB5_Cam1 = MyDetector("XF:21IDD-OP{BT:B5-Cam:1}", name="BTB5_Cam1")
524-
#BTB5_Cam1.hdf5.write_path_template = "/nsls2/xf21id/image_files/cam19/"
524+
#BTB5_Cam1.hdf5.write_path_template = f"/nsls2/data/esm/proposals/{RE.md["cycle"]}/{RE.md["data_session"]}/assets/{BTB5_Cam1.name}/"
525525

526526
all_standard_pros = [
527527
Diag1_CamH,

startup/46-ESM_LEEM.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ class LEEMDetector(Device):
1717
# On a background thread, listen for the server's response.
1818
# self.st = None
1919

20+
def stage(self):
21+
self.filepath.set(f"/nsls2/data3/esm/proposals/{RE.md["cycle"]}/{RE.md["data_session"]}/assets/{self.name}/")
22+
return super().stage()
23+
2024
def trigger(self):
2125
init = 0
2226
status = DeviceStatus(self)

0 commit comments

Comments
 (0)