From 8cd2ed986c09daa45f795b152869171e025ed8b4 Mon Sep 17 00:00:00 2001 From: Jean Connelly Date: Sun, 23 Jun 2024 09:19:11 -0400 Subject: [PATCH 1/6] Set starcheck to use agasc default file --- starcheck/src/starcheck.pl | 8 +++++--- starcheck/utils.py | 5 +++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/starcheck/src/starcheck.pl b/starcheck/src/starcheck.pl index 2c2c7584..72c5486a 100755 --- a/starcheck/src/starcheck.pl +++ b/starcheck/src/starcheck.pl @@ -45,7 +45,6 @@ html => 1, text => 1, yaml => 1, - agasc_file => "${SKA}/data/agasc/proseco_agasc_1p7.h5", config_file => "characteristics.yaml", fid_char => "fid_CHARACTERISTICS", verbose => 1, @@ -113,6 +112,8 @@ my $version = call_python("utils.starcheck_version"); +my $agasc_file_name = $par{agasc_file} ||= call_python("utils.get_agasc_file"); + my $Starcheck_Data = $par{sc_data} || call_python("utils.get_data_dir"); my $STARCHECK = $par{out} || ($par{vehicle} ? 'v_starcheck' : 'starcheck'); @@ -189,7 +190,7 @@ my $odb_file = get_file("$Starcheck_Data/$par{fid_char}*", 'odb', 'required'); -my $agasc_file = get_file("$par{agasc_file}", "agasc_file"); +my $agasc_file = get_file($agasc_file_name, "agasc_file"); my $ps_file = get_file("$par{dir}/mps/ms*.sum", 'processing summary'); my $tlr_file = get_file("$par{dir}/${sosa_dir_slash}*.tlr", 'TLR', 'required'); @@ -1295,7 +1296,8 @@ =head1 OPTIONS =item B<-agasc_file > -Specify location of agasc h5 file. Default is SKA/data/agasc/agasc1p7.h5 . +Specify location of agasc h5 file. Default is Python agasc module default (most recent +SKA/data/agasc/proseco_agasc_* ) . =item B<-fid_char > diff --git a/starcheck/utils.py b/starcheck/utils.py index 6694b256..a89050b3 100644 --- a/starcheck/utils.py +++ b/starcheck/utils.py @@ -46,6 +46,11 @@ message=r"\nModel .* computed between .* clipping input mag\(s\) outside that range\.", ) + +def get_agasc_file(): + return agasc.get_agasc_filename() + + def prehtml2text(html_text): """Convert the starcheck report html to plain text.""" From 69fd88bf85bbe3ed3271acb363a1198d408f2738 Mon Sep 17 00:00:00 2001 From: Jean Connelly Date: Sun, 23 Jun 2024 09:19:45 -0400 Subject: [PATCH 2/6] Fix ASPQ1 warning text (missing content) --- starcheck/src/lib/Ska/Starcheck/Obsid.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/starcheck/src/lib/Ska/Starcheck/Obsid.pm b/starcheck/src/lib/Ska/Starcheck/Obsid.pm index 88c7d012..a2b66962 100644 --- a/starcheck/src/lib/Ska/Starcheck/Obsid.pm +++ b/starcheck/src/lib/Ska/Starcheck/Obsid.pm @@ -1264,7 +1264,8 @@ sub check_star_catalog { or (($type =~ /BOT|ACQ/) && ($c->{"GS_ASPQ$i"} > 40))) { push @orange_warn, - sprintf "[%2d] Centroid Perturbation Warning. %s: ASPQ1 = %2d\n",; + sprintf("[%2d] Centroid Perturbation Warning. %s: ASPQ1 = %2d\n", + $i, $type, $c->{"GS_ASPQ$i"}); } } From 4297c1dc2102459d8ce311b2091bd1d601790349 Mon Sep 17 00:00:00 2001 From: Jean Connelly Date: Sun, 23 Jun 2024 09:50:13 -0400 Subject: [PATCH 3/6] Remove agasc_file cmdline option --- starcheck/src/starcheck.pl | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/starcheck/src/starcheck.pl b/starcheck/src/starcheck.pl index 72c5486a..ffe8b530 100755 --- a/starcheck/src/starcheck.pl +++ b/starcheck/src/starcheck.pl @@ -63,7 +63,6 @@ 'yaml!', 'vehicle!', 'verbose=s', - 'agasc_file=s', 'sc_data=s', 'fid_char=s', 'config_file=s', @@ -112,8 +111,6 @@ my $version = call_python("utils.starcheck_version"); -my $agasc_file_name = $par{agasc_file} ||= call_python("utils.get_agasc_file"); - my $Starcheck_Data = $par{sc_data} || call_python("utils.get_data_dir"); my $STARCHECK = $par{out} || ($par{vehicle} ? 'v_starcheck' : 'starcheck'); @@ -190,7 +187,7 @@ my $odb_file = get_file("$Starcheck_Data/$par{fid_char}*", 'odb', 'required'); -my $agasc_file = get_file($agasc_file_name, "agasc_file"); +my $agasc_file = get_file(call_python("utils.get_agasc_file"), "agasc_file"); my $ps_file = get_file("$par{dir}/mps/ms*.sum", 'processing summary'); my $tlr_file = get_file("$par{dir}/${sosa_dir_slash}*.tlr", 'TLR', 'required'); @@ -1294,11 +1291,6 @@ =head1 OPTIONS Limit starcheck review to first N obsids (for testing). -=item B<-agasc_file > - -Specify location of agasc h5 file. Default is Python agasc module default (most recent -SKA/data/agasc/proseco_agasc_* ) . - =item B<-fid_char > Specify file name of the fid characteristics file to use. This must be in the SKA/data/starcheck/ directory. @@ -1340,7 +1332,7 @@ =head1 DESCRIPTION results in a fatal error, however. Starcheck uses the SKA environment variable to locate the default agasc file -"${SKA}/data/agasc/proseco_agasc_1p7.h5". If SKA is not set this defaults to +"${SKA}/data/agasc/proseco_agasc_*.h5". If SKA is not set this defaults to '/proj/sot/ska'. Starcheck uses the PROSECO_OR_IMAGE_SIZE environment variable if available to From 023303f4f3852bf7dae3cd33e7fa7fb502f9f745 Mon Sep 17 00:00:00 2001 From: Jean Connelly Date: Sun, 23 Jun 2024 09:54:26 -0400 Subject: [PATCH 4/6] Update docs --- starcheck/src/starcheck.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/starcheck/src/starcheck.pl b/starcheck/src/starcheck.pl index ffe8b530..317b610c 100755 --- a/starcheck/src/starcheck.pl +++ b/starcheck/src/starcheck.pl @@ -1333,7 +1333,8 @@ =head1 DESCRIPTION Starcheck uses the SKA environment variable to locate the default agasc file "${SKA}/data/agasc/proseco_agasc_*.h5". If SKA is not set this defaults to -'/proj/sot/ska'. +'/proj/sot/ska'. The agasc file location can be controlled with the agasc module +environment variables AGASC_DIR and AGASC_HDF5_FILE. Starcheck uses the PROSECO_OR_IMAGE_SIZE environment variable if available to set up the check for the appropriate readout image size in pixels for science From 7544d8ab726315266abceaf5a584399da44a9597 Mon Sep 17 00:00:00 2001 From: Jean Connelly Date: Fri, 28 Jun 2024 21:38:07 -0400 Subject: [PATCH 5/6] Set perturbation warning to show agasc id --- 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 a2b66962..ea646c83 100644 --- a/starcheck/src/lib/Ska/Starcheck/Obsid.pm +++ b/starcheck/src/lib/Ska/Starcheck/Obsid.pm @@ -1265,7 +1265,7 @@ sub check_star_catalog { { push @orange_warn, sprintf("[%2d] Centroid Perturbation Warning. %s: ASPQ1 = %2d\n", - $i, $type, $c->{"GS_ASPQ$i"}); + $i, $sid, $c->{"GS_ASPQ$i"}); } } From f141eab46455c870553253f5c94eb54b7d8c4d6f Mon Sep 17 00:00:00 2001 From: Jean Connelly Date: Fri, 28 Jun 2024 21:38:40 -0400 Subject: [PATCH 6/6] Remove text about default SKA --- starcheck/src/starcheck.pl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/starcheck/src/starcheck.pl b/starcheck/src/starcheck.pl index 317b610c..fc57ee37 100755 --- a/starcheck/src/starcheck.pl +++ b/starcheck/src/starcheck.pl @@ -1332,9 +1332,8 @@ =head1 DESCRIPTION results in a fatal error, however. Starcheck uses the SKA environment variable to locate the default agasc file -"${SKA}/data/agasc/proseco_agasc_*.h5". If SKA is not set this defaults to -'/proj/sot/ska'. The agasc file location can be controlled with the agasc module -environment variables AGASC_DIR and AGASC_HDF5_FILE. +"${SKA}/data/agasc/proseco_agasc_*.h5". The agasc file location can be controlled +with the agasc module environment variables AGASC_DIR and AGASC_HDF5_FILE. Starcheck uses the PROSECO_OR_IMAGE_SIZE environment variable if available to set up the check for the appropriate readout image size in pixels for science