From 34bed2633269c9664b5517b9113215152e5c61af Mon Sep 17 00:00:00 2001 From: Justin Karimi Date: Wed, 17 Feb 2021 19:24:51 -0500 Subject: [PATCH] Add Configuration-Driven NOAA Enhancements Add the ability to drive configuration-driven NOAA enhancements. --- ansible/roles/common/templates/noaa-v2.conf.j2 | 2 ++ ansible/roles/webserver/templates/Config.php.j2 | 4 ++++ config/settings.yml.sample | 6 ++++++ scripts/receive_noaa.sh | 10 +++++++--- webpanel/App/Models/Capture.php | 6 +++++- 5 files changed, 24 insertions(+), 4 deletions(-) diff --git a/ansible/roles/common/templates/noaa-v2.conf.j2 b/ansible/roles/common/templates/noaa-v2.conf.j2 index 819602a0..5b44b307 100644 --- a/ansible/roles/common/templates/noaa-v2.conf.j2 +++ b/ansible/roles/common/templates/noaa-v2.conf.j2 @@ -38,6 +38,8 @@ IMAGE_ANNOTATION_LOCATION={{ image_annotation_location }} GROUND_STATION_LOCATION='{{ ground_station_location }}' SHOW_SUN_ELEVATION={{ show_sun_elevation|lower }} SHOW_PASS_DIRECTION={{ show_pass_direction|lower }} +NOAA_DAY_ENHANCEMENTS='{{ noaa_daytime_enhancements }}' +NOAA_NIGHT_ENHANCEMENTS='{{ noaa_nighttime_enhancements }}' ENABLE_EMAIL_PUSH={{ enable_email_push|lower }} EMAIL_PUSH_ADDRESS={{ email_push_address }} ENABLE_EMAIL_SCHEDULE_PUSH={{ enable_email_schedule_push|lower }} diff --git a/ansible/roles/webserver/templates/Config.php.j2 b/ansible/roles/webserver/templates/Config.php.j2 index 22dec50a..a6932da7 100644 --- a/ansible/roles/webserver/templates/Config.php.j2 +++ b/ansible/roles/webserver/templates/Config.php.j2 @@ -30,6 +30,10 @@ class Config { # how many captures to list on admin page for management const ADMIN_CAPTURES_PER_PAGE = 100; + + # which enhancements to display for day/night + const NOAA_DAY_ENHANCEMENTS = '{{ noaa_daytime_enhancements }}'; + const NOAA_NIGHT_ENHANCEMENTS = '{{ noaa_nighttime_enhancements }}'; } ?> diff --git a/config/settings.yml.sample b/config/settings.yml.sample index b5e78265..4d9c4630 100644 --- a/config/settings.yml.sample +++ b/config/settings.yml.sample @@ -46,6 +46,10 @@ delete_audio: false # annotation (leave blank if you wish to exclude the ground station annotation) # show_sun_elevation - whether to show sun elevation in annotation # show_pass_direction - show which direction the satellite is moving in the image annotation +# noaa_daytime_enhancements - list of enhancements to create images using during daytime captures +# (note: default value is total list of supported image processors) +# noaa_nighttime_enhancements - list of enhancements to create images using during nighttime captures +# (note: default value is total list of supported image processors) flip_meteor_image: true produce_spectrogram: true noaa_crop_telemetry: false @@ -54,6 +58,8 @@ produce_noaa_pristine_image: false ground_station_location: '' show_sun_elevation: false show_pass_direction: false +noaa_daytime_enhancements: 'ZA MCIR MCIR-precip MSA MSA-precip HVC-precip HVCT-precip HVC HVCT therm' +noaa_nighttime_enhancements: 'ZA MCIR MCIR-precip therm' # thresholds for scheduling captures - enables avoiding an attempt # to capture imagery if objects are lower than these degree elevation thresholds diff --git a/scripts/receive_noaa.sh b/scripts/receive_noaa.sh index 9eba7955..b4aa1852 100755 --- a/scripts/receive_noaa.sh +++ b/scripts/receive_noaa.sh @@ -100,9 +100,13 @@ $WXMAP -T "${SAT_NAME}" -H "${TLE_FILE}" -p 0 ${extra_map_opts} -o "${epoch_adju # run all enhancements all the time - any that cannot be produced will # simply be left out/not included, so there is no harm in running all of them -ENHANCEMENTS="ZA MCIR MCIR-precip MSA MSA-precip HVC-precip HVCT-precip HVC HVCT therm" -daylight=0 -if [ "${SUN_ELEV}" -gt "${SUN_MIN_ELEV}" ]; then daylight=1; fi +if [ "${SUN_ELEV}" -gt "${SUN_MIN_ELEV}" ]; then + ENHANCEMENTS="${NOAA_DAY_ENHANCEMENTS}" + daylight=1 +else + ENHANCEMENTS="${NOAA_NIGHT_ENHANCEMENTS}" + daylight=0 +fi # build images based on enhancements defined for enhancement in $ENHANCEMENTS; do diff --git a/webpanel/App/Models/Capture.php b/webpanel/App/Models/Capture.php index 18ec7fed..ced5e56e 100644 --- a/webpanel/App/Models/Capture.php +++ b/webpanel/App/Models/Capture.php @@ -65,7 +65,11 @@ public function getEnhancements($id) { $enhancements = ['-122-rectified.jpg','-col-122-rectified.jpg','-ir-122-rectified.jpg']; break; case 1: // NOAA - $enhancements = ['-ZA.jpg','-MCIR.jpg','-MCIR-precip.jpg','-MSA.jpg','-MSA-precip.jpg','-HVC.jpg','-HVC-precip.jpg','-HVCT.jpg','-HVCT-precip.jpg','-therm.jpg']; + if ($pass['daylight_pass'] == 1) { + $enhancements = array_map(function($x) { return "-" . $x . ".jpg"; }, explode(' ', Config::NOAA_DAY_ENHANCEMENTS)); + } else { + $enhancements = array_map(function($x) { return "-" . $x . ".jpg"; }, explode(' ', Config::NOAA_NIGHT_ENHANCEMENTS)); + } break; }