From fc2bb996fd757e2a2bd3494483118a852bb1d2d5 Mon Sep 17 00:00:00 2001 From: Troy Raen Date: Mon, 16 Dec 2024 15:46:39 -0800 Subject: [PATCH] Bugfix: Match query 'obsid' to product 'parent_obsid' --- spectroscopy/code_src/mast_functions.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spectroscopy/code_src/mast_functions.py b/spectroscopy/code_src/mast_functions.py index 2975cd48..90aed7b0 100644 --- a/spectroscopy/code_src/mast_functions.py +++ b/spectroscopy/code_src/mast_functions.py @@ -140,8 +140,10 @@ def JWST_get_spec_helper(sample_table, search_radius_arcsec, datadir, verbose, tab = Table(names=keys + ["productFilename"], dtype=[str, str, str, int, float, int, int, int, float]+[str]) for jj in range(len(data_products_list_filter)): + # Match query 'obsid' to product 'parent_obsid' (not 'obsID') because products may + # belong to a different group than the observation. idx_cross = np.where(query_results["obsid"] == - data_products_list_filter["obsID"][jj])[0] + data_products_list_filter["parent_obsid"][jj])[0] tmp = query_results[idx_cross][keys] tab.add_row(list(tmp[0]) + [data_products_list_filter["productFilename"][jj]])