def scan_orca_header(df_row): f_daq = dg.daq_dir + df_row['daq_dir'] + '/' + df_row['daq_file'] daq_gb = os.path.getsize(f_daq) / 1e9 if not os.path.exists(f_daq) and not df_row.skip: print(f"Error, file doesn't exist:\n {f_daq}") exit() elif df_row['skip'] == True: print(f"Skipping cycle: {df_row['cycle']}") return pd.Series({ 'startTime': np.nan, 'threshold': np.nan, 'daq_gb': daq_gb }) else: _, _, header_dict = parse_header(f_daq) # pprint(header_dict) info = header_dict['ObjectInfo'] t_start = info['DataChain'][0]['Run Control']['startTime'] thresh = info['Crates'][0]['Cards'][1]['thresholds'][2] return pd.Series({ 'startTime': t_start, 'threshold': thresh, 'daq_gb': daq_gb })
def scan_orca_header(df_row): f_daq = dg.daq_dir + df_row['daq_dir'] + '/' + df_row['daq_file'] _,_, header_dict = parse_header(f_daq) # pprint(header_dict) info = header_dict['ObjectInfo'] t_start = info['DataChain'][0]['Run Control']['startTime'] thresh = info['Crates'][0]['Cards'][1]['thresholds'][2] return pd.Series({'startTime':t_start, 'threshold':thresh})