Skip to content

Commit

Permalink
clean up degeneracy; print statements added for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
sanahabhimani committed Jan 4, 2024
1 parent 494640c commit 5ba69c2
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions python/hk/getdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -845,25 +845,27 @@ def load_range(start, stop, fields=None, alias=None,

hksc = HKArchiveScanner(pre_proc_dir=pre_proc_dir)

node_options = ['satp1', 'satp2', 'satp3', 'lat', 'site']
for i in node_options:
if i in data_dir:
node = i

for folder in range( int(start_ctime/1e5), int(stop_ctime/1e5)+1):
base = os.path.join(data_dir, str(folder))
print('base path', base)
if not os.path.exists(base):
print('looking for books?')
# see if book exists instead
if daq_node is None:
if node in data_dir:
book_path = 'hk_'+str(folder)+'_'+node
base = data_dir+'/'+str(book_path)
else:
hk_logger.debug(f'No daq node info provided in {data_dir}, cannot'
'find HK book. Assuming path is to .g3 files.')
# assumes path is to .g3 files instead of HK book
base = data_dir+'/'+str(folder)

#if daq_node is None:
for file in sorted(os.listdir(data_dir)):
if file.startswith(f'hk_{folder}_'):
print('file book', file)
# extract daq_node from the filename
#daq_node = file[len(f'hk_{folder}_'):].rstrip('_')
base = os.path.join(data_dir, file)
print('base book', base)
else:
hk_logger.debug(f'No daq node info provided in {data_dir}, cannot'
'find HK book. Assuming path is to .g3 files.')
# assumes path is to .g3 files instead of HK book
base = os.path.join(data_dir, str(folder))

print('base before .yaml', base)
for file in sorted(os.listdir(base)):
if file.endswith('.yaml'):
continue
Expand Down

0 comments on commit 5ba69c2

Please sign in to comment.