From 5e240ad5d617c8d7e9eac410e634c06f6efb4a67 Mon Sep 17 00:00:00 2001 From: imedan Date: Fri, 6 Sep 2024 09:49:04 -0500 Subject: [PATCH] set field_id correctly --- bin/create_designid_status_replace_designs.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/create_designid_status_replace_designs.py b/bin/create_designid_status_replace_designs.py index 62ea660..a303965 100644 --- a/bin/create_designid_status_replace_designs.py +++ b/bin/create_designid_status_replace_designs.py @@ -147,6 +147,7 @@ def designid_status(design_file, obsTime, exp, fexp, field_id, des_objs=None): targetdb.Field.field_id >= 100000) if len(same_field) > 0: field_id = same_field[0].field_id + status['fieldid'] = np.zeros(n_exp, dtype='>i4') + field_id # get the design objects if running in parallel if Ncores > 1 and n_exp > 1: with Pool(processes=Ncores) as pool: @@ -160,12 +161,12 @@ def designid_status(design_file, obsTime, exp, fexp, field_id, des_objs=None): designid, status = get_designid_status(file, field_id, des_objs=des_objs) else: field_id = -1 + status['fieldid'] = np.zeros(n_exp, dtype='>i4') + field_id designid = np.zeros(n_exp, dtype='>i4') - 1 status = np.zeros(n_exp, dtype='S20') status[:] = 'not started' # add the new HDU - status['fieldid'] += field_id status['designid'] = designid status['status'] = status