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

Feature met cyclone improvements #163

Merged
merged 6 commits into from
Nov 15, 2024
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
4 changes: 2 additions & 2 deletions apps/met-cyclone/server/dataFunctions/data_dieoff.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dataDieoff = function (plotParams, plotFunction) {
completeness: plotParams.completeness,
outliers: plotParams.outliers,
hideGaps: plotParams.noGapsCheck,
hasLevels: false,
hasLevels: true,
};
const dataRequests = {}; // used to store data queries
const queryArray = [];
Expand Down Expand Up @@ -100,7 +100,7 @@ dataDieoff = function (plotParams, plotFunction) {
thresholdClause = `and h.fcst_thresh = '${threshold}'`;
} else if (statLineType === "precalculated") {
// set up fields specific to precalculated stats
statisticClause = `avg(${statisticOptionsMap[statistic][2]}) as stat, group_concat(distinct ${statisticOptionsMap[statistic][2]}, ';', 9999, ';', unix_timestamp(ld.fcst_valid) order by unix_timestamp(ld.fcst_valid)) as sub_data`;
statisticClause = `avg(${statisticOptionsMap[statistic][2]}) as stat, group_concat(distinct ${statisticOptionsMap[statistic][2]}, ';', 9999, ';', unix_timestamp(ld.fcst_valid), ';', h.storm_id order by unix_timestamp(ld.fcst_valid), h.storm_id) as sub_data`;
statHeaderType = "tcst_header";
[, lineDataType] = statisticOptionsMap[statistic];
modelClause = `and h.amodel = '${model}'`;
Expand Down
4 changes: 2 additions & 2 deletions apps/met-cyclone/server/dataFunctions/data_histogram.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dataHistogram = function (plotParams, plotFunction) {
completeness: plotParams.completeness,
outliers: plotParams.outliers,
hideGaps: plotParams.noGapsCheck,
hasLevels: false,
hasLevels: true,
};
const alreadyMatched = false;
const dataRequests = {}; // used to store data queries
Expand Down Expand Up @@ -102,7 +102,7 @@ dataHistogram = function (plotParams, plotFunction) {
thresholdClause = `and h.fcst_thresh = '${threshold}'`;
} else if (statLineType === "precalculated") {
// set up fields specific to precalculated stats
statisticClause = `avg(${statisticOptionsMap[statistic][2]}) as stat, group_concat(distinct ${statisticOptionsMap[statistic][2]}, ';', 9999, ';', unix_timestamp(ld.fcst_valid) order by unix_timestamp(ld.fcst_valid)) as sub_data`;
statisticClause = `avg(${statisticOptionsMap[statistic][2]}) as stat, group_concat(distinct ${statisticOptionsMap[statistic][2]}, ';', 9999, ';', unix_timestamp(ld.fcst_valid), ';', h.storm_id order by unix_timestamp(ld.fcst_valid), h.storm_id) as sub_data`;
statHeaderType = "tcst_header";
[, lineDataType] = statisticOptionsMap[statistic];
modelClause = `and h.amodel = '${model}'`;
Expand Down
4 changes: 2 additions & 2 deletions apps/met-cyclone/server/dataFunctions/data_series.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dataSeries = function (plotParams, plotFunction) {
completeness: plotParams.completeness,
outliers: plotParams.outliers,
hideGaps: plotParams.noGapsCheck,
hasLevels: false,
hasLevels: true,
};
const dataRequests = {}; // used to store data queries
const queryArray = [];
Expand Down Expand Up @@ -103,7 +103,7 @@ dataSeries = function (plotParams, plotFunction) {
thresholdClause = `and h.fcst_thresh = '${threshold}'`;
} else if (statLineType === "precalculated") {
// set up fields specific to precalculated stats
statisticClause = `avg(${statisticOptionsMap[statistic][2]}) as stat, group_concat(distinct ${statisticOptionsMap[statistic][2]}, ';', 9999, ';', unix_timestamp(ld.fcst_valid) order by unix_timestamp(ld.fcst_valid)) as sub_data`;
statisticClause = `avg(${statisticOptionsMap[statistic][2]}) as stat, group_concat(distinct ${statisticOptionsMap[statistic][2]}, ';', 9999, ';', unix_timestamp(ld.fcst_valid), ';', h.storm_id order by unix_timestamp(ld.fcst_valid), h.storm_id) as sub_data`;
statHeaderType = "tcst_header";
[, lineDataType] = statisticOptionsMap[statistic];
modelClause = `and h.amodel = '${model}'`;
Expand Down
4 changes: 2 additions & 2 deletions apps/met-cyclone/server/dataFunctions/data_validtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dataValidTime = function (plotParams, plotFunction) {
completeness: plotParams.completeness,
outliers: plotParams.outliers,
hideGaps: plotParams.noGapsCheck,
hasLevels: false,
hasLevels: true,
};
const dataRequests = {}; // used to store data queries
const queryArray = [];
Expand Down Expand Up @@ -100,7 +100,7 @@ dataValidTime = function (plotParams, plotFunction) {
thresholdClause = `and h.fcst_thresh = '${threshold}'`;
} else if (statLineType === "precalculated") {
// set up fields specific to precalculated stats
statisticClause = `avg(${statisticOptionsMap[statistic][2]}) as stat, group_concat(distinct ${statisticOptionsMap[statistic][2]}, ';', 9999, ';', unix_timestamp(ld.fcst_valid) order by unix_timestamp(ld.fcst_valid)) as sub_data`;
statisticClause = `avg(${statisticOptionsMap[statistic][2]}) as stat, group_concat(distinct ${statisticOptionsMap[statistic][2]}, ';', 9999, ';', unix_timestamp(ld.fcst_valid), ';', h.storm_id order by unix_timestamp(ld.fcst_valid), h.storm_id) as sub_data`;
statHeaderType = "tcst_header";
[, lineDataType] = statisticOptionsMap[statistic];
modelClause = `and h.amodel = '${model}'`;
Expand Down
4 changes: 2 additions & 2 deletions apps/met-cyclone/server/dataFunctions/data_yeartoyear.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dataYearToYear = function (plotParams, plotFunction) {
completeness: plotParams.completeness,
outliers: plotParams.outliers,
hideGaps: plotParams.noGapsCheck,
hasLevels: false,
hasLevels: true,
};
const dataRequests = {}; // used to store data queries
const queryArray = [];
Expand Down Expand Up @@ -99,7 +99,7 @@ dataYearToYear = function (plotParams, plotFunction) {
thresholdClause = `and h.fcst_thresh = '${threshold}'`;
} else if (statLineType === "precalculated") {
// set up fields specific to precalculated stats
statisticClause = `avg(${statisticOptionsMap[statistic][2]}) as stat, group_concat(distinct ${statisticOptionsMap[statistic][2]}, ';', 9999, ';', unix_timestamp(ld.fcst_valid) order by unix_timestamp(ld.fcst_valid)) as sub_data`;
statisticClause = `avg(${statisticOptionsMap[statistic][2]}) as stat, group_concat(distinct ${statisticOptionsMap[statistic][2]}, ';', 9999, ';', unix_timestamp(ld.fcst_valid), ';', h.storm_id order by unix_timestamp(ld.fcst_valid), h.storm_id) as sub_data`;
statHeaderType = "tcst_header";
[, lineDataType] = statisticOptionsMap[statistic];
modelClause = `and h.amodel = '${model}'`;
Expand Down
14 changes: 7 additions & 7 deletions apps/met-cyclone/server/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,14 +299,14 @@ const doCurveParams = function () {
"Model-truth distance to land (nm)": [
"precalculated",
"line_data_tcmpr",
"ld.adland-ld.bdland",
"if(ld.adland != -9999 and ld.bdland != -9999,ld.adland-ld.bdland,null)",
],
"Model MSLP (mb)": ["precalculated", "line_data_tcmpr", "ld.amslp"],
"Truth MSLP (mb)": ["precalculated", "line_data_tcmpr", "ld.bmslp"],
"Model-truth MSLP (mb)": [
"precalculated",
"line_data_tcmpr",
"ld.amslp-ld.bmslp",
"if(ld.amslp != -9999 and ld.bmslp != -9999,ld.amslp-ld.bmslp,null)",
],
"Model maximum wind speed (kts)": [
"precalculated",
Expand All @@ -321,7 +321,7 @@ const doCurveParams = function () {
"Model-truth maximum wind speed (kts)": [
"precalculated",
"line_data_tcmpr",
"ld.amax_wind-ld.bmax_wind",
"if(ld.amax_wind != -9999 and ld.bmax_wind != -9999,ld.amax_wind-ld.bmax_wind,null)",
],
"Model radius of maximum winds (nm)": [
"precalculated",
Expand All @@ -336,28 +336,28 @@ const doCurveParams = function () {
"Model-truth radius of maximum winds (nm)": [
"precalculated",
"line_data_tcmpr",
"ld.amrd-ld.bmrd",
"if(ld.amrd != -9999 and ld.bmrd != -9999,ld.amrd-ld.bmrd,null)",
],
"Model eye diameter (nm)": ["precalculated", "line_data_tcmpr", "ld.aeye"],
"Truth eye diameter (nm)": ["precalculated", "line_data_tcmpr", "ld.beye"],
"Model-truth eye diameter (nm)": [
"precalculated",
"line_data_tcmpr",
"ld.aeye-ld.beye",
"if(ld.aeye != -9999 and ld.beye != -9999,ld.aeye-ld.beye,null)",
],
"Model storm speed (kts)": ["precalculated", "line_data_tcmpr", "ld.aspeed"],
"Truth storm speed (kts)": ["precalculated", "line_data_tcmpr", "ld.bspeed"],
"Model-truth storm speed (kts)": [
"precalculated",
"line_data_tcmpr",
"ld.aspeed-ld.bspeed",
"if(ld.aspeed != -9999 and ld.bspeed != -9999,ld.aspeed-ld.bspeed,null)",
],
"Model storm direction (deg)": ["precalculated", "line_data_tcmpr", "ld.adir"],
"Truth storm direction (deg)": ["precalculated", "line_data_tcmpr", "ld.bdir"],
"Model-truth storm direction (deg)": [
"precalculated",
"line_data_tcmpr",
"ld.adir-ld.bdir",
"if(ld.adir != -9999 and ld.bdir != -9999,ld.adir-ld.bdir,null)",
],
},
line_data_ctc: {
Expand Down
Loading