Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ruff-base.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
5 changes: 4 additions & 1 deletion starcheck/src/lib/Ska/Starcheck/Obsid.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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"} < 5.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)
Expand Down
12 changes: 7 additions & 5 deletions starcheck/state_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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
Comment thread
taldcroft marked this conversation as resolved.
angle = calc_man_angle_for_duration(manvr_dur)
return {"angle": angle}


Expand All @@ -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}