Skip to content

Commit

Permalink
ensure correct timescales for errored window_results
Browse files Browse the repository at this point in the history
  • Loading branch information
ntellis committed Jan 15, 2025
1 parent ed5ac6d commit 9b29d0e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/adam_impact_study/impacts_study.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,6 @@ def run_impact_study_for_orbit(
if pc.any(pc.invert(pc.is_null(result.error))).as_py():
logger.warning(f"Error: {result.error}")
results = qv.concatenate([results, result])
if results.fragmented():
results = qv.defragment(results)

else:
futures.append(
Expand Down Expand Up @@ -360,6 +358,9 @@ def calculate_window_impact_probability(
observation_end=end_date,
observation_count=[observations_count],
observation_nights=[num_observation_nights],
mean_impact_time=Timestamp.nulls(1, scale="tdb"),
minimum_impact_time=Timestamp.nulls(1, scale="tdb"),
maximum_impact_time=Timestamp.nulls(1, scale="tdb"),
error=[str(e)],
)

Expand All @@ -373,6 +374,9 @@ def calculate_window_impact_probability(
observation_count=[observations_count],
observation_nights=[num_observation_nights],
observations_rejected=[len(rejected_observations)],
mean_impact_time=Timestamp.nulls(1, scale="tdb"),
minimum_impact_time=Timestamp.nulls(1, scale="tdb"),
maximum_impact_time=Timestamp.nulls(1, scale="tdb"),
error=[error],
)

Expand Down Expand Up @@ -427,6 +431,9 @@ def calculate_window_impact_probability(
observation_count=[observations_count],
observation_nights=[num_observation_nights],
observations_rejected=[len(rejected_observations)],
mean_impact_time=Timestamp.nulls(1, scale="tdb"),
minimum_impact_time=Timestamp.nulls(1, scale="tdb"),
maximum_impact_time=Timestamp.nulls(1, scale="tdb"),
error=[str(e)],
)

Expand Down

0 comments on commit 9b29d0e

Please sign in to comment.