Skip to content

Commit

Permalink
add run ranges and special ledcal
Browse files Browse the repository at this point in the history
  • Loading branch information
cfuselli committed Oct 23, 2024
1 parent 0f64bb5 commit 4ac1459
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions amstrax/auto_processing_new/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ def __init__(self, args):
self.setup_amstrax()
self.setup_production()
self.run_doc = self.db_utils.get_run_doc(self.run_id)
self.infer_special_modes()


def setup_amstrax(self):

Expand Down Expand Up @@ -70,23 +68,25 @@ def get_run_doc_info(self):
log.info(f" *** Comments: {self.run_doc.get('comments')}")
log.info(f" *** Tags: {self.run_doc.get('tags')}")

def infer_special_modes(self):
def infer_special_modes(self, st):

# Check if there is led in the run_doc
if "ledcalibration" in self.run_doc.get('mode'):
# Add the LEDCalibration plugin to the context
log.info("Detected LED calibration run.")
log.info("Adding LEDCalibration plugin to the context.")
ax = self.amstrax
self.st.register([
st.register([
ax.DAQReader,
ax.RecordsLED,
ax.LEDCalibration
])

# override the targets to process only the LEDCalibration
self.targets = ["raw_records", "records_led", "led_calibration"]
log.info(f"Overriding targets to {self.targets}")

return st

def setup_production(self):

Expand Down Expand Up @@ -228,6 +228,8 @@ def process_remaining_targets(self):
)
st.storage += [strax.DataDirectory(raw_records_folder, readonly=True)]

st = self.infer_special_modes(st)

self.st = st

try:
Expand Down

0 comments on commit 4ac1459

Please sign in to comment.