diff --git a/apps/upperair/server/dataFunctions/data_contour.js b/apps/upperair/server/dataFunctions/data_contour.js index 257c68d5cb..9741d3750f 100644 --- a/apps/upperair/server/dataFunctions/data_contour.js +++ b/apps/upperair/server/dataFunctions/data_contour.js @@ -144,7 +144,11 @@ dataContour = function (plotParams, plotFunction) { // Most of the RAOBs tables don't store a model sum or an obs sum for some reason. // So, we get the obs sum from HRRR_OPS, HRRR_HI, or GFS, because the obs are the same across all models. // Then we get the model sum by adding the obs sum to the bias sum (bias = model-obs). - if (["5", "14", "15", "16", "17", "18"].includes(region.toString())) { + // We exclude GSL's main models, which do have all the sums. + const modelsToExclude = ["ncep_oper_Areg", "RAP_130_Areg", "RAP_Areg", "HRRR_Areg"]; + if (modelsToExclude.includes(model)) { + queryTableClause = `${queryTableClause}, ${databaseRef.sumsDB}.${model}${region} as m1`; + } else if (["5", "14", "15", "16", "17", "18"].includes(region.toString())) { queryTableClause = `${queryTableClause}, ${databaseRef.sumsDB}.HRRR_OPS_Areg${region} as m1`; } else if (region.toString() === "19") { queryTableClause = `${queryTableClause}, ${databaseRef.sumsDB}.HRRR_HI_Areg${region} as m1`; diff --git a/apps/upperair/server/dataFunctions/data_contour_diff.js b/apps/upperair/server/dataFunctions/data_contour_diff.js index 82ad4ef0a1..d79bc31aa0 100644 --- a/apps/upperair/server/dataFunctions/data_contour_diff.js +++ b/apps/upperair/server/dataFunctions/data_contour_diff.js @@ -152,7 +152,16 @@ dataContourDiff = function (plotParams, plotFunction) { // Most of the RAOBs tables don't store a model sum or an obs sum for some reason. // So, we get the obs sum from HRRR_OPS, HRRR_HI, or GFS, because the obs are the same across all models. // Then we get the model sum by adding the obs sum to the bias sum (bias = model-obs). - if (["5", "14", "15", "16", "17", "18"].includes(region.toString())) { + // We exclude GSL's main models, which do have all the sums. + const modelsToExclude = [ + "ncep_oper_Areg", + "RAP_130_Areg", + "RAP_Areg", + "HRRR_Areg", + ]; + if (modelsToExclude.includes(model)) { + queryTableClause = `${queryTableClause}, ${databaseRef.sumsDB}.${model}${region} as m1`; + } else if (["5", "14", "15", "16", "17", "18"].includes(region.toString())) { queryTableClause = `${queryTableClause}, ${databaseRef.sumsDB}.HRRR_OPS_Areg${region} as m1`; } else if (region.toString() === "19") { queryTableClause = `${queryTableClause}, ${databaseRef.sumsDB}.HRRR_HI_Areg${region} as m1`; diff --git a/apps/upperair/server/dataFunctions/data_dailymodelcycle.js b/apps/upperair/server/dataFunctions/data_dailymodelcycle.js index 6cc2caa632..6e0b191eb7 100644 --- a/apps/upperair/server/dataFunctions/data_dailymodelcycle.js +++ b/apps/upperair/server/dataFunctions/data_dailymodelcycle.js @@ -132,7 +132,16 @@ dataDailyModelCycle = function (plotParams, plotFunction) { // Most of the RAOBs tables don't store a model sum or an obs sum for some reason. // So, we get the obs sum from HRRR_OPS, HRRR_HI, or GFS, because the obs are the same across all models. // Then we get the model sum by adding the obs sum to the bias sum (bias = model-obs). - if (["5", "14", "15", "16", "17", "18"].includes(region.toString())) { + // We exclude GSL's main models, which do have all the sums. + const modelsToExclude = [ + "ncep_oper_Areg", + "RAP_130_Areg", + "RAP_Areg", + "HRRR_Areg", + ]; + if (modelsToExclude.includes(model)) { + queryTableClause = `${queryTableClause}, ${databaseRef.sumsDB}.${model}${region} as m1`; + } else if (["5", "14", "15", "16", "17", "18"].includes(region.toString())) { queryTableClause = `${queryTableClause}, ${databaseRef.sumsDB}.HRRR_OPS_Areg${region} as m1`; } else if (region.toString() === "19") { queryTableClause = `${queryTableClause}, ${databaseRef.sumsDB}.HRRR_HI_Areg${region} as m1`; diff --git a/apps/upperair/server/dataFunctions/data_dieoff.js b/apps/upperair/server/dataFunctions/data_dieoff.js index 3fa990f237..2f625c0658 100644 --- a/apps/upperair/server/dataFunctions/data_dieoff.js +++ b/apps/upperair/server/dataFunctions/data_dieoff.js @@ -136,7 +136,16 @@ dataDieoff = function (plotParams, plotFunction) { // Most of the RAOBs tables don't store a model sum or an obs sum for some reason. // So, we get the obs sum from HRRR_OPS, HRRR_HI, or GFS, because the obs are the same across all models. // Then we get the model sum by adding the obs sum to the bias sum (bias = model-obs). - if (["5", "14", "15", "16", "17", "18"].includes(region.toString())) { + // We exclude GSL's main models, which do have all the sums. + const modelsToExclude = [ + "ncep_oper_Areg", + "RAP_130_Areg", + "RAP_Areg", + "HRRR_Areg", + ]; + if (modelsToExclude.includes(model)) { + queryTableClause = `${queryTableClause}, ${databaseRef.sumsDB}.${model}${region} as m1`; + } else if (["5", "14", "15", "16", "17", "18"].includes(region.toString())) { queryTableClause = `${queryTableClause}, ${databaseRef.sumsDB}.HRRR_OPS_Areg${region} as m1`; } else if (region.toString() === "19") { queryTableClause = `${queryTableClause}, ${databaseRef.sumsDB}.HRRR_HI_Areg${region} as m1`; diff --git a/apps/upperair/server/dataFunctions/data_histogram.js b/apps/upperair/server/dataFunctions/data_histogram.js index 1c651df957..144557e9ce 100644 --- a/apps/upperair/server/dataFunctions/data_histogram.js +++ b/apps/upperair/server/dataFunctions/data_histogram.js @@ -131,7 +131,16 @@ dataHistogram = function (plotParams, plotFunction) { // Most of the RAOBs tables don't store a model sum or an obs sum for some reason. // So, we get the obs sum from HRRR_OPS, HRRR_HI, or GFS, because the obs are the same across all models. // Then we get the model sum by adding the obs sum to the bias sum (bias = model-obs). - if (["5", "14", "15", "16", "17", "18"].includes(region.toString())) { + // We exclude GSL's main models, which do have all the sums. + const modelsToExclude = [ + "ncep_oper_Areg", + "RAP_130_Areg", + "RAP_Areg", + "HRRR_Areg", + ]; + if (modelsToExclude.includes(model)) { + queryTableClause = `${queryTableClause}, ${databaseRef.sumsDB}.${model}${region} as m1`; + } else if (["5", "14", "15", "16", "17", "18"].includes(region.toString())) { queryTableClause = `${queryTableClause}, ${databaseRef.sumsDB}.HRRR_OPS_Areg${region} as m1`; } else if (region.toString() === "19") { queryTableClause = `${queryTableClause}, ${databaseRef.sumsDB}.HRRR_HI_Areg${region} as m1`; diff --git a/apps/upperair/server/dataFunctions/data_profile.js b/apps/upperair/server/dataFunctions/data_profile.js index 907b06bf1f..58ffe54f77 100644 --- a/apps/upperair/server/dataFunctions/data_profile.js +++ b/apps/upperair/server/dataFunctions/data_profile.js @@ -129,7 +129,16 @@ dataProfile = function (plotParams, plotFunction) { // Most of the RAOBs tables don't store a model sum or an obs sum for some reason. // So, we get the obs sum from HRRR_OPS, HRRR_HI, or GFS, because the obs are the same across all models. // Then we get the model sum by adding the obs sum to the bias sum (bias = model-obs). - if (["5", "14", "15", "16", "17", "18"].includes(region.toString())) { + // We exclude GSL's main models, which do have all the sums. + const modelsToExclude = [ + "ncep_oper_Areg", + "RAP_130_Areg", + "RAP_Areg", + "HRRR_Areg", + ]; + if (modelsToExclude.includes(model)) { + queryTableClause = `${queryTableClause}, ${databaseRef.sumsDB}.${model}${region} as m1`; + } else if (["5", "14", "15", "16", "17", "18"].includes(region.toString())) { queryTableClause = `${queryTableClause}, ${databaseRef.sumsDB}.HRRR_OPS_Areg${region} as m1`; } else if (region.toString() === "19") { queryTableClause = `${queryTableClause}, ${databaseRef.sumsDB}.HRRR_HI_Areg${region} as m1`; diff --git a/apps/upperair/server/dataFunctions/data_series.js b/apps/upperair/server/dataFunctions/data_series.js index c2f5d55225..2e635dd1c8 100644 --- a/apps/upperair/server/dataFunctions/data_series.js +++ b/apps/upperair/server/dataFunctions/data_series.js @@ -137,7 +137,16 @@ dataSeries = function (plotParams, plotFunction) { // Most of the RAOBs tables don't store a model sum or an obs sum for some reason. // So, we get the obs sum from HRRR_OPS, HRRR_HI, or GFS, because the obs are the same across all models. // Then we get the model sum by adding the obs sum to the bias sum (bias = model-obs). - if (["5", "14", "15", "16", "17", "18"].includes(region.toString())) { + // We exclude GSL's main models, which do have all the sums. + const modelsToExclude = [ + "ncep_oper_Areg", + "RAP_130_Areg", + "RAP_Areg", + "HRRR_Areg", + ]; + if (modelsToExclude.includes(model)) { + queryTableClause = `${queryTableClause}, ${databaseRef.sumsDB}.${model}${region} as m1`; + } else if (["5", "14", "15", "16", "17", "18"].includes(region.toString())) { queryTableClause = `${queryTableClause}, ${databaseRef.sumsDB}.HRRR_OPS_Areg${region} as m1`; } else if (region.toString() === "19") { queryTableClause = `${queryTableClause}, ${databaseRef.sumsDB}.HRRR_HI_Areg${region} as m1`; diff --git a/apps/upperair/server/dataFunctions/data_simple_scatter.js b/apps/upperair/server/dataFunctions/data_simple_scatter.js index eeb918290c..9e388c70e7 100644 --- a/apps/upperair/server/dataFunctions/data_simple_scatter.js +++ b/apps/upperair/server/dataFunctions/data_simple_scatter.js @@ -167,7 +167,16 @@ dataSimpleScatter = function (plotParams, plotFunction) { // Most of the RAOBs tables don't store a model sum or an obs sum for some reason. // So, we get the obs sum from HRRR_OPS, HRRR_HI, or GFS, because the obs are the same across all models. // Then we get the model sum by adding the obs sum to the bias sum (bias = model-obs). - if (["5", "14", "15", "16", "17", "18"].includes(region.toString())) { + // We exclude GSL's main models, which do have all the sums. + const modelsToExclude = [ + "ncep_oper_Areg", + "RAP_130_Areg", + "RAP_Areg", + "HRRR_Areg", + ]; + if (modelsToExclude.includes(model)) { + queryTableClause = `${queryTableClause}, ${databaseRef.sumsDB}.${model}${region} as m1`; + } else if (["5", "14", "15", "16", "17", "18"].includes(region.toString())) { queryTableClause = `${queryTableClause}, ${databaseRef.sumsDB}.HRRR_OPS_Areg${region} as m1`; } else if (region.toString() === "19") { queryTableClause = `${queryTableClause}, ${databaseRef.sumsDB}.HRRR_HI_Areg${region} as m1`; diff --git a/apps/upperair/server/dataFunctions/data_validtime.js b/apps/upperair/server/dataFunctions/data_validtime.js index 34907e9b49..138b23ef45 100644 --- a/apps/upperair/server/dataFunctions/data_validtime.js +++ b/apps/upperair/server/dataFunctions/data_validtime.js @@ -124,7 +124,16 @@ dataValidTime = function (plotParams, plotFunction) { // Most of the RAOBs tables don't store a model sum or an obs sum for some reason. // So, we get the obs sum from HRRR_OPS, HRRR_HI, or GFS, because the obs are the same across all models. // Then we get the model sum by adding the obs sum to the bias sum (bias = model-obs). - if (["5", "14", "15", "16", "17", "18"].includes(region.toString())) { + // We exclude GSL's main models, which do have all the sums. + const modelsToExclude = [ + "ncep_oper_Areg", + "RAP_130_Areg", + "RAP_Areg", + "HRRR_Areg", + ]; + if (modelsToExclude.includes(model)) { + queryTableClause = `${queryTableClause}, ${databaseRef.sumsDB}.${model}${region} as m1`; + } else if (["5", "14", "15", "16", "17", "18"].includes(region.toString())) { queryTableClause = `${queryTableClause}, ${databaseRef.sumsDB}.HRRR_OPS_Areg${region} as m1`; } else if (region.toString() === "19") { queryTableClause = `${queryTableClause}, ${databaseRef.sumsDB}.HRRR_HI_Areg${region} as m1`;