Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/pfs_target_uploader/utils/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ def load_file_properties(datadir, ext="ecsv", n_uid=16):
filesizes = np.zeros(n_files, dtype=float)
n_obj = np.zeros(n_files, dtype=int)
t_exp = np.zeros(n_files, dtype=float)
n_ppc = np.zeros(n_files, dtype=int)
links = np.full(n_files, None, dtype=object)

fullpath_target = np.full(n_files, None, dtype=object)
Expand Down Expand Up @@ -521,6 +522,12 @@ def load_file_properties(datadir, ext="ecsv", n_uid=16):
tb_l = tb_psl[tb_psl["resolution"] == "low"]
tb_m = tb_psl[tb_psl["resolution"] == "medium"]

# skip if tb_psl["N_ppc"] is None
if len(tb_psl) > 0 and tb_psl["N_ppc"][0] is not None:
n_ppc[i] = np.max(
tb_psl["N_ppc"]
) # should return the total number of PPCs

if len(tb_l) > 0:
exp_sci_l[i] = tb_l["Texp (h)"]
exp_sci_fh_l[i] = tb_l["Texp (fiberhour)"]
Expand Down Expand Up @@ -560,6 +567,7 @@ def load_file_properties(datadir, ext="ecsv", n_uid=16):
"Upload ID": upload_ids,
"TAC_done": tac_done,
"n_obj": n_obj,
"n_ppc": n_ppc,
"Exptime_tgt (FH)": t_exp,
"Exptime_sci_L (h)": exp_sci_l,
"Exptime_sci_M (h)": exp_sci_m,
Expand Down