@@ -619,27 +619,32 @@ def plot_individual_orbit_ip_over_time(
619619 logger .warning (f"No complete results found for orbit { orbit_id } " )
620620 continue
621621
622- # Sort by observation end time
623- mjd_times = ips .observation_end .mjd ().to_numpy (zero_copy_only = False )
624- probabilities = ips .impact_probability .to_numpy (zero_copy_only = False )
625- sort_indices = mjd_times .argsort ()
626- mjd_times = mjd_times [sort_indices ]
627- probabilities = probabilities [sort_indices ]
628-
629622 # Plot sorted data on primary axis (MJD)
630623 ax1 .set_xlabel ("MJD" )
631624 ax1 .set_ylabel ("Impact Probability" )
632625 for condition in ips .condition_id .unique ():
633626 results_at_condition = ips .select ("condition_id" , condition )
627+
628+ # Sort by observation end time
629+ mjd_times = results_at_condition .observation_end .mjd ().to_numpy (
630+ zero_copy_only = False
631+ )
632+ probabilities = results_at_condition .impact_probability .to_numpy (
633+ zero_copy_only = False
634+ )
635+ sort_indices = mjd_times .argsort ()
636+ mjd_times = mjd_times [sort_indices ]
637+ probabilities = probabilities [sort_indices ]
638+
634639 ax1 .plot (
635- results_at_condition . observation_end . mjd () ,
636- results_at_condition . impact_probability ,
640+ mjd_times ,
641+ probabilities ,
637642 label = condition ,
638643 lw = 1 ,
639644 )
640645 ax1 .scatter (
641- results_at_condition . observation_end . mjd () ,
642- results_at_condition . impact_probability ,
646+ mjd_times ,
647+ probabilities ,
643648 label = condition ,
644649 )
645650
@@ -2434,9 +2439,7 @@ def make_analysis_plots(
24342439 plt .close (fig )
24352440
24362441 fig , ax = plot_discovered_by_diameter_impact_period (
2437- summary ,
2438- period = "5year" ,
2439- max_impact_time = Timestamp .from_iso8601 (["2070-01-01" ])
2442+ summary , period = "5year" , max_impact_time = Timestamp .from_iso8601 (["2070-01-01" ])
24402443 )
24412444 fig .savefig (
24422445 os .path .join (out_dir , "discovered_by_diameter_5year_2070.jpg" ),
@@ -2847,8 +2850,9 @@ def plot_discovered_by_diameter_impact_period(
28472850 discovered_orbits_at_diameter_and_period .ip_threshold_50_percent .mjd ()
28482851 ),
28492852 )
2850- num_above_1_percent_below_50_percent = pc .sum (reaching_1_percent_mask ).as_py ()
2851-
2853+ num_above_1_percent_below_50_percent = pc .sum (
2854+ reaching_1_percent_mask
2855+ ).as_py ()
28522856
28532857 # Count discovered objects that do not reach the 1% threshold
28542858 num_below_1_percent = pc .sum (
@@ -2857,15 +2861,16 @@ def plot_discovered_by_diameter_impact_period(
28572861 )
28582862 ).as_py ()
28592863
2860-
28612864 discovered_by_diameter_period = qv .concatenate (
28622865 [
28632866 discovered_by_diameter_period ,
28642867 DiscoveredByDiameterImpactPeriod .from_kwargs (
28652868 impact_period = [impact_period ],
28662869 diameter = [diameter ],
28672870 num_discovered_above_50_percent = [num_above_50_percent ],
2868- num_discovered_1_percent_to_50_percent = [num_above_1_percent_below_50_percent ],
2871+ num_discovered_1_percent_to_50_percent = [
2872+ num_above_1_percent_below_50_percent
2873+ ],
28692874 num_discovered_below_1_percent = [num_below_1_percent ],
28702875 total_including_undiscovered = [
28712876 len (orbits_at_diameter_and_period )
0 commit comments