def initialize(self, data_1, data_2, m1, m2, m1_unm, m2_unm, d12, deg2_decam, deg2_bokmos): self.d12 = d12 # deg separations between matches objects self.deg2_decam = deg2_decam self.deg2_bokmos = deg2_bokmos self.data["m_decam"] = targets.data_extract(data_1, m1) self.data["m_bokmos"] = targets.data_extract(data_2, m2) self.data["u_decam"] = targets.data_extract(data_1, m1_unm) self.data["u_bokmos"] = targets.data_extract(data_2, m2_unm)
def initialize(self, data_1, data_2, m1, m2, m1_unm, m2_unm, d12, deg2_decam, deg2_bokmos): self.d12 = d12 #deg separations between matches objects self.deg2_decam = deg2_decam self.deg2_bokmos = deg2_bokmos self.data['m_decam'] = targets.data_extract(data_1, m1) self.data['m_bokmos'] = targets.data_extract(data_2, m2) self.data['u_decam'] = targets.data_extract(data_1, m1_unm) self.data['u_bokmos'] = targets.data_extract(data_2, m2_unm)
# get lists of tractor cats to compare fns_1 = read_lines(args.fn1) log.info("Combining tractor catalogues: ", fns_1) # if fns_1.size == 1: fns_1,fns_2= [fns_1],[fns_2] # object to store concatenated matched tractor cats a = Matched_Cats() for cnt, cat1, cat2 in zip(range(len(fns_1)), fns_1, fns_2): data_1, data_2, m1, m2, m1_unm, m2_unm, d12, deg2_decam, deg2_bokmos = match_it(cat1, cat2) if cnt == 0: a.initialize(data_1, data_2, m1, m2, m1_unm, m2_unm, d12, deg2_decam, deg2_bokmos) else: a.add_d12(d12) a.deg2_decam += deg2_decam a.deg2_bokmos += deg2_bokmos a.add_dict("m_decam", targets.data_extract(data_1, m1)) a.add_dict("m_bokmos", targets.data_extract(data_2, m2)) a.add_dict("u_decam", targets.data_extract(data_1, m1_unm)) a.add_dict("u_bokmos", targets.data_extract(data_2, m2_unm)) # each key a.data[key] becomes DECaLS() object with grz mags,i_lrg, etc b = {} b["d12"] = a.d12 b["deg2_decam"] = a.deg2_decam b["deg2_bokmos"] = a.deg2_bokmos for match_type in a.data.keys(): b[match_type] = targets.DECaLS(a.data[match_type], w1=True) # store N matched objects not masked before join decam,bokmos masks m_decam_not_masked, m_bokmos_not_masked = b["m_decam"].count_not_masked(), b["m_bokmos"].count_not_masked() # update masks for matched objects to be the join of decam and bokmos masks mask = np.any((b["m_decam"].mask, b["m_bokmos"].mask), axis=0) b["m_decam"].update_masks_for_everything(
fns_1 = read_lines(args.fn1) log.info('Combining tractor catalogues: ', fns_1) #if fns_1.size == 1: fns_1,fns_2= [fns_1],[fns_2] #object to store concatenated matched tractor cats a = Matched_Cats() for cnt, cat1, cat2 in zip(range(len(fns_1)), fns_1, fns_2): data_1, data_2, m1, m2, m1_unm, m2_unm, d12, deg2_decam, deg2_bokmos = match_it( cat1, cat2) if cnt == 0: a.initialize(data_1, data_2, m1, m2, m1_unm, m2_unm, d12, deg2_decam, deg2_bokmos) else: a.add_d12(d12) a.deg2_decam += deg2_decam a.deg2_bokmos += deg2_bokmos a.add_dict('m_decam', targets.data_extract(data_1, m1)) a.add_dict('m_bokmos', targets.data_extract(data_2, m2)) a.add_dict('u_decam', targets.data_extract(data_1, m1_unm)) a.add_dict('u_bokmos', targets.data_extract(data_2, m2_unm)) #each key a.data[key] becomes DECaLS() object with grz mags,i_lrg, etc b = {} b['d12'] = a.d12 b['deg2_decam'] = a.deg2_decam b['deg2_bokmos'] = a.deg2_bokmos for match_type in a.data.keys(): b[match_type] = targets.DECaLS(a.data[match_type], w1=True) #store N matched objects not masked before join decam,bokmos masks m_decam_not_masked, m_bokmos_not_masked = b['m_decam'].count_not_masked( ), b['m_bokmos'].count_not_masked() #update masks for matched objects to be the join of decam and bokmos masks mask = np.any((b['m_decam'].mask, b['m_bokmos'].mask), axis=0)