From 344e4dd0da2b3cd653bfbcf8cfa307158034c04c Mon Sep 17 00:00:00 2001 From: Jean Connelly Date: Tue, 29 Jul 2025 15:14:27 -0400 Subject: [PATCH 1/5] Change definition of creep-away to 3deg from 5deg --- starcheck/src/lib/Ska/Starcheck/Obsid.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/starcheck/src/lib/Ska/Starcheck/Obsid.pm b/starcheck/src/lib/Ska/Starcheck/Obsid.pm index 774b7d3f..dd0b0f7e 100644 --- a/starcheck/src/lib/Ska/Starcheck/Obsid.pm +++ b/starcheck/src/lib/Ska/Starcheck/Obsid.pm @@ -729,7 +729,7 @@ sub check_dither { # and such observations could end in larger roll errors. Check added in PR #452. # Operationally, we also do not expect to use, for example, 4x4 dither, so this # adds a CAUTION for unexpected small dither patterns. - my $creep_away = ($man_angle_next_data->{"angle"} < 5.0); + my $creep_away = ($man_angle_next_data->{"angle"} < 3.0); my $no_dither = (($guide_dither->{state} eq 'DISA') or (($guide_dither->{ampl_y_int} == 0) and ($guide_dither->{ampl_p_int}== 0))); my $small_dither = (($guide_dither->{ampl_y_int} < 8) and ($guide_dither->{ampl_p_int} < 8) From 500b24f40875843631c4b351d052dba230ab1757 Mon Sep 17 00:00:00 2001 From: Jean Connelly Date: Tue, 29 Jul 2025 15:53:28 -0400 Subject: [PATCH 2/5] Add point at 3 for man angle interpolation --- starcheck/state_checks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/starcheck/state_checks.py b/starcheck/state_checks.py index 61c926bf..a631f74e 100644 --- a/starcheck/state_checks.py +++ b/starcheck/state_checks.py @@ -29,7 +29,7 @@ def make_man_table(): # Use a range of angles that sample the curve pretty well by eye # The duration function is a little slow and not vectorized, so # this is sparse. - angles = [0, 5, 10, 15, 20, 25, 35, 50, 100, 150, 180] + angles = [0, 3, 5, 10, 15, 20, 25, 35, 50, 100, 150, 180] for angle in angles: q1 = Quat(equatorial=(angle, 0, 0)) durations.append(duration(q0, q1)) From d28d710cdc7f1510a0aa5512c8d9b3177c67f4be Mon Sep 17 00:00:00 2001 From: Jean Connelly Date: Tue, 29 Jul 2025 15:53:56 -0400 Subject: [PATCH 3/5] Do truncation rounding of man angle for check --- starcheck/src/lib/Ska/Starcheck/Obsid.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/starcheck/src/lib/Ska/Starcheck/Obsid.pm b/starcheck/src/lib/Ska/Starcheck/Obsid.pm index dd0b0f7e..3e1b2804 100644 --- a/starcheck/src/lib/Ska/Starcheck/Obsid.pm +++ b/starcheck/src/lib/Ska/Starcheck/Obsid.pm @@ -729,7 +729,10 @@ sub check_dither { # and such observations could end in larger roll errors. Check added in PR #452. # Operationally, we also do not expect to use, for example, 4x4 dither, so this # adds a CAUTION for unexpected small dither patterns. - my $creep_away = ($man_angle_next_data->{"angle"} < 3.0); + + # Round the angle_next to 1 decimal place + my $angle_next = sprintf("%.1f", $man_angle_next_data->{"angle"}); + my $creep_away = ($angle_next < 3.0); my $no_dither = (($guide_dither->{state} eq 'DISA') or (($guide_dither->{ampl_y_int} == 0) and ($guide_dither->{ampl_p_int}== 0))); my $small_dither = (($guide_dither->{ampl_y_int} < 8) and ($guide_dither->{ampl_p_int} < 8) From 89320b4efe1a991706612562e31e48e91b7aa669 Mon Sep 17 00:00:00 2001 From: Jean Connelly Date: Tue, 29 Jul 2025 16:04:23 -0400 Subject: [PATCH 4/5] Update ruff-base --- ruff-base.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ruff-base.toml b/ruff-base.toml index d9054f15..8e9a25a8 100644 --- a/ruff-base.toml +++ b/ruff-base.toml @@ -41,6 +41,8 @@ lint.ignore = [ "B028", # No explicit `stacklevel` keyword argument found "PLR0913", # Too many arguments to function call "PLR1730", # Checks for if statements that can be replaced with min() or max() calls + "PLC0415", # `import` should be at the top-level of a file + "PLW1641", # Class implements `__hash__` if `__eq__` is implemented ] extend-exclude = [ From 0b790cc2dce1ab78d5a9000b4609815fb76e61a9 Mon Sep 17 00:00:00 2001 From: Jean Connelly Date: Wed, 20 Aug 2025 14:38:46 -0400 Subject: [PATCH 5/5] Fix AONMMODE offset --- starcheck/state_checks.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/starcheck/state_checks.py b/starcheck/state_checks.py index a631f74e..19d17151 100644 --- a/starcheck/state_checks.py +++ b/starcheck/state_checks.py @@ -171,8 +171,9 @@ def get_obs_man_angle(npnt_tstart, backstop_file): if np.abs(CxoTime(npnt_tstart).secs - prev_state["tstop"]) > 600: warn = f"Maneuver angle err - no manvr ends within 600s of {CxoTime(npnt_tstart).date}\n" return {"angle": 180, "warn": warn} - dur = prev_state["tstop"] - prev_state["tstart"] - angle = calc_man_angle_for_duration(dur) + nmm_dur = prev_state["tstop"] - prev_state["tstart"] + manvr_dur = nmm_dur - 10.25 # subtract standard time between AONMMODE and AOMANUVR + angle = calc_man_angle_for_duration(manvr_dur) return {"angle": angle} @@ -188,6 +189,7 @@ def get_obs_man_angle_next(npnt_tstart, backstop_file): if next_state is None: warn = f"No NMAN state after {CxoTime(npnt_tstart).date}\n" return {"angle": 180, "warn": warn} - dur = next_state["tstop"] - next_state["tstart"] - angle = calc_man_angle_for_duration(dur) + nmm_dur = next_state["tstop"] - next_state["tstart"] + manvr_dur = nmm_dur - 10.25 # subtract standard time between AONMMODE and AOMANUVR + angle = calc_man_angle_for_duration(manvr_dur) return {"angle": angle}