36 lines
724 B
Python
36 lines
724 B
Python
from collections import defaultdict
|
|
from glob import glob
|
|
from tqdm import tqdm
|
|
from slic.core.acquisition.broker.post_retrieve import post_retrieve_acq_jsons, API_ADDR
|
|
from slic.utils.ask_yes_no import ask_yes_No
|
|
|
|
|
|
# set the output folder here
|
|
output = "./new_jsons"
|
|
|
|
|
|
pattern = f"{output}/*.json"
|
|
fns = sorted(glob(pattern))
|
|
|
|
for fn in fns:
|
|
print(fn)
|
|
|
|
if not ask_yes_No("do you want to post retrieve all json files"):
|
|
raise SystemExit
|
|
|
|
if not ask_yes_No("100% sure"):
|
|
raise SystemExit
|
|
|
|
blocks = defaultdict(list)
|
|
for fn in fns:
|
|
run = fn.split("/")[-1][3:7]
|
|
blocks[run].append(fn)
|
|
|
|
for fns in blocks.values():
|
|
post_retrieve_acq_jsons(API_ADDR, fns)
|
|
# if not ask_yes_No("next"):
|
|
# break
|
|
|
|
|
|
|