From cfe1a35528dc4c92b9790357402fbd7be0423951 Mon Sep 17 00:00:00 2001 From: Jean Connelly Date: Wed, 26 Nov 2025 13:49:24 -0500 Subject: [PATCH 1/5] Allow guide count of 3.5 with creep-away --- starcheck/src/lib/Ska/Starcheck/Obsid.pm | 33 +++++++++++++++++------- starcheck/src/starcheck.pl | 4 ++- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/starcheck/src/lib/Ska/Starcheck/Obsid.pm b/starcheck/src/lib/Ska/Starcheck/Obsid.pm index ec8fb0b2..fcdc235b 100644 --- a/starcheck/src/lib/Ska/Starcheck/Obsid.pm +++ b/starcheck/src/lib/Ska/Starcheck/Obsid.pm @@ -581,6 +581,19 @@ sub set_star_catalog { } } +############################################################################################# +sub get_creep_status{ +############################################################################################# + my $self = shift; + my $targ_cmd = find_command($self, "MP_TARGQUAT", -1); + my $man_angle_next_data = call_python("state_checks.get_obs_man_angle_next", + [ $targ_cmd->{tstop}, $self->{backstop} ]); + # 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); + return $creep_away; +} + ############################################################################################# sub check_dither { ############################################################################################# @@ -697,20 +710,13 @@ sub check_dither { } } - my $targ_cmd = find_command($self, "MP_TARGQUAT", -1); - my $man_angle_next_data = call_python("state_checks.get_obs_man_angle_next", - [ $targ_cmd->{tstop}, $self->{backstop} ]); - # Add a check that for small or zero dither amplitudes, that creep-away is used. # The idea is that dynamic background is less effective for small or zero 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. - - # 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 $creep_away = $self->get_creep_status(); 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) @@ -2905,14 +2911,23 @@ sub check_guide_count { "Dither disabled or 0 - dynamic background bonus disabled for guide count.\n"; } + my $creep_away = $self->get_creep_status(); + my $guide_count = $self->count_guide_stars($dyn_bgd); - my $min_num_gui = ($self->{obsid} >= 38000) ? 6.0 : 4.0; + # If obsid >= 38000, min guide count is 6.0 + # If an OR, the required number is 3.5 if creep away else 4.0 + my $min_num_gui = ($self->{obsid} >= 38000) ? 6.0 : ($creep_away ? 3.5 : 4.0); if ($guide_count < $min_num_gui) { push @{ $self->{warn} }, "Guide count of $guide_count < $min_num_gui.\n"; } + if (($creep_away) & ($guide_count < 4.0) & ($guide_count >= 3.5)) { + push @{ $self->{yellow_warn} }, + "Guide count of $guide_count < 4.0 but uses creep-away\n"; + } + # Also save the guide count in the figure_of_merit $self->{figure_of_merit}->{guide_count} = $guide_count; } diff --git a/starcheck/src/starcheck.pl b/starcheck/src/starcheck.pl index b90e0cb6..65740bf9 100755 --- a/starcheck/src/starcheck.pl +++ b/starcheck/src/starcheck.pl @@ -820,8 +820,10 @@ sub json_obsids { if (defined $cat) { my $guide_count = $obs{$obsid}->{figure_of_merit}->{guide_count}; + my $creep_away = $obs{$obsid}->get_creep_status(); + # minumum requirements for fractional guide star count for ERs and ORs - my $min_num_gui = ($obs{$obsid}->{obsid} >= 38000) ? 6.0 : 4.0; + my $min_num_gui = ($obs{$obsid}->{obsid} >= 38000) ? 6.0 : ($creep_away ? 3.0 : 4.0); # Use the acq prob model values saved in figure_of_merit for the expected # number of acq stars and a bad overall probability. figure_of_merit isn't From 8562f1a8c5c8c514a5e418a0ecd59309e1e01a31 Mon Sep 17 00:00:00 2001 From: Jean Connelly Date: Wed, 26 Nov 2025 13:54:21 -0500 Subject: [PATCH 2/5] Remove possible ERs from yellow warn --- 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 fcdc235b..81778152 100644 --- a/starcheck/src/lib/Ska/Starcheck/Obsid.pm +++ b/starcheck/src/lib/Ska/Starcheck/Obsid.pm @@ -2923,7 +2923,7 @@ sub check_guide_count { push @{ $self->{warn} }, "Guide count of $guide_count < $min_num_gui.\n"; } - if (($creep_away) & ($guide_count < 4.0) & ($guide_count >= 3.5)) { + if (($self->{obsid} < 38000) & ($creep_away) & ($guide_count < 4.0) & ($guide_count >= 3.5)) { push @{ $self->{yellow_warn} }, "Guide count of $guide_count < 4.0 but uses creep-away\n"; } From 3f13c05a25184aa4d5092b01987dcd8dbb98387c Mon Sep 17 00:00:00 2001 From: Jean Connelly Date: Wed, 26 Nov 2025 14:36:56 -0500 Subject: [PATCH 3/5] Wrong limit crept in there --- starcheck/src/starcheck.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/starcheck/src/starcheck.pl b/starcheck/src/starcheck.pl index 65740bf9..d9036ccc 100755 --- a/starcheck/src/starcheck.pl +++ b/starcheck/src/starcheck.pl @@ -823,7 +823,7 @@ sub json_obsids { my $creep_away = $obs{$obsid}->get_creep_status(); # minumum requirements for fractional guide star count for ERs and ORs - my $min_num_gui = ($obs{$obsid}->{obsid} >= 38000) ? 6.0 : ($creep_away ? 3.0 : 4.0); + my $min_num_gui = ($obs{$obsid}->{obsid} >= 38000) ? 6.0 : ($creep_away ? 3.5 : 4.0); # Use the acq prob model values saved in figure_of_merit for the expected # number of acq stars and a bad overall probability. figure_of_merit isn't From 0c2c8f94ee6dcac95638e6912514022209631ab9 Mon Sep 17 00:00:00 2001 From: Jean Connelly Date: Tue, 2 Dec 2025 17:22:56 -0500 Subject: [PATCH 4/5] Typo Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- starcheck/src/starcheck.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/starcheck/src/starcheck.pl b/starcheck/src/starcheck.pl index d9036ccc..ec96d609 100755 --- a/starcheck/src/starcheck.pl +++ b/starcheck/src/starcheck.pl @@ -822,7 +822,7 @@ sub json_obsids { my $creep_away = $obs{$obsid}->get_creep_status(); - # minumum requirements for fractional guide star count for ERs and ORs + # minimum requirements for fractional guide star count for ERs and ORs my $min_num_gui = ($obs{$obsid}->{obsid} >= 38000) ? 6.0 : ($creep_away ? 3.5 : 4.0); # Use the acq prob model values saved in figure_of_merit for the expected From 68c559f5533db722ae79ca5e6712ff6a6558d6cc Mon Sep 17 00:00:00 2001 From: Jean Connelly Date: Tue, 2 Dec 2025 17:25:10 -0500 Subject: [PATCH 5/5] Use && instead of & . Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- 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 81778152..357d3567 100644 --- a/starcheck/src/lib/Ska/Starcheck/Obsid.pm +++ b/starcheck/src/lib/Ska/Starcheck/Obsid.pm @@ -2923,7 +2923,7 @@ sub check_guide_count { push @{ $self->{warn} }, "Guide count of $guide_count < $min_num_gui.\n"; } - if (($self->{obsid} < 38000) & ($creep_away) & ($guide_count < 4.0) & ($guide_count >= 3.5)) { + if (($self->{obsid} < 38000) && ($creep_away) && ($guide_count < 4.0) && ($guide_count >= 3.5)) { push @{ $self->{yellow_warn} }, "Guide count of $guide_count < 4.0 but uses creep-away\n"; }