diff --git a/MATScommon b/MATScommon index 1d3278f47b..1f23298fec 160000 --- a/MATScommon +++ b/MATScommon @@ -1 +1 @@ -Subproject commit 1d3278f47b2f25e77127dea0e55c272b4b017879 +Subproject commit 1f23298fec0e646b0167f7e61d33a36fc479fdbc diff --git a/METexpress b/METexpress index 8c6a9906bf..4d2c19886a 160000 --- a/METexpress +++ b/METexpress @@ -1 +1 @@ -Subproject commit 8c6a9906bfd758a798d7d7cf0258cd2c504e38c0 +Subproject commit 4d2c19886a3cafc2d26ecf6329dfe63aea997875 diff --git a/apps/scorecard/server/dataFunctions/processScorecard.js b/apps/scorecard/server/dataFunctions/processScorecard.js index 84ae4e140a..1810f07afd 100644 --- a/apps/scorecard/server/dataFunctions/processScorecard.js +++ b/apps/scorecard/server/dataFunctions/processScorecard.js @@ -28,19 +28,16 @@ const dealWithUATables = function ( // get obs partial sums from the GFS secondaryModelOption = `, ${databaseValue}.GFS_Areg${regionValue} as m1`; } - // RAOB tables don't have phases, but we use the clause to facilitate the table join + // facilitate the table join updatedQueryTemplate = updatedQueryTemplate.replace( - /\{\{phaseClause\}\}/g, + /\{\{joinClause\}\}/g, "AND m0.date = m1.date AND m0.hour = m1.hour AND m0.mb10 = m1.mb10" ); } else { // AMDAR tables have all partial sums so we can get them all from the main table updatedQueryTemplate = updatedQueryTemplate.replace(/m1/g, "m0"); - // AMDAR tables have phases - updatedQueryTemplate = updatedQueryTemplate.replace( - /\{\{phaseClause\}\}/g, - "AND m0.up_dn = 2" - ); + // no need to join + updatedQueryTemplate = updatedQueryTemplate.replace(/\{\{joinClause\}\}/g, ""); } // either add the m1 clause to the template or remove the secondary model option entirely updatedQueryTemplate = updatedQueryTemplate.replace( @@ -179,28 +176,6 @@ processScorecard = function (plotParams, plotFunction) { dateRange = plotParams.dates; } - // get the union of the fcst-length arrays of all the curves - const fcstLengthsSet = new Set(); - plotParams.curves.forEach(function (curve) { - if (!curve["forecast-length"]) { - fcstLengthsSet.add("0"); - } else { - curve["forecast-length"].forEach(function (fcl) { - fcstLengthsSet.add(fcl); - }); - } - }); - const fcstLengths = Array.from(fcstLengthsSet); - - // get the union of all the regions of all the curves - const regionsSet = new Set(); - plotParams.curves.forEach(function (curve) { - curve.region.forEach(function (r) { - regionsSet.add(r); - }); - }); - const regions = Array.from(regionsSet); - // create an id for the document let idDateRange = dateRange.replace(/ /g, "_"); idDateRange = idDateRange.replace(/:/g, "_"); @@ -386,6 +361,9 @@ processScorecard = function (plotParams, plotFunction) { // create the empty object for this block const { label } = curve; + const fcstLengths = + curve["forecast-length"] === undefined ? [] : curve["forecast-length"]; + const regions = curve.region === undefined ? [] : curve.region; // duplicate the curve so we're not modifying a function parameter, which the linter doesn't like const scorecardCurve = curve; diff --git a/apps/scorecard/server/dataFunctions/sqlTemplates/tmpl_anomalycor_timeseries.sql b/apps/scorecard/server/dataFunctions/sqlTemplates/tmpl_anomalycor_timeseries.sql deleted file mode 100644 index c04044b2cc..0000000000 --- a/apps/scorecard/server/dataFunctions/sqlTemplates/tmpl_anomalycor_timeseries.sql +++ /dev/null @@ -1,12 +0,0 @@ -SELECT unix_timestamp(m0.valid_date) + 3600 * m0.valid_hour AS avtime, - AVG(m0.wacorr/100) AS stat - FROM {{database}}.{{model}}_anomcorr_{{region}} AS m0 - WHERE 1=1 - AND unix_timestamp(m0.valid_date)+3600*m0.valid_hour >= {{fromSecs}} - AND unix_timestamp(m0.valid_date)+3600*m0.valid_hour <= {{toSecs}} - AND m0.valid_hour IN({{validTimes}}) - AND m0.variable = '{{variable}}' - AND m0.fcst_len = {{forecastLength}} - AND m0.level = {{level}} - GROUP BY avtime - ORDER BY avtime; diff --git a/apps/scorecard/server/dataFunctions/sqlTemplates/tmpl_upperair_timeseries.sql b/apps/scorecard/server/dataFunctions/sqlTemplates/tmpl_upperair_timeseries.sql index d1aa27fe80..db54204366 100644 --- a/apps/scorecard/server/dataFunctions/sqlTemplates/tmpl_upperair_timeseries.sql +++ b/apps/scorecard/server/dataFunctions/sqlTemplates/tmpl_upperair_timeseries.sql @@ -12,6 +12,6 @@ SELECT unix_timestamp(m0.date)+3600*m0.hour AS avtime, AND m0.hour IN({{validTimes}}) AND m0.fcst_len = {{forecastLength}} AND m0.mb10*10 = {{level}} - {{phaseClause}} + {{joinClause}} GROUP BY avtime ORDER BY avtime; diff --git a/apps/scorecard/server/main.js b/apps/scorecard/server/main.js index faed40c55d..6b1e80872e 100644 --- a/apps/scorecard/server/main.js +++ b/apps/scorecard/server/main.js @@ -500,7 +500,7 @@ const doPlotParams = function () { type: matsTypes.InputTypes.radioGroup, options: ["RedGreen", "RedBlue"], controlButtonCovered: false, - default: "RedGreen", + default: "RedBlue", controlButtonVisibility: "block", displayOrder: 1, displayPriority: 1, @@ -574,7 +574,7 @@ const doPlotParams = function () { controlButtonCovered: true, controlButtonText: " ", controlButtonFA: "fa-sm fa-solid fa-caret-up", - default: "#00ff00", + default: "#0000ff", controlButtonVisibility: "block", displayOrder: 4, displayPriority: 1, @@ -599,7 +599,7 @@ const doPlotParams = function () { controlButtonCovered: true, controlButtonText: " ", controlButtonFA: "fa-xl fa-solid fa-caret-up", - default: "#00ff00", + default: "#0000ff", controlButtonVisibility: "block", displayOrder: 5, displayPriority: 1,