Hello,
I was interested in examining the time series features of the true injected sources that are in DP 0.2 inside the DiaObject table – I’m assuming the TruthSummary table contains that information?
service = get_tap_service()
ra, dec, sep = 62.0, -37.0, 0.05
query = "SELECT mt.id_truth_type, mt.match_objectId, ts.ra, ts.dec, ts.truth_type, "\
"obj.coord_ra, obj.coord_dec "\
"FROM dp02_dc2_catalogs.MatchesTruth AS mt "\
"JOIN dp02_dc2_catalogs.TruthSummary AS ts ON mt.id_truth_type = ts.id_truth_type "\
"JOIN dp02_dc2_catalogs.Object AS obj ON mt.match_objectId = obj.objectId "\
f"WHERE CONTAINS(POINT('ICRS', ts.ra, ts.dec), CIRCLE('ICRS', {ra}, {dec}, {sep})) = 1 "
xm_withIDs = service.search(query).to_table()
tab = service.search("SELECT * "
"FROM dp02_dc2_catalogs.DiaObject as dio "
"WHERE CONTAINS(POINT('ICRS', ra, decl), "
f"CIRCLE('ICRS', {ra}, {dec}, {sep})) = 1 ").to_table()
true = service.search("SELECT * "
"FROM dp02_dc2_catalogs.TruthSummary as dio "
"WHERE CONTAINS(POINT('ICRS', ra, dec), "
f"CIRCLE('ICRS', {ra}, {dec}, {sep})) = 1 ").to_table()
I first tried finding the matching match_objectId
with the diaObjectId
and then finding the corresponding id_truth_type
to map the DiaObjectId to the TruthSummary table. Here’s how I do that:
true_id_truth_type = [] # id_truth_type values for the TruthSummary that have been cross-match between DiaObject & xm_withIDs
index_of_id = [] # Indices for DiaObject table
for _id, _idT in zip(xm_withIDs['match_objectId'], xm_withIDs['id_truth_type']):
if any(tab['diaObjectId']==_id):
select = np.where(tab['diaObjectId']==_id)
if any(true['id_truth_type']==_idT):
true_id_truth_type.append(_idT)
index_of_id.append(select[0][0])
It seems that my returned DiaObject
table and TruthSummary
table are not consistent with each other - particularly the measured flux values. I’m wondering if there’s something wrong with my approach here, or if I’m simply looking at the wrong tables.
My apologies in advance if this is a repeated question or a simpler mistake on my end. Thank you in advance!
Cheers,
Andy