From 0cdd3723ef4b235964be901bd4a84c65e0986996 Mon Sep 17 00:00:00 2001 From: Thibault Barnouin Date: Mon, 18 Sep 2023 16:57:40 +0200 Subject: [PATCH] query should not take F1ND filter + masking tape on cdelt --- src/lib/fits.py | 4 ++-- src/lib/query.py | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/lib/fits.py b/src/lib/fits.py index 2ed49cf..3a256c0 100755 --- a/src/lib/fits.py +++ b/src/lib/fits.py @@ -74,9 +74,9 @@ def get_obs_data(infiles, data_folder="", compute_flux=False): # force WCS for POL60 to have same pixel size as POL0 and POL120 is_pol60 = np.array([head['filtnam1'].lower()=='pol60' for head in headers],dtype=bool) - cdelt = np.array([WCS(head).wcs.cdelt for head in headers]) + cdelt = np.round(np.array([WCS(head).wcs.cdelt for head in headers]),14) if np.unique(cdelt[np.logical_not(is_pol60)],axis=0).size!=2: - print(np.unique(cdelt[np.logical_not(is_pol60)],axis=0).size) + print(np.unique(cdelt[np.logical_not(is_pol60)],axis=0)) raise ValueError("Not all images have same pixel size") else: for i in np.arange(len(headers))[is_pol60]: diff --git a/src/lib/query.py b/src/lib/query.py index 7424dcb..bf76650 100755 --- a/src/lib/query.py +++ b/src/lib/query.py @@ -86,6 +86,13 @@ def get_product_list(target=None, proposal_id=None): results = divide_proposal(results) obs = results.copy() + ### Remove single observations for which a FIND filter is used + to_remove=[] + for i in range(len(obs)): + if "F1ND" in obs[i]['Filters']: + to_remove.append(i) + obs.remove_rows(to_remove) + ### Remove observations for which a polarization filter is missing polfilt = {"POL0":0,"POL60":1,"POL120":2} for pid in np.unique(obs['Proposal ID']): used_pol = np.zeros(3)