diff --git a/apps/landuse/server/main.js b/apps/landuse/server/main.js index da195324ed..8127afc8be 100644 --- a/apps/landuse/server/main.js +++ b/apps/landuse/server/main.js @@ -371,10 +371,14 @@ const doCurveParams = function () { const vgtyps = rows[i].vgtyp; vgtypsModelOptionsMap[model] = vgtyps + .replace(/'|\[|\]/g, "") .split(",") .map(Function.prototype.call, String.prototype.trim) + .filter(function (vgtyp) { + return vgtyp !== "0"; + }) .map(function (vgtyp) { - return allVgtypValuesMap[vgtyp.replace(/'|\[|\]/g, "")]; + return allVgtypValuesMap[vgtyp]; }); } } catch (err) { @@ -549,7 +553,7 @@ const doCurveParams = function () { // 3: sum of model values // 4: sum of obs values // 5: sum of absolute obs-model difference (|bias_0| + |bias_1| + |bias_2| + ... + |bias_n|) - "2m temperature": [ + "Temperature at 2m (°C)": [ "m0.sum2_dt", "m0.N_dt", "m0.sum_dt", @@ -557,7 +561,7 @@ const doCurveParams = function () { "m0.sum_ob_t", "(if(m0.sum_adt is not null,m0.sum_adt,0))", ], - "2m RH": [ + "Relative Humidity at 2m (%)": [ "m0.sum2_drh", "m0.N_drh", "m0.sum_drh", @@ -565,7 +569,7 @@ const doCurveParams = function () { "m0.sum_ob_rh", "0", ], - "2m dewpoint": [ + "Dewpoint at 2m (°C)": [ "m0.sum2_dtd", "m0.N_dtd", "m0.sum_dtd", @@ -573,7 +577,7 @@ const doCurveParams = function () { "m0.sum_ob_td", "(if(m0.sum_adtd is not null,m0.sum_adtd,0))", ], - "10m wind": [ + "Wind Speed at 10m (m/s)": [ "m0.sum2_dw", "m0.N_dw", "m0.sum_ob_ws-m0.sum_model_ws", @@ -585,46 +589,46 @@ const doCurveParams = function () { const statVarUnitMap = { RMSE: { - "2m temperature": "°C", - "2m RH": "RH (%)", - "2m dewpoint": "°C", - "10m wind": "m/s", + "Temperature at 2m (°C)": "°C", + "Relative Humidity at 2m (%)": "RH (%)", + "Dewpoint at 2m (°C)": "°C", + "Wind Speed at 10m (m/s)": "m/s", }, "Bias (Model - Obs)": { - "2m temperature": "°C", - "2m RH": "RH (%)", - "2m dewpoint": "°C", - "10m wind": "m/s", + "Temperature at 2m (°C)": "°C", + "Relative Humidity at 2m (%)": "RH (%)", + "Dewpoint at 2m (°C)": "°C", + "Wind Speed at 10m (m/s)": "m/s", }, N: { - "2m temperature": "Number", - "2m RH": "Number", - "2m dewpoint": "Number", - "10m wind": "Number", + "Temperature at 2m (°C)": "Number", + "Relative Humidity at 2m (%)": "Number", + "Dewpoint at 2m (°C)": "Number", + "Wind Speed at 10m (m/s)": "Number", }, "Model average": { - "2m temperature": "°C", - "2m RH": "RH (%)", - "2m dewpoint": "°C", - "10m wind": "m/s", + "Temperature at 2m (°C)": "°C", + "Relative Humidity at 2m (%)": "RH (%)", + "Dewpoint at 2m (°C)": "°C", + "Wind Speed at 10m (m/s)": "m/s", }, "Obs average": { - "2m temperature": "°C", - "2m RH": "RH (%)", - "2m dewpoint": "°C", - "10m wind": "m/s", + "Temperature at 2m (°C)": "°C", + "Relative Humidity at 2m (%)": "RH (%)", + "Dewpoint at 2m (°C)": "°C", + "Wind Speed at 10m (m/s)": "m/s", }, "Std deviation": { - "2m temperature": "°C", - "2m RH": "RH (%)", - "2m dewpoint": "°C", - "10m wind": "m/s", + "Temperature at 2m (°C)": "°C", + "Relative Humidity at 2m (%)": "RH (%)", + "Dewpoint at 2m (°C)": "°C", + "Wind Speed at 10m (m/s)": "m/s", }, "MAE (temp and dewpoint only)": { - "2m temperature": "°C", - "2m RH": "RH (%)", - "2m dewpoint": "°C", - "10m wind": "m/s", + "Temperature at 2m (°C)": "°C", + "Relative Humidity at 2m (%)": "RH (%)", + "Dewpoint at 2m (°C)": "°C", + "Wind Speed at 10m (m/s)": "m/s", }, }; diff --git a/apps/surface/server/main.js b/apps/surface/server/main.js index 1655857e5e..c6539884e8 100644 --- a/apps/surface/server/main.js +++ b/apps/surface/server/main.js @@ -648,7 +648,7 @@ const doCurveParams = function () { // 4: sum of obs values // 5: sum of absolute obs-model difference (|bias_0| + |bias_1| + |bias_2| + ... + |bias_n|) "Predefined region": { - "2m temperature": [ + "Temperature at 2m (°C)": [ "m0.sum2_dt", "m0.N_dt", "m0.sum_dt", @@ -656,7 +656,7 @@ const doCurveParams = function () { "m0.sum_ob_t", "(if(m0.sum_adt is not null,m0.sum_adt,0))", ], - "2m RH": [ + "Relative Humidity at 2m (%)": [ "m0.sum2_drh", "m0.N_drh", "m0.sum_drh", @@ -664,7 +664,7 @@ const doCurveParams = function () { "m0.sum_ob_rh", "0", ], - "2m dewpoint": [ + "Dewpoint at 2m (°C)": [ "m0.sum2_dtd", "m0.N_dtd", "m0.sum_dtd", @@ -672,7 +672,7 @@ const doCurveParams = function () { "m0.sum_ob_td", "(if(m0.sum_adtd is not null,m0.sum_adtd,0))", ], - "10m wind": [ + "Wind Speed at 10m (m/s)": [ "m0.sum2_dw", "m0.N_dw", "m0.sum_ob_ws-m0.sum_model_ws", @@ -682,7 +682,7 @@ const doCurveParams = function () { ], }, "Select stations": { - "2m temperature": [ + "Temperature at 2m (°C)": [ "pow(o.temp - m0.temp,2)/100", "(o.temp - m0.temp)", "(o.temp - m0.temp)/10", @@ -690,7 +690,7 @@ const doCurveParams = function () { "(if(m0.temp is not null,o.temp,null))/10", "(abs(o.temp - m0.temp))/10", ], - "2m dewpoint": [ + "Dewpoint at 2m (°C)": [ "(pow(o.dp - m0.dp,2))/100", "(o.dp - m0.dp)", "(o.dp - m0.dp)/10", @@ -698,7 +698,7 @@ const doCurveParams = function () { "(if(m0.dp is not null,o.dp,null))/10", "(abs(o.dp - m0.dp))/10", ], - "10m wind": [ + "Wind Speed at 10m (m/s)": [ "(pow(o.ws,2)+pow(m0.ws,2)-2*o.ws*m0.ws*cos((o.wd-m0.wd)/57.2958))", "(o.ws + m0.ws)", "(o.ws - m0.ws)", @@ -711,46 +711,46 @@ const doCurveParams = function () { const statVarUnitMap = { RMSE: { - "2m temperature": "°C", - "2m RH": "RH (%)", - "2m dewpoint": "°C", - "10m wind": "m/s", + "Temperature at 2m (°C)": "°C", + "Relative Humidity at 2m (%)": "RH (%)", + "Dewpoint at 2m (°C)": "°C", + "Wind Speed at 10m (m/s)": "m/s", }, "Bias (Model - Obs)": { - "2m temperature": "°C", - "2m RH": "RH (%)", - "2m dewpoint": "°C", - "10m wind": "m/s", + "Temperature at 2m (°C)": "°C", + "Relative Humidity at 2m (%)": "RH (%)", + "Dewpoint at 2m (°C)": "°C", + "Wind Speed at 10m (m/s)": "m/s", }, N: { - "2m temperature": "Number", - "2m RH": "Number", - "2m dewpoint": "Number", - "10m wind": "Number", + "Temperature at 2m (°C)": "Number", + "Relative Humidity at 2m (%)": "Number", + "Dewpoint at 2m (°C)": "Number", + "Wind Speed at 10m (m/s)": "Number", }, "Model average": { - "2m temperature": "°C", - "2m RH": "RH (%)", - "2m dewpoint": "°C", - "10m wind": "m/s", + "Temperature at 2m (°C)": "°C", + "Relative Humidity at 2m (%)": "RH (%)", + "Dewpoint at 2m (°C)": "°C", + "Wind Speed at 10m (m/s)": "m/s", }, "Obs average": { - "2m temperature": "°C", - "2m RH": "RH (%)", - "2m dewpoint": "°C", - "10m wind": "m/s", + "Temperature at 2m (°C)": "°C", + "Relative Humidity at 2m (%)": "RH (%)", + "Dewpoint at 2m (°C)": "°C", + "Wind Speed at 10m (m/s)": "m/s", }, "Std deviation": { - "2m temperature": "°C", - "2m RH": "RH (%)", - "2m dewpoint": "°C", - "10m wind": "m/s", + "Temperature at 2m (°C)": "°C", + "Relative Humidity at 2m (%)": "RH (%)", + "Dewpoint at 2m (°C)": "°C", + "Wind Speed at 10m (m/s)": "m/s", }, "MAE (temp and dewpoint only)": { - "2m temperature": "°C", - "2m RH": "RH (%)", - "2m dewpoint": "°C", - "10m wind": "m/s", + "Temperature at 2m (°C)": "°C", + "Relative Humidity at 2m (%)": "RH (%)", + "Dewpoint at 2m (°C)": "°C", + "Wind Speed at 10m (m/s)": "m/s", }, }; diff --git a/tests/src/features/landuse/basic/addRemoveScatter.feature b/tests/src/features/landuse/basic/addRemoveScatter.feature index 4b98d2bc3b..f840309f8d 100644 --- a/tests/src/features/landuse/basic/addRemoveScatter.feature +++ b/tests/src/features/landuse/basic/addRemoveScatter.feature @@ -19,12 +19,12 @@ Feature: Add Remove Scatter Then the "data-source" parameter value matches "RAP_GSL" When I change the "x-statistic" parameter to "Bias (Model - Obs)" Then the "x-statistic" parameter value matches "Bias (Model - Obs)" - When I change the "x-variable" parameter to "2m temperature" - Then the "x-variable" parameter value matches "2m temperature" + When I change the "x-variable" parameter to "Temperature at 2m (°C)" + Then the "x-variable" parameter value matches "Temperature at 2m (°C)" When I change the "y-statistic" parameter to "Obs average" Then the "y-statistic" parameter value matches "Obs average" - When I change the "y-variable" parameter to "2m temperature" - Then the "y-variable" parameter value matches "2m temperature" + When I change the "y-variable" parameter to "Temperature at 2m (°C)" + Then the "y-variable" parameter value matches "Temperature at 2m (°C)" When I set the curve-dates to "03/02/2021 00:00 - 03/03/2021 00:00" Then the curve-dates value is "03/02/2021 00:00 - 03/03/2021 00:00" Then I click the "Add Curve" button diff --git a/tests/src/features/landuse/basic/addRemoveTwoScatters.feature b/tests/src/features/landuse/basic/addRemoveTwoScatters.feature index da2967f13d..5a56f91027 100644 --- a/tests/src/features/landuse/basic/addRemoveTwoScatters.feature +++ b/tests/src/features/landuse/basic/addRemoveTwoScatters.feature @@ -22,12 +22,12 @@ Feature: Add Remove Two Scatters Then the "data-source" parameter value matches "RAP_GSL" When I change the "x-statistic" parameter to "Bias (Model - Obs)" Then the "x-statistic" parameter value matches "Bias (Model - Obs)" - When I change the "x-variable" parameter to "2m temperature" - Then the "x-variable" parameter value matches "2m temperature" + When I change the "x-variable" parameter to "Temperature at 2m (°C)" + Then the "x-variable" parameter value matches "Temperature at 2m (°C)" When I change the "y-statistic" parameter to "Obs average" Then the "y-statistic" parameter value matches "Obs average" - When I change the "y-variable" parameter to "2m temperature" - Then the "y-variable" parameter value matches "2m temperature" + When I change the "y-variable" parameter to "Temperature at 2m (°C)" + Then the "y-variable" parameter value matches "Temperature at 2m (°C)" When I set the curve-dates to "03/02/2021 00:00 - 03/03/2021 00:00" Then the curve-dates value is "03/02/2021 00:00 - 03/03/2021 00:00" Then I click the "Add Curve" button diff --git a/tests/src/features/surface/basic/addRemoveScatter.feature b/tests/src/features/surface/basic/addRemoveScatter.feature index 447d190a19..f1d4e6e019 100644 --- a/tests/src/features/surface/basic/addRemoveScatter.feature +++ b/tests/src/features/surface/basic/addRemoveScatter.feature @@ -19,12 +19,12 @@ Feature: Add Remove Scatter Then the "data-source" parameter value matches "RAP_GSL" When I change the "x-statistic" parameter to "Bias (Model - Obs)" Then the "x-statistic" parameter value matches "Bias (Model - Obs)" - When I change the "x-variable" parameter to "2m temperature" - Then the "x-variable" parameter value matches "2m temperature" + When I change the "x-variable" parameter to "Temperature at 2m (°C)" + Then the "x-variable" parameter value matches "Temperature at 2m (°C)" When I change the "y-statistic" parameter to "Obs average" Then the "y-statistic" parameter value matches "Obs average" - When I change the "y-variable" parameter to "2m temperature" - Then the "y-variable" parameter value matches "2m temperature" + When I change the "y-variable" parameter to "Temperature at 2m (°C)" + Then the "y-variable" parameter value matches "Temperature at 2m (°C)" When I set the curve-dates to "09/21/2019 00:00 - 09/24/2019 00:00" Then the curve-dates value is "09/21/2019 00:00 - 09/24/2019 00:00" Then I click the "Add Curve" button diff --git a/tests/src/features/surface/basic/addRemoveTwoScatters.feature b/tests/src/features/surface/basic/addRemoveTwoScatters.feature index 7160ea75fa..c99c9c8a09 100644 --- a/tests/src/features/surface/basic/addRemoveTwoScatters.feature +++ b/tests/src/features/surface/basic/addRemoveTwoScatters.feature @@ -22,12 +22,12 @@ Feature: Add Remove Two Scatters Then the "data-source" parameter value matches "RAP_GSL" When I change the "x-statistic" parameter to "Bias (Model - Obs)" Then the "x-statistic" parameter value matches "Bias (Model - Obs)" - When I change the "x-variable" parameter to "2m temperature" - Then the "x-variable" parameter value matches "2m temperature" + When I change the "x-variable" parameter to "Temperature at 2m (°C)" + Then the "x-variable" parameter value matches "Temperature at 2m (°C)" When I change the "y-statistic" parameter to "Obs average" Then the "y-statistic" parameter value matches "Obs average" - When I change the "y-variable" parameter to "2m temperature" - Then the "y-variable" parameter value matches "2m temperature" + When I change the "y-variable" parameter to "Temperature at 2m (°C)" + Then the "y-variable" parameter value matches "Temperature at 2m (°C)" When I set the curve-dates to "09/21/2019 00:00 - 09/24/2019 00:00" Then the curve-dates value is "09/21/2019 00:00 - 09/24/2019 00:00" Then I click the "Add Curve" button