Skip to content

Commit

Permalink
Modified MATScommon use of assets
Browse files Browse the repository at this point in the history
  • Loading branch information
mollybsmith-noaa committed Oct 12, 2023
1 parent 713cfad commit 7fdcaef
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ class MatsMiddleCommon {

const startTime = new Date().valueOf();

let queryTemplate = fs.readFileSync(
"assets/app/matsMiddle/sqlTemplates/tmpl_distinct_fcstValidEpoch_obs.sql",
"utf-8"
let queryTemplate = Assets.getText(
"matsMiddle/sqlTemplates/tmpl_distinct_fcstValidEpoch_obs.sql"
);
queryTemplate = queryTemplate.replace(/{{vxFROM_SECS}}/g, fromSecs);
queryTemplate = queryTemplate.replace(/{{vxTO_SECS}}/g, toSecs);
Expand Down Expand Up @@ -56,9 +55,8 @@ class MatsMiddleCommon {

const startTime = new Date().valueOf();

let queryTemplate = fs.readFileSync(
"assets/app/matsMiddle/sqlTemplates/tmpl_get_distinct_fcstLen.sql",
"utf-8"
let queryTemplate = Assets.getText(
"matsMiddle/sqlTemplates/tmpl_get_distinct_fcstLen.sql"
);
queryTemplate = queryTemplate.replace(/{{vxMODEL}}/g, `"${model}"`);
queryTemplate = queryTemplate.replace(/{{vxFROM_SECS}}/g, fromSecs);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,8 @@ class MatsMiddleDailyModelCycle {

const startTime = new Date().valueOf();

const tmpl_get_N_stations_mfve_obs = fs.readFileSync(
"assets/app/matsMiddle/sqlTemplates/tmpl_get_N_stations_mfve_IN_obs.sql",
"utf-8"
const tmpl_get_N_stations_mfve_obs = Assets.getText(
"matsMiddle/sqlTemplates/tmpl_get_N_stations_mfve_IN_obs.sql"
);

let stationNames_obs = "";
Expand Down Expand Up @@ -220,9 +219,8 @@ class MatsMiddleDailyModelCycle {

const startTime = new Date().valueOf();

let tmpl_get_N_stations_mfve_model = fs.readFileSync(
"assets/app/matsMiddle/sqlTemplates/tmpl_get_N_stations_mfve_IN_model.sql",
"utf-8"
let tmpl_get_N_stations_mfve_model = Assets.getText(
"matsMiddle/sqlTemplates/tmpl_get_N_stations_mfve_IN_model.sql"
);
/*
tmpl_get_N_stations_mfve_model = this.cbPool.trfmSQLRemoveClause(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,8 @@ class MatsMiddleDieoff {

const startTime = new Date().valueOf();

const tmpl_get_N_stations_mfve_obs = fs.readFileSync(
"assets/app/matsMiddle/sqlTemplates/tmpl_get_N_stations_mfve_IN_obs.sql",
"utf-8"
const tmpl_get_N_stations_mfve_obs = Assets.getText(
"matsMiddle/sqlTemplates/tmpl_get_N_stations_mfve_IN_obs.sql"
);

let stationNames_obs = "";
Expand Down Expand Up @@ -258,9 +257,8 @@ class MatsMiddleDieoff {

const startTime = new Date().valueOf();

let tmpl_get_N_stations_mfve_model = fs.readFileSync(
"assets/app/matsMiddle/sqlTemplates/tmpl_get_N_stations_mfve_IN_model.sql",
"utf-8"
let tmpl_get_N_stations_mfve_model = Assets.getText(
"matsMiddle/sqlTemplates/tmpl_get_N_stations_mfve_IN_model.sql"
);
tmpl_get_N_stations_mfve_model = this.cbPool.trfmSQLRemoveClause(
tmpl_get_N_stations_mfve_model,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,8 @@ class MatsMiddleMap {

const startTime = new Date().valueOf();

const tmpl_get_N_stations_mfve_obs = fs.readFileSync(
"assets/app/matsMiddle/sqlTemplates/tmpl_get_N_stations_mfve_IN_obs.sql",
"utf-8"
const tmpl_get_N_stations_mfve_obs = Assets.getText(
"matsMiddle/sqlTemplates/tmpl_get_N_stations_mfve_IN_obs.sql"
);

this.fveObs = {};
Expand Down Expand Up @@ -254,9 +253,8 @@ class MatsMiddleMap {

this.fveModels = {};

let tmpl_get_N_stations_mfve_model = fs.readFileSync(
"assets/app/matsMiddle/sqlTemplates/tmpl_get_N_stations_mfve_IN_model.sql",
"utf-8"
let tmpl_get_N_stations_mfve_model = Assets.getText(
"matsMiddle/sqlTemplates/tmpl_get_N_stations_mfve_IN_model.sql"
);
tmpl_get_N_stations_mfve_model = this.cbPool.trfmSQLRemoveClause(
tmpl_get_N_stations_mfve_model,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,8 @@ class MatsMiddleTimeSeries {

const startTime = new Date().valueOf();

const tmpl_get_N_stations_mfve_obs = fs.readFileSync(
"assets/app/matsMiddle/sqlTemplates/tmpl_get_N_stations_mfve_IN_obs.sql",
"utf-8"
const tmpl_get_N_stations_mfve_obs = Assets.getText(
"matsMiddle/sqlTemplates/tmpl_get_N_stations_mfve_IN_obs.sql"
);

let stationNames_obs = "";
Expand Down Expand Up @@ -241,9 +240,8 @@ class MatsMiddleTimeSeries {

const startTime = new Date().valueOf();

let tmpl_get_N_stations_mfve_model = fs.readFileSync(
"assets/app/matsMiddle/sqlTemplates/tmpl_get_N_stations_mfve_IN_model.sql",
"utf-8"
let tmpl_get_N_stations_mfve_model = Assets.getText(
"matsMiddle/sqlTemplates/tmpl_get_N_stations_mfve_IN_model.sql"
);
tmpl_get_N_stations_mfve_model = this.cbPool.trfmSQLRemoveClause(
tmpl_get_N_stations_mfve_model,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,8 @@ class MatsMiddleTsDieoff {

const startTime = new Date().valueOf();

const tmpl_get_N_stations_mfve_obs = fs.readFileSync(
"assets/app/matsMiddle/sqlTemplates/tmpl_get_N_stations_mfve_IN_obs.sql",
"utf-8"
const tmpl_get_N_stations_mfve_obs = Assets.getText(
"matsMiddle/sqlTemplates/tmpl_get_N_stations_mfve_IN_obs.sql"
);

let stationNames_obs = "";
Expand Down Expand Up @@ -277,9 +276,8 @@ class MatsMiddleTsDieoff {

const startTime = new Date().valueOf();

let tmpl_get_N_stations_mfve_model = fs.readFileSync(
"assets/app/matsMiddle/sqlTemplates/tmpl_get_N_stations_mfve_IN_model.sql",
"utf-8"
let tmpl_get_N_stations_mfve_model = Assets.getText(
"matsMiddle/sqlTemplates/tmpl_get_N_stations_mfve_IN_model.sql"
);
tmpl_get_N_stations_mfve_model = tmpl_get_N_stations_mfve_model.replace(
/{{vxMODEL}}/g,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,8 @@ class MatsMiddleValidTime {

const startTime = new Date().valueOf();

const tmpl_get_N_stations_mfve_obs = fs.readFileSync(
"assets/app/matsMiddle/sqlTemplates/tmpl_get_N_stations_mfve_IN_obs.sql",
"utf-8"
const tmpl_get_N_stations_mfve_obs = Assets.getText(
"matsMiddle/sqlTemplates/tmpl_get_N_stations_mfve_IN_obs.sql"
);

let stationNames_obs = "";
Expand Down Expand Up @@ -236,9 +235,8 @@ class MatsMiddleValidTime {

const startTime = new Date().valueOf();

let tmpl_get_N_stations_mfve_model = fs.readFileSync(
"assets/app/matsMiddle/sqlTemplates/tmpl_get_N_stations_mfve_IN_model.sql",
"utf-8"
let tmpl_get_N_stations_mfve_model = Assets.getText(
"matsMiddle/sqlTemplates/tmpl_get_N_stations_mfve_IN_model.sql"
);
tmpl_get_N_stations_mfve_model = this.cbPool.trfmSQLRemoveClause(
tmpl_get_N_stations_mfve_model,
Expand Down

0 comments on commit 7fdcaef

Please sign in to comment.