From b68d13bb4719a85471dc8228f2571f856dfdce9c Mon Sep 17 00:00:00 2001 From: Molly Smith Date: Tue, 23 Apr 2024 13:01:52 -0600 Subject: [PATCH 1/6] Fixed AMDAR template issue --- .../sqlTemplates/tmpl_anomalycor_timeseries.sql | 12 ------------ .../sqlTemplates/tmpl_upperair_timeseries.sql | 2 +- 2 files changed, 1 insertion(+), 13 deletions(-) delete mode 100644 apps/scorecard/server/dataFunctions/sqlTemplates/tmpl_anomalycor_timeseries.sql 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; From 27cfe176c402e6bd549f29bb98ce4f0030bb422e Mon Sep 17 00:00:00 2001 From: Molly Smith Date: Tue, 23 Apr 2024 13:02:16 -0600 Subject: [PATCH 2/6] Regions and fcst lens should be distinct for each scorecard block --- .../server/dataFunctions/processScorecard.js | 36 ++++--------------- 1 file changed, 7 insertions(+), 29 deletions(-) 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; From 8a0558ffdb48f2c8ecf4ace55391ab759c90bd9b Mon Sep 17 00:00:00 2001 From: Molly Smith Date: Tue, 23 Apr 2024 13:55:40 -0600 Subject: [PATCH 3/6] Fixed scorecard bug where app and level wouldn't set correctly --- MATScommon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MATScommon b/MATScommon index 1d3278f47b..a7f7d6a80b 160000 --- a/MATScommon +++ b/MATScommon @@ -1 +1 @@ -Subproject commit 1d3278f47b2f25e77127dea0e55c272b4b017879 +Subproject commit a7f7d6a80b1ef936510841ece096f8683933a54e From 4ef74b6867247b2e8f1bfb755a098ea8c34ae627 Mon Sep 17 00:00:00 2001 From: Molly Smith Date: Tue, 23 Apr 2024 15:23:31 -0600 Subject: [PATCH 4/6] Fixed broken scorecard color selectors --- MATScommon | 2 +- METexpress | 2 +- apps/scorecard/server/main.js | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/MATScommon b/MATScommon index a7f7d6a80b..e90d5d735c 160000 --- a/MATScommon +++ b/MATScommon @@ -1 +1 @@ -Subproject commit a7f7d6a80b1ef936510841ece096f8683933a54e +Subproject commit e90d5d735c71c5b1cc6f1e83fb530c1870c0712c diff --git a/METexpress b/METexpress index 8c6a9906bf..94be9b3f5b 160000 --- a/METexpress +++ b/METexpress @@ -1 +1 @@ -Subproject commit 8c6a9906bfd758a798d7d7cf0258cd2c504e38c0 +Subproject commit 94be9b3f5b98d0c8acb6737c43086328a0711aec 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, From 3ec3b20a8b7f9090e8690c88fd19fd81f310f74e Mon Sep 17 00:00:00 2001 From: Molly Smith Date: Tue, 23 Apr 2024 15:27:50 -0600 Subject: [PATCH 5/6] Updated release notes --- MATScommon | 2 +- METexpress | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MATScommon b/MATScommon index e90d5d735c..5cd5c26991 160000 --- a/MATScommon +++ b/MATScommon @@ -1 +1 @@ -Subproject commit e90d5d735c71c5b1cc6f1e83fb530c1870c0712c +Subproject commit 5cd5c26991423ecfab96f38ae5064d5608ebe77c diff --git a/METexpress b/METexpress index 94be9b3f5b..e0b89d8fa2 160000 --- a/METexpress +++ b/METexpress @@ -1 +1 @@ -Subproject commit 94be9b3f5b98d0c8acb6737c43086328a0711aec +Subproject commit e0b89d8fa28d281365a4a180f3ff6d681aef92dd From 4036a083204da0209b1750a0ea440fb50949d5a5 Mon Sep 17 00:00:00 2001 From: Molly Smith Date: Tue, 23 Apr 2024 16:18:01 -0600 Subject: [PATCH 6/6] Fixed typo --- MATScommon | 2 +- METexpress | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MATScommon b/MATScommon index 5cd5c26991..1f23298fec 160000 --- a/MATScommon +++ b/MATScommon @@ -1 +1 @@ -Subproject commit 5cd5c26991423ecfab96f38ae5064d5608ebe77c +Subproject commit 1f23298fec0e646b0167f7e61d33a36fc479fdbc diff --git a/METexpress b/METexpress index e0b89d8fa2..4d2c19886a 160000 --- a/METexpress +++ b/METexpress @@ -1 +1 @@ -Subproject commit e0b89d8fa28d281365a4a180f3ff6d681aef92dd +Subproject commit 4d2c19886a3cafc2d26ecf6329dfe63aea997875