Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add comparison capability to RadMon regional web sites. #160

Merged
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
25 changes: 17 additions & 8 deletions src/Radiance_Monitor/image_gen/html/install_glb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,27 @@ 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
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 " > "
Expand Down Expand Up @@ -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.
#
Expand All @@ -299,17 +301,24 @@ 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}/\";"

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

Expand Down
112 changes: 57 additions & 55 deletions src/Radiance_Monitor/image_gen/html/install_rgn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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

Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/Radiance_Monitor/image_gen/html/plot_summary.html.glb
Original file line number Diff line number Diff line change
Expand Up @@ -1090,7 +1090,7 @@
<table style="position:absolute;left:1px;top:80px;width:150px" id="compareTable">
<caption style="test-indent:2em"> <b>Compare With:</b> </caption>
<tr><td>
<input type="checkbox" id="ckboxCmp" name="ckboxCmp" value="gfs" onclick="boxCheck(this.value)"><label id="ckboxCompLbl" for="ckboxCmp">operational GDAS</label></input>
<input type="checkbox" id="ckboxCmp" name="ckboxCmp" value="COMP_SOURCE_VALUE" onclick="boxCheck(this.value)"> <label for="ckboxCmp">COMP_SOURCE_NAME</label></input>
</td></tr>
</table>
RM line to install OPTIONAL_COMPARE -->
Expand Down
6 changes: 3 additions & 3 deletions src/Radiance_Monitor/image_gen/html/plot_summary.html.rgn
Original file line number Diff line number Diff line change
Expand Up @@ -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 + "/";

/****************************************************************************************
Expand Down Expand Up @@ -1067,7 +1067,7 @@
<table style="position:absolute;left:1px;top:80px;width:150px" id="compareTable">
<caption style="test-indent:2em"> <b>Compare With:</b> </caption>
<tr><td>
<input type="checkbox" id="ckboxCmp" name="ckboxCmp" value="wopr" onclick="boxCheck(this.value)"><label for="ckboxCmp">operational GDAS</label></input>
<input type="checkbox" id="ckboxCmp" name="ckboxCmp" value="COMP_SOURCE_VALUE" onclick="boxCheck(this.value)"><label for="ckboxCmp">COMP_SOURCE_NAME</label></input>
</td></tr>
</table>
RM line to install OPTIONAL_COMPARE -->
Expand Down
24 changes: 10 additions & 14 deletions src/Radiance_Monitor/image_gen/html/plot_time.html.glb
Original file line number Diff line number Diff line change
Expand Up @@ -909,14 +909,14 @@

// set chart titles
if (curStatName === 'omgnbc') { // omgnbc avg & sdv
chartTitle1 = "Avg Ges|Anl (w/o Bias Correction) - Obs(K)\n" + line2;
chartTitle2 = "Sdv Ges|Anl (w/o Bias Correction) - Obs(K)\n" + line2;
chartTitle1 = "Avg Obs - Ges|Anl (w/o Bias Correction)(K)\n" + line2;
chartTitle2 = "Sdv Obs - Ges|Anl (w/o Bias Correction)(K)\n" + line2;
} else if (curStatName === 'totcor') { // bias correction
chartTitle1 = "Avg Bias Correction\n" + line2;
chartTitle2 = "Sdv Bias Correction\n" + line2;
} else if (curStatName === 'omgbc') { // omgbc avg & sdv
chartTitle1 = "Avg Ges|Anl (w/ Bias Correction) - Obs(K)\n" + line2;
chartTitle2 = "Sdv Ges|Anl (w/ Bias Correction) - Obs(K)\n" + line2;
chartTitle1 = "Avg Obs - Ges|Anl (w/ Bias Correction)(K)\n" + line2;
chartTitle2 = "Sdv Obs - Ges|Anl (w/ Bias Correction)(K)\n" + line2;
} else if( curStatName === 'fixang') {
chartTitle1 = "Avg Fixed Angle Correction (K)\n" + line2;
chartTitle2 = "Sdv Fixed Angle Correction (K)\n" + line2;
Expand Down Expand Up @@ -1358,6 +1358,11 @@
<div id="png1" class="link1"></div>
<div id="plot2" style="width: 1000px; height: 400px; float:right;"></div>
<div id="png2" class="link2"></div>
<div id="disclaim" style="width: 1000px; float:right">^M
<P style="background-color: lightblue;"><u><b>Disclaimer:</b></u> 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
<a href="https://www.weather.gov/disclaimer.php">Disclaimer</a> </P> </div>

<label id="source" style="position: absolute; left: 2px; top:12px"><b> Source:</b></label>
<label id="suffix" value="INSERT_SUFFIX" style="position: absolute; left: 72px; top:12px; color: blue"><b>INSERT_SUFFIX</b></label>
Expand Down Expand Up @@ -1442,7 +1447,7 @@
<table style="position:absolute;left:2px;top:150px;width:150px" id="compareTable">
<caption style="test-indent:2em"> <b>Compare With:</b> </caption>
<tr><td>
<input type="checkbox" id="ckboxCmp" name="ckboxCmp" value="gfs" onclick="boxCheck(this.value)"><label id="ckboxCompLbl" for="ckboxCmp">operational GDAS</label></input>
<input type="checkbox" id="ckboxCmp" name="ckboxCmp" value="COMP_SOURCE_VALUE" onclick="boxCheck(this.value)"><label for="ckboxCmp">COMP_SOURCE_NAME</label></input>
</td></tr>
</table>
RM line to install OPTIONAL_COMPARE -->
Expand Down Expand Up @@ -1509,13 +1514,4 @@

</BODY>

<footer>
<P style="background-color: lightblue;"><u><b>Disclaimer:</b></u> 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
<a href="https://www.weather.gov/disclaimer.php">Disclaimer</a>
</P>
</footer>

</HTML>
Loading