Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Elisa-Visentin committed Sep 20, 2023
1 parent 29e0bf1 commit c9feb52
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
17 changes: 9 additions & 8 deletions nsb_scripts/nsb_coincident_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,21 +105,22 @@ def linking_bash_lst(scripts_dir, target_dir, LST_runs, nsb, date, source):
MAGIC_DL1_dir = target_dir + f"/v{__version__}" + "/DL1/" + p
if not os.path.exists(coincidence_DL1_dir + "/DL1Coincident/" + str(p)):
os.mkdir(f"{coincidence_DL1_dir}/DL1Coincident/{p}")
dates = [os.path.basename(x) for x in glob.glob(f"{MAGIC_DL1_dir}/M1/*")]
dates = [os.path.basename(x) for x in glob.glob(f"{MAGIC_DL1_dir}/Merged/Merged_*")]
for d in dates:
Y_M = int(d.split("_")[0])
M_M = int(d.split("_")[1])
D_M = int(d.split("_")[2])

Y_M = int(d.split("_")[1])
M_M = int(d.split("_")[2])
D_M = int(d.split("_")[3])


day_MAGIC = dtdt(Y_M, M_M, D_M)

delta = timedelta(days=1)
for i in LST_runs:
Y_L = i[0].split("_")[0]
M_L = i[0].split("_")[1]
D_L = i[0].split("_")[2]
D_L = i[0].split("_")[2]
day_LST = dtdt(int(Y_L), int(M_L), int(D_L))
if day_MAGIC == day_LST + delta:
if day_MAGIC == day_LST + delta:
if not os.path.exists(
coincidence_DL1_dir
+ "/DL1Coincident/"
Expand Down Expand Up @@ -200,7 +201,7 @@ def linking_bash_lst(scripts_dir, target_dir, LST_runs, nsb, date, source):
f.close()

if not os.path.exists(outputdir + "/logs/list_LST.txt"):
continue
continue
process_size = (
len(
np.genfromtxt(outputdir + "/logs/list_LST.txt", dtype="str")
Expand Down
2 changes: 2 additions & 0 deletions nsb_scripts/nsb_merge_M1_M2_night.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ def merge(scripts_dir, target_dir, source):

dates = [os.path.basename(x) for x in glob.glob(f"{MAGIC_DL1_dir}/M1/*")]
for i in dates:
if not os.path.exists(f"{MAGIC_DL1_dir}/Merged/{i}/Merged"):
continue
if not os.path.exists(MAGIC_DL1_dir + f"/Merged/Merged_{i}"):
os.mkdir(
f"{MAGIC_DL1_dir}/Merged/Merged_{i}"
Expand Down

0 comments on commit c9feb52

Please sign in to comment.