@@ -20,7 +20,7 @@ class MyCrossmatchAlgorithm(KdTreeCrossmatch):
2020 extra_columns = pd .DataFrame (
2121 {
2222 "_dist_arcsec" : pd .Series (dtype = pd .ArrowDtype (pa .float64 ())),
23- "magnitude_difference " : pd .Series (dtype = pd .ArrowDtype (pa .float64 ())),
23+ "_magnitude_difference " : pd .Series (dtype = pd .ArrowDtype (pa .float64 ())),
2424 }
2525 )
2626
@@ -46,14 +46,14 @@ def _calculate_magnitude_differences(
4646 ) -> pd .DataFrame :
4747 all_matches_df ["left_mag" ] = self .left .iloc [all_matches_df ["left_idx" ]][left_mag_col ].to_numpy ()
4848 all_matches_df ["right_mag" ] = self .right .iloc [all_matches_df ["right_idx" ]][right_mag_col ].to_numpy ()
49- all_matches_df ["magnitude_difference " ] = np .abs (
49+ all_matches_df ["_magnitude_difference " ] = np .abs (
5050 all_matches_df ["right_mag" ] - all_matches_df ["left_mag" ]
5151 )
5252 return all_matches_df
5353
5454 def _select_best_matches (self , all_matches_df : pd .DataFrame ) -> pd .DataFrame :
5555 best_match_indices_in_all_matches_df = all_matches_df .groupby ("left_idx" )[
56- "magnitude_difference "
56+ "_magnitude_difference "
5757 ].idxmin ()
5858 return all_matches_df .loc [best_match_indices_in_all_matches_df ].reset_index (drop = True )
5959
@@ -83,7 +83,7 @@ def perform_crossmatch(
8383 pd .DataFrame (
8484 {
8585 "_dist_arcsec" : pd .Series (dtype = pd .ArrowDtype (pa .float64 ())),
86- "magnitude_difference " : pd .Series (dtype = pd .ArrowDtype (pa .float64 ())),
86+ "_magnitude_difference " : pd .Series (dtype = pd .ArrowDtype (pa .float64 ())),
8787 }
8888 ),
8989 )
@@ -104,12 +104,12 @@ def perform_crossmatch(
104104 final_left_indices = final_matches_df ["left_idx" ].to_numpy ()
105105 final_right_indices = final_matches_df ["right_idx" ].to_numpy ()
106106 final_distances = final_matches_df ["arc_dist_arcsec" ].to_numpy ()
107- final_magnitude_differences = final_matches_df ["magnitude_difference " ].to_numpy ()
107+ final_magnitude_differences = final_matches_df ["_magnitude_difference " ].to_numpy ()
108108
109109 extra_columns = pd .DataFrame (
110110 {
111111 "_dist_arcsec" : pd .Series (final_distances , dtype = pd .ArrowDtype (pa .float64 ())),
112- "magnitude_difference " : pd .Series (
112+ "_magnitude_difference " : pd .Series (
113113 final_magnitude_differences , dtype = pd .ArrowDtype (pa .float64 ())
114114 ),
115115 }
0 commit comments