From 2e32094a54e0da9976b0cc26021950c2dd1738ff Mon Sep 17 00:00:00 2001
From: Ed Safford <62339196+EdwardSafford-NOAA@users.noreply.github.com>
Date: Thu, 6 Feb 2025 10:34:08 -0500
Subject: [PATCH] Add comparison capability to RadMon regional web sites.
(#160)
* Ref #157
Add comparison capability to regional web sites.
* Ref #157
* Ref #157
Make requested changes to default comparison assignments.
---
.../image_gen/html/install_glb.sh | 25 +-
.../image_gen/html/install_rgn.sh | 112 ++---
.../image_gen/html/plot_summary.html.glb | 2 +-
.../image_gen/html/plot_summary.html.rgn | 6 +-
.../image_gen/html/plot_time.html.glb | 24 +-
.../image_gen/html/plot_time.html.rgn | 444 ++++--------------
6 files changed, 184 insertions(+), 429 deletions(-)
diff --git a/src/Radiance_Monitor/image_gen/html/install_glb.sh b/src/Radiance_Monitor/image_gen/html/install_glb.sh
index cdd20f9..74bfddd 100755
--- a/src/Radiance_Monitor/image_gen/html/install_glb.sh
+++ b/src/Radiance_Monitor/image_gen/html/install_glb.sh
@@ -15,14 +15,17 @@ echo ""
echo ""
do_cmp=0
-cmp_src=""
+cmp_src_default="GDAS"
+cmp_src=${cmp_src_default}
+comp_source_value="gdas"
+comp_source_name="Operational GDAS"
#--------------------------------------------------------------
# Allow user to enable comparison plots
#
echo "Do you wish to enable data plots to include comparison to"
-echo " operational GDAS data, or another data source?"
+echo " operational ${cmp_src} data, or another data source?"
echo ""
echo -n " Enter YES to enable comparison plots, any other input to disable. > "
read text
@@ -30,10 +33,9 @@ short=`echo $text | cut -c1`
if [[ $short = "Y" || $short = "y" ]]; then
do_cmp=1
- cmp_src="GDAS"
echo "Please specify the suffix of your comparison data source,"
- echo " or just hit the return key to use the operational GDAS as "
+ echo " or just hit the return key to use the operational ${cmp_src} as "
echo " the comparison source"
echo ""
echo -n " > "
@@ -282,7 +284,7 @@ if [[ $do_cmp == 1 ]]; then
comp_html_files="plot_summary.html plot_time.html"
#-------------------------------------------------------------------------
- # If cmp_src == GDAS we only have to uncomment the comparison check box
+ # If cmp_src == $cmp_src_default we only have to uncomment the comparison check box
# in the html files. If it's another source then we'll have to change
# the values of compSrc, compName, and compHome in the html files.
#
@@ -299,9 +301,9 @@ if [[ $do_cmp == 1 ]]; then
mv -f ${tmp_html} ${html_file}
#---------------------------------------------------------------
- # if we're using a source other than GDAS make that change here
+ # if we're using a source other than $cmp_src_default that change here
#
- if [[ $cmp_src != "GDAS" ]]; then
+ if [[ $cmp_src != ${cmp_src_default} ]]; then
cmp_sc_line=" var compSrc = \"${cmp_src}\";"
cmp_nm_line=" var compName = \"${cmp_src}\";"
cmp_hm_line=" var compHome = \"../${cmp_src}/\";"
@@ -309,7 +311,14 @@ if [[ $do_cmp == 1 ]]; then
sed -i "/var compSrc /c ${cmp_sc_line}" ${html_file}
sed -i "/var compName /c ${cmp_nm_line}" ${html_file}
sed -i "/var compHome /c ${cmp_hm_line}" ${html_file}
+
+ comp_source_value="${cmp_src}"
+ comp_source_name="Experimental $cmp_src"
+
fi
+
+ sed -i "s/COMP_SOURCE_VALUE/${comp_source_value}/" ${html_file}
+ sed -i "s/COMP_SOURCE_NAME/${comp_source_name}/" ${html_file}
done
fi
@@ -331,7 +340,7 @@ new_index="index.html"
$NCP ${RADMON_IMAGE_GEN}/html/${index_file} .
sed s/INSERT_SUFFIX/${SUFFIX}/g $index_file > ${tmp_index}
-if [[ $SUFFIX == "GFS" || $SUFFIX == "nrx" ]]; then
+if [[ $SUFFIX == ${cmp_src_default} ]]; then
sed s/Experimental/Operational/1 ${tmp_index} > ${new_index}
fi
diff --git a/src/Radiance_Monitor/image_gen/html/install_rgn.sh b/src/Radiance_Monitor/image_gen/html/install_rgn.sh
index 385af73..c28f61c 100755
--- a/src/Radiance_Monitor/image_gen/html/install_rgn.sh
+++ b/src/Radiance_Monitor/image_gen/html/install_rgn.sh
@@ -13,38 +13,38 @@ echo "BEGIN install_rgn.sh"
echo ""
do_cmp=0
-cmp_src=""
+cmp_src_default="NAM"
+cmp_src=${cmp_src_default}
+comp_source_value="nam"
+comp_source_name="Operational NAM"
-# This section intentionally left commented out. The comparison
-# option is not yet implemented for regional sources.
#--------------------------------------------------------------
# Allow user to enable comparison plots
#
-#echo "Do you wish to enable data plots to include comparison to"
-#echo " operational GDAS data, or another data source?"
-#echo ""
-#echo -n " Enter YES to enable comparison plots, any other input to disable. > "
-#read text
-#short=`echo $text | cut -c1`
-#
-#if [[ $short = "Y" || $short = "y" ]]; then
-# do_cmp=1
-# cmp_src="GDAS"
-#
-# echo "Please specify the suffix of your comparison data source,"
-# echo " or just hit the return key to use the operational GDAS as "
-# echo " the comparison source"
-# echo ""
-# echo -n " > "
-# read text
-#
-# if [[ ${#text} -gt 0 ]]; then
-# cmp_src=${text}
-# fi
-#
-# echo "${cmp_src} will be used as the comparison source."
-#fi
+echo "Do you wish to enable data plots to include comparison to"
+echo " operational ${cmp_src} data, or another regional data source?"
+echo ""
+echo -n " Enter YES to enable comparison plots, any other input to disable. > "
+read text
+short=`echo $text | cut -c1`
+
+if [[ $short = "Y" || $short = "y" ]]; then
+ do_cmp=1
+
+ echo "Please specify the suffix of your comparison data source,"
+ echo " or just hit the return key to use the operational ${cmp_src} as "
+ echo " the comparison source"
+ echo ""
+ echo -n " > "
+ read text
+
+ if [[ ${#text} -gt 0 ]]; then
+ cmp_src=${text}
+ fi
+
+ echo "${cmp_src} will be used as the comparison source."
+fi
#--------------------------------------------------------------
# Create a temporary working directory.
@@ -65,10 +65,6 @@ cd $workdir
# backwards. If not found stop after 5 days and exit.
#
-#if [[ $RUN == "" ]]; then
-# RUN=gdas
-#fi
-
PDATE=`${MON_USH}/rgn_find_cycle.pl --dir ${TANKverf} --mon radmon`
echo PDATE=$PDATE
@@ -283,40 +279,46 @@ done
# for future implementation.
#
-#if [[ $do_cmp == 1 ]]; then
+if [[ $do_cmp == 1 ]]; then
-# comp_html_files="plot_summary.html plot_time.html"
-
- #-------------------------------------------------------------------------
- # If cmp_src == GDAS we only have to uncomment the comparison check box
- # in the html files. If it's another source then we'll have to change
- # the values of compSrc, compName, and compHome in the html files.
+ comp_html_files="plot_summary.html plot_time.html"
+ #--------------------------------------------------------------------------
+ # If cmp_src == $cmp_src_default we only have to uncomment the comparison
+ # check box in the html files. If it's another source then we'll have to
+ # change the values of compSrc, compName, and compHome in the html files.
#
-# for html_file in $comp_html_files; do
+ for html_file in $comp_html_files; do
-# tmp_html=./tmp_${html_file}
-# rm -f ${tmp_html}
+ tmp_html=./tmp_${html_file}
+ rm -f ${tmp_html}
#----------------------------------------------------------------------------
# remove the OPTIONAL_COMPARE lines which uncomments the comparison check box
-# sed '/OPTIONAL_COMPARE/d' ./${html_file} > ${tmp_html}
-# mv -f ${tmp_html} ${html_file}
+ sed '/OPTIONAL_COMPARE/d' ./${html_file} > ${tmp_html}
+ mv -f ${tmp_html} ${html_file}
#---------------------------------------------------------------
# if we're using a source other than GDAS make that change here
-# if [[ $cmp_src != "GDAS" ]]; then
-# cmp_sc_line=" var compSrc = \"${cmp_src}\";"
-# cmp_nm_line=" var compName = \"${cmp_src}\";"
-# cmp_hm_line=" var compHome = \"../${cmp_src}/\";"
-#
-# sed -i "/var compSrc /c ${cmp_sc_line}" ${html_file}
-# sed -i "/var compName /c ${cmp_nm_line}" ${html_file}
-# sed -i "/var compHome /c ${cmp_hm_line}" ${html_file}
-# fi
-#
-# done
-#fi
+ if [[ ${cmp_src} != ${cmp_src_default} ]]; then
+ cmp_sc_line=" var compSrc = \"${cmp_src}\";"
+ cmp_nm_line=" var compName = \"${cmp_src}\";"
+ cmp_hm_line=" var compHome = \"../${cmp_src}/\";"
+
+ sed -i "/var compSrc /c ${cmp_sc_line}" ${html_file}
+ sed -i "/var compName /c ${cmp_nm_line}" ${html_file}
+ sed -i "/var compHome /c ${cmp_hm_line}" ${html_file}
+
+ comp_source_value="${cmp_src}"
+ comp_source_name="Experimental $cmp_src"
+ fi
+
+ echo "replacing COMP_SOURCE_VALUE"
+ sed -i "s/COMP_SOURCE_VALUE/${comp_source_value}/" ${html_file}
+ sed -i "s/COMP_SOURCE_NAME/${comp_source_name}/" ${html_file}
+
+ done
+fi
#--------------------------------------------------------------
# Generate the intro.html file.
diff --git a/src/Radiance_Monitor/image_gen/html/plot_summary.html.glb b/src/Radiance_Monitor/image_gen/html/plot_summary.html.glb
index d089216..e89b39e 100644
--- a/src/Radiance_Monitor/image_gen/html/plot_summary.html.glb
+++ b/src/Radiance_Monitor/image_gen/html/plot_summary.html.glb
@@ -1090,7 +1090,7 @@
Compare With:
-
+
RM line to install OPTIONAL_COMPARE -->
diff --git a/src/Radiance_Monitor/image_gen/html/plot_summary.html.rgn b/src/Radiance_Monitor/image_gen/html/plot_summary.html.rgn
index 56c5185..9b1f7c8 100644
--- a/src/Radiance_Monitor/image_gen/html/plot_summary.html.rgn
+++ b/src/Radiance_Monitor/image_gen/html/plot_summary.html.rgn
@@ -56,8 +56,8 @@
* name. Email me (Edward dot Safford at noaa dot gov) if you need help making any of that
* happen.
*/
- var compSrc = "wopr";
- var compName = "GDAS";
+ var compSrc = "nam";
+ var compName = "NAM";
var compHome = "https://www.emc.ncep.noaa.gov/gmb/gdas/radiance/esafford/" + compSrc + "/";
/****************************************************************************************
@@ -1067,7 +1067,7 @@
Disclaimer: These are not official NWS products
+ and should not to be relied upon for operational purposes. This web site is not subject to 24/7 support,
+ and thus may be unavailable during system outages. For more information please see this
+ Disclaimer
@@ -1442,7 +1447,7 @@
Compare With:
-
+
RM line to install OPTIONAL_COMPARE -->
@@ -1509,13 +1514,4 @@