From 55ba6aad6b15fbd541f508ae6a776e3d2792a65e Mon Sep 17 00:00:00 2001 From: Stephen Gilbert Date: Wed, 23 Jul 2014 15:51:27 -0400 Subject: [PATCH] VLab Issue #4001 - NCEP EDEX and EDEX Common delivery for 14.2.1-n NcText decoder updates and other ingest config changes Change-Id: I1dca245ff36c565c924a494eae3f1a2b834f43ac Former-commit-id: c16e83f25a286054798d42066d4993da88391b6e [formerly 9e47362ce407ea03c0ede8884baa7e8129d2d646] Former-commit-id: f94a3aadf468d074dc4ebf8d0cc28d732a2925fe --- .../addNcepNwxAdminMessageGpTable.sql | 158 ++ .../14.2.1-n3/updateNcepNwxAdminTables.sh | 5 + edexOsgi/build.edex/build.xml | 4 + .../ncep/addNcepNwxAdminMessageGpTable.sql | 157 ++ .../opt/db/ddl/ncep/createNcepNwxTables.sql | 113 +- .../build.edex/opt/db/ddl/ncep/loadNcepNwx.sh | 1 + .../loadNwxAdminMessagesBulletinTables.sql | 40 + .../ddl/ncep/loadNwxMasterAndGuiProducts.sql | 15 +- .../loadNwxObservedDataBulletinTables.sql | 4 +- .../base/grib/grids/ECMWF-wave-0p25deg.xml | 35 + .../base/grib/grids/grid1440721001.xml | 32 + .../edex_static/base/grib/grids/grid193.xml | 34 + .../base/grib/models/gribModels_ECMWF-98.xml | 18 +- .../edex_static/base/distribution/sfcobs.xml | 11 +- .../res/pointdata/airepdb.xml | 4 +- .../res/scripts/inputFileType.sql | 7 + .../nctext/decoder/NctextRegexMatcher.java | 1438 ++++++++++++----- .../nctext/decoder/NctextSeparator.java | 697 ++++---- .../res/pointdata/pirepdb.xml | 16 + .../edex_static/base/distribution/pirep.xml | 1 + .../edex_static/base/distribution/tcm.xml | 2 +- .../Installer.ncep-database/component.spec | 2 + 22 files changed, 1953 insertions(+), 841 deletions(-) create mode 100644 deltaScripts/14.2.1-n3/addNcepNwxAdminMessageGpTable.sql create mode 100644 deltaScripts/14.2.1-n3/updateNcepNwxAdminTables.sh create mode 100644 edexOsgi/build.edex/opt/db/ddl/ncep/addNcepNwxAdminMessageGpTable.sql create mode 100644 edexOsgi/build.edex/opt/db/ddl/ncep/loadNwxAdminMessagesBulletinTables.sql create mode 100644 edexOsgi/com.raytheon.edex.plugin.grib/utility/edex_static/base/grib/grids/ECMWF-wave-0p25deg.xml create mode 100644 edexOsgi/com.raytheon.edex.plugin.grib/utility/edex_static/base/grib/grids/grid1440721001.xml create mode 100644 edexOsgi/com.raytheon.edex.plugin.grib/utility/edex_static/base/grib/grids/grid193.xml create mode 100644 ncep/gov.noaa.nws.ncep.edex.plugin.pirep/res/pointdata/pirepdb.xml diff --git a/deltaScripts/14.2.1-n3/addNcepNwxAdminMessageGpTable.sql b/deltaScripts/14.2.1-n3/addNcepNwxAdminMessageGpTable.sql new file mode 100644 index 0000000000..9647c8378a --- /dev/null +++ b/deltaScripts/14.2.1-n3/addNcepNwxAdminMessageGpTable.sql @@ -0,0 +1,158 @@ +-- create nwx.adminmessages table +DROP TABLE IF EXISTS nwx.adminmessages CASCADE; +CREATE TABLE nwx.adminmessages( +id SERIAL PRIMARY KEY, +productname varchar(60) NOT NULL, +producttablename varchar(30) NOT NULL, +producttype varchar(20) NOT NULL +); + +-- create nwx.cmcam table +DROP TABLE IF EXISTS nwx.cmcam CASCADE; +CREATE TABLE nwx.cmcam( +id SERIAL PRIMARY KEY, + productid varchar(6) NOT NULL, + stnid varchar(8) NOT NULL, + stnname varchar(32) NOT NULL, + state varchar(2) NOT NULL, + country varchar(2) NOT NULL, + latitude double precision NOT NULL, + longitude double precision NOT NULL, + elevation int NOT NULL +); + +-- create nwx.ncfam table +DROP TABLE IF EXISTS nwx.ncfam CASCADE; +CREATE TABLE nwx.ncfam( +id SERIAL PRIMARY KEY, + productid varchar(6) NOT NULL, + stnid varchar(8) NOT NULL, + stnname varchar(32) NOT NULL, + state varchar(2) NOT NULL, + country varchar(2) NOT NULL, + latitude double precision NOT NULL, + longitude double precision NOT NULL, + elevation int NOT NULL +); + +-- create nwx.nesdisam table +DROP TABLE IF EXISTS nwx.nesdisam CASCADE; +CREATE TABLE nwx.nesdisam( +id SERIAL PRIMARY KEY, + productid varchar(6) NOT NULL, + stnid varchar(8) NOT NULL, + stnname varchar(32) NOT NULL, + state varchar(2) NOT NULL, + country varchar(2) NOT NULL, + latitude double precision NOT NULL, + longitude double precision NOT NULL, + elevation int NOT NULL +); + +-- create nwx.nesdispm table +DROP TABLE IF EXISTS nwx.nesdispm CASCADE; +CREATE TABLE nwx.nesdispm( +id SERIAL PRIMARY KEY, + productid varchar(6) NOT NULL, + stnid varchar(8) NOT NULL, + stnname varchar(32) NOT NULL, + state varchar(2) NOT NULL, + country varchar(2) NOT NULL, + latitude double precision NOT NULL, + longitude double precision NOT NULL, + elevation int NOT NULL +); + +-- create nwx.snwstgam table +DROP TABLE IF EXISTS nwx.nwstgam CASCADE; +CREATE TABLE nwx.nwstgam( +id SERIAL PRIMARY KEY, + productid varchar(6) NOT NULL, + stnid varchar(8) NOT NULL, + stnname varchar(32) NOT NULL, + state varchar(2) NOT NULL, + country varchar(2) NOT NULL, + latitude double precision NOT NULL, + longitude double precision NOT NULL, + elevation int NOT NULL +); + +-- Drop nwx.sdm table +DROP TABLE IF EXISTS nwx.sdm CASCADE; + +-- create nwx.sdmam table +DROP TABLE IF EXISTS nwx.sdmam CASCADE; +CREATE TABLE nwx.sdmam( +id SERIAL PRIMARY KEY, + productid varchar(6) NOT NULL, + stnid varchar(8) NOT NULL, + stnname varchar(32) NOT NULL, + state varchar(2) NOT NULL, + country varchar(2) NOT NULL, + latitude double precision NOT NULL, + longitude double precision NOT NULL, + elevation int NOT NULL +); + +-- create nwx.sdmim table +DROP TABLE IF EXISTS nwx.sdmim CASCADE; +CREATE TABLE nwx.sdmim( +id SERIAL PRIMARY KEY, + productid varchar(6) NOT NULL, + stnid varchar(8) NOT NULL, + stnname varchar(32) NOT NULL, + state varchar(2) NOT NULL, + country varchar(2) NOT NULL, + latitude double precision NOT NULL, + longitude double precision NOT NULL, + elevation int NOT NULL +); + +-- create nwx.sdmdhm table +DROP TABLE IF EXISTS nwx.sdmdhm CASCADE; +CREATE TABLE nwx.sdmdhm( +id SERIAL PRIMARY KEY, + productid varchar(6) NOT NULL, + stnid varchar(8) NOT NULL, + stnname varchar(32) NOT NULL, + state varchar(2) NOT NULL, + country varchar(2) NOT NULL, + latitude double precision NOT NULL, + longitude double precision NOT NULL, + elevation int NOT NULL +); + +INSERT INTO nwx.datatypegrouplist (datatypegroupname,datatypegrouptablename) values ('Admin Messages','nwx.adminmessages'); +INSERT INTO nwx.adminmessages(productname,producttablename,producttype) values ('SDM Administrative Messages','nwx.sdmam','sdmam'); +INSERT INTO nwx.sdmam (productid,stnid,stnname,state,country,latitude,longitude,elevation) values ('NOUS42','KWNO','NMC','MD','US',38.82,-76.87,86); +INSERT INTO nwx.adminmessages(productname,producttablename,producttype) values ('SDM International Messages','nwx.sdmim','sdmim'); +INSERT INTO nwx.sdmim (productid,stnid,stnname,state,country,latitude,longitude,elevation) values ('NPXX10','KWNO','NMC','MD','US',38.82,-76.87,86); +INSERT INTO nwx.adminmessages(productname,producttablename,producttype) values ('SDM DHS Hazards Messages','nwx.sdmdhm','sdmdhm'); +INSERT INTO nwx.sdmdhm (productid,stnid,stnname,state,country,latitude,longitude,elevation) values ('NOUS71','KWNO','NMC','MD','US',38.82,-76.87,86); +INSERT INTO nwx.adminmessages(productname,producttablename,producttype) values ('CMC Administrative Messages','nwx.cmcam','cmcam'); +INSERT INTO nwx.cmcam (productid,stnid,stnname,state,country,latitude,longitude,elevation) values ('NOCN05', 'CWAO','MONTREAL_VAAC','CN','CN',45.47,-73.75,-9999); +INSERT INTO nwx.cmcam (productid,stnid,stnname,state,country,latitude,longitude,elevation) values ('AACN01', 'CWAO','MONTREAL_VAAC','CN','CN',45.47,-73.75,-9999); +INSERT INTO nwx.adminmessages(productname,producttablename,producttype) values ('NWSTG Administrative Messages','nwx.nwstgam','nwstgam'); +INSERT INTO nwx.nwstgam (productid,stnid,stnname,state,country,latitude,longitude,elevation) values ('NOXX01', 'KWBC','NMC','MD','US',38.82,-76.87,86); +INSERT INTO nwx.adminmessages(productname,producttablename,producttype) values ('NCF Administrative Messages','nwx.ncfam','ncfam'); +INSERT INTO nwx.ncfam (productid,stnid,stnname,state,country,latitude,longitude,elevation) values ('NOUS72', 'KNCF','NMC','MD','US',38.82,-76.87,86); +INSERT INTO nwx.adminmessages(productname,producttablename,producttype) values ('NESDIS Product Anomaly Messages','nwx.nesdispm','nesdispm'); +INSERT INTO nwx.nesdispm (productid,stnid,stnname,state,country,latitude,longitude,elevation) values ('NOUS71', 'KNES','NESDIS','MD','US',38.82,-76.87,86); +INSERT INTO nwx.adminmessages(productname,producttablename,producttype) values ('NESDIS Administrative Messages','nwx.nesdisam','nesdisam'); +INSERT INTO nwx.nesdisam (productid,stnid,stnname,state,country,latitude,longitude,elevation) values ('NOUS72', 'KNES','NESDIS','MD','US',38.82,-76.87,86); + +DELETE from nwx.hpcproducts where productname='SDM Messages'; +DELETE from nwx.hpcproducts where productname='International Messages'; +DROP TABLE nwx.sdm; +DROP TABLE nwx.intl; + +\connect metadata awips +INSERT INTO awips.nctext_inputfile_type VALUES (181,'sdmdhm','W'); +INSERT INTO awips.nctext_inputfile_type VALUES (182,'cmcam','W'); +INSERT INTO awips.nctext_inputfile_type VALUES (183,'nwstgam','W'); +INSERT INTO awips.nctext_inputfile_type VALUES (184,'ncfam','W'); +INSERT INTO awips.nctext_inputfile_type VALUES (185,'nesdispm','W'); +INSERT INTO awips.nctext_inputfile_type VALUES (186,'nesdisam','W'); +INSERT INTO awips.nctext_inputfile_type VALUES (185,'sdmam','B'); +INSERT INTO awips.nctext_inputfile_type VALUES (186,'sdmim','W'); + diff --git a/deltaScripts/14.2.1-n3/updateNcepNwxAdminTables.sh b/deltaScripts/14.2.1-n3/updateNcepNwxAdminTables.sh new file mode 100644 index 0000000000..a90aa30fac --- /dev/null +++ b/deltaScripts/14.2.1-n3/updateNcepNwxAdminTables.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +PSQL=/awips2/psql/bin/psql +DIR=`dirname $0` +${PSQL} -U awips -d ncep -f ${DIR}/addNcepNwxAdminMessageGpTable.sql diff --git a/edexOsgi/build.edex/build.xml b/edexOsgi/build.edex/build.xml index 7d63f9c4da..0fe91bea2d 100644 --- a/edexOsgi/build.edex/build.xml +++ b/edexOsgi/build.edex/build.xml @@ -114,6 +114,10 @@ + + + diff --git a/edexOsgi/build.edex/opt/db/ddl/ncep/addNcepNwxAdminMessageGpTable.sql b/edexOsgi/build.edex/opt/db/ddl/ncep/addNcepNwxAdminMessageGpTable.sql new file mode 100644 index 0000000000..eb7bbefb2c --- /dev/null +++ b/edexOsgi/build.edex/opt/db/ddl/ncep/addNcepNwxAdminMessageGpTable.sql @@ -0,0 +1,157 @@ +-- create nwx.adminmessages table +DROP TABLE IF EXISTS nwx.adminmessages CASCADE; +CREATE TABLE nwx.adminmessages( +id SERIAL PRIMARY KEY, +productname varchar(60) NOT NULL, +producttablename varchar(30) NOT NULL, +producttype varchar(20) NOT NULL +); + +-- create nwx.cmcam table +DROP TABLE IF EXISTS nwx.cmcam CASCADE; +CREATE TABLE nwx.cmcam( +id SERIAL PRIMARY KEY, + productid varchar(6) NOT NULL, + stnid varchar(8) NOT NULL, + stnname varchar(32) NOT NULL, + state varchar(2) NOT NULL, + country varchar(2) NOT NULL, + latitude double precision NOT NULL, + longitude double precision NOT NULL, + elevation int NOT NULL +); + +-- create nwx.ncfam table +DROP TABLE IF EXISTS nwx.ncfam CASCADE; +CREATE TABLE nwx.ncfam( +id SERIAL PRIMARY KEY, + productid varchar(6) NOT NULL, + stnid varchar(8) NOT NULL, + stnname varchar(32) NOT NULL, + state varchar(2) NOT NULL, + country varchar(2) NOT NULL, + latitude double precision NOT NULL, + longitude double precision NOT NULL, + elevation int NOT NULL +); + +-- create nwx.nesdisam table +DROP TABLE IF EXISTS nwx.nesdisam CASCADE; +CREATE TABLE nwx.nesdisam( +id SERIAL PRIMARY KEY, + productid varchar(6) NOT NULL, + stnid varchar(8) NOT NULL, + stnname varchar(32) NOT NULL, + state varchar(2) NOT NULL, + country varchar(2) NOT NULL, + latitude double precision NOT NULL, + longitude double precision NOT NULL, + elevation int NOT NULL +); + +-- create nwx.nesdispm table +DROP TABLE IF EXISTS nwx.nesdispm CASCADE; +CREATE TABLE nwx.nesdispm( +id SERIAL PRIMARY KEY, + productid varchar(6) NOT NULL, + stnid varchar(8) NOT NULL, + stnname varchar(32) NOT NULL, + state varchar(2) NOT NULL, + country varchar(2) NOT NULL, + latitude double precision NOT NULL, + longitude double precision NOT NULL, + elevation int NOT NULL +); + +-- create nwx.snwstgam table +DROP TABLE IF EXISTS nwx.nwstgam CASCADE; +CREATE TABLE nwx.nwstgam( +id SERIAL PRIMARY KEY, + productid varchar(6) NOT NULL, + stnid varchar(8) NOT NULL, + stnname varchar(32) NOT NULL, + state varchar(2) NOT NULL, + country varchar(2) NOT NULL, + latitude double precision NOT NULL, + longitude double precision NOT NULL, + elevation int NOT NULL +); + +-- Drop nwx.sdm table +DROP TABLE IF EXISTS nwx.sdm CASCADE; + +-- create nwx.sdmam table +DROP TABLE IF EXISTS nwx.sdmam CASCADE; +CREATE TABLE nwx.sdmam( +id SERIAL PRIMARY KEY, + productid varchar(6) NOT NULL, + stnid varchar(8) NOT NULL, + stnname varchar(32) NOT NULL, + state varchar(2) NOT NULL, + country varchar(2) NOT NULL, + latitude double precision NOT NULL, + longitude double precision NOT NULL, + elevation int NOT NULL +); + +-- create nwx.sdmim table +DROP TABLE IF EXISTS nwx.sdmim CASCADE; +CREATE TABLE nwx.sdmim( +id SERIAL PRIMARY KEY, + productid varchar(6) NOT NULL, + stnid varchar(8) NOT NULL, + stnname varchar(32) NOT NULL, + state varchar(2) NOT NULL, + country varchar(2) NOT NULL, + latitude double precision NOT NULL, + longitude double precision NOT NULL, + elevation int NOT NULL +); + +-- create nwx.sdmdhm table +DROP TABLE IF EXISTS nwx.sdmdhm CASCADE; +CREATE TABLE nwx.sdmdhm( +id SERIAL PRIMARY KEY, + productid varchar(6) NOT NULL, + stnid varchar(8) NOT NULL, + stnname varchar(32) NOT NULL, + state varchar(2) NOT NULL, + country varchar(2) NOT NULL, + latitude double precision NOT NULL, + longitude double precision NOT NULL, + elevation int NOT NULL +); + +INSERT INTO nwx.datatypegrouplist (datatypegroupname,datatypegrouptablename) values ('Admin Messages','nwx.adminmessages'); +INSERT INTO nwx.adminmessages(productname,producttablename,producttype) values ('SDM Administrative Messages','nwx.sdmam','sdmam'); +INSERT INTO nwx.sdmam (productid,stnid,stnname,state,country,latitude,longitude,elevation) values ('NOUS42','KWNO','NMC','MD','US',38.82,-76.87,86); +INSERT INTO nwx.adminmessages(productname,producttablename,producttype) values ('SDM International Messages','nwx.sdmim','sdmim'); +INSERT INTO nwx.sdmim (productid,stnid,stnname,state,country,latitude,longitude,elevation) values ('NPXX10','KWNO','NMC','MD','US',38.82,-76.87,86); +INSERT INTO nwx.adminmessages(productname,producttablename,producttype) values ('SDM DHS Hazards Messages','nwx.sdmdhm','sdmdhm'); +INSERT INTO nwx.sdmdhm (productid,stnid,stnname,state,country,latitude,longitude,elevation) values ('NOUS71','KWNO','NMC','MD','US',38.82,-76.87,86); +INSERT INTO nwx.adminmessages(productname,producttablename,producttype) values ('CMC Administrative Messages','nwx.cmcam','cmcam'); +INSERT INTO nwx.cmcam (productid,stnid,stnname,state,country,latitude,longitude,elevation) values ('NOCN05', 'CWAO','MONTREAL_VAAC','CN','CN',45.47,-73.75,-9999); +INSERT INTO nwx.cmcam (productid,stnid,stnname,state,country,latitude,longitude,elevation) values ('AACN01', 'CWAO','MONTREAL_VAAC','CN','CN',45.47,-73.75,-9999); +INSERT INTO nwx.adminmessages(productname,producttablename,producttype) values ('NWSTG Administrative Messages','nwx.nwstgam','nwstgam'); +INSERT INTO nwx.nwstgam (productid,stnid,stnname,state,country,latitude,longitude,elevation) values ('NOXX01', 'KWBC','NMC','MD','US',38.82,-76.87,86); +INSERT INTO nwx.adminmessages(productname,producttablename,producttype) values ('NCF Administrative Messages','nwx.ncfam','ncfam'); +INSERT INTO nwx.ncfam (productid,stnid,stnname,state,country,latitude,longitude,elevation) values ('NOUS72', 'KNCF','NMC','MD','US',38.82,-76.87,86); +INSERT INTO nwx.adminmessages(productname,producttablename,producttype) values ('NESDIS Product Anomaly Messages','nwx.nesdispm','nesdispm'); +INSERT INTO nwx.nesdispm (productid,stnid,stnname,state,country,latitude,longitude,elevation) values ('NOUS71', 'KNES','NESDIS','MD','US',38.82,-76.87,86); +INSERT INTO nwx.adminmessages(productname,producttablename,producttype) values ('NESDIS Administrative Messages','nwx.nesdisam','nesdisam'); +INSERT INTO nwx.nesdisam (productid,stnid,stnname,state,country,latitude,longitude,elevation) values ('NOUS72', 'KNES','NESDIS','MD','US',38.82,-76.87,86); + +INSERT INTO awips.nctext_inputfile_type VALUES (181,'sdmdhm','W'); +INSERT INTO awips.nctext_inputfile_type VALUES (182,'cmcam','W'); +INSERT INTO awips.nctext_inputfile_type VALUES (183,'nwstgam','W'); +INSERT INTO awips.nctext_inputfile_type VALUES (184,'ncfam','W'); +INSERT INTO awips.nctext_inputfile_type VALUES (185,'nesdispm','W'); +INSERT INTO awips.nctext_inputfile_type VALUES (186,'nesdisam','W'); +INSERT INTO awips.nctext_inputfile_type VALUES (185,'sdmam','B'); +INSERT INTO awips.nctext_inputfile_type VALUES (186,'sdmim','W'); + +DELETE from nwx.hpcproducts where productname='SDM Messages'; +DELETE from nwx.hpcproducts where productname='International Messages'; +DROP TABLE nwx.sdm; +DROP TABLE nwx.intl; + diff --git a/edexOsgi/build.edex/opt/db/ddl/ncep/createNcepNwxTables.sql b/edexOsgi/build.edex/opt/db/ddl/ncep/createNcepNwxTables.sql index 838200ee55..ed2953a883 100644 --- a/edexOsgi/build.edex/opt/db/ddl/ncep/createNcepNwxTables.sql +++ b/edexOsgi/build.edex/opt/db/ddl/ncep/createNcepNwxTables.sql @@ -195,6 +195,15 @@ producttablename varchar(30) NOT NULL, producttype varchar(20) NOT NULL ); +-- create nwx.adminmessages table +DROP TABLE IF EXISTS nwx.adminmessages CASCADE; +CREATE TABLE nwx.adminmessages( +id SERIAL PRIMARY KEY, +productname varchar(60) NOT NULL, +producttablename varchar(30) NOT NULL, +producttype varchar(20) NOT NULL +); + ------------------------------------------------- -- create nwx bulletin tables -- --------------------------------------------- @@ -355,6 +364,20 @@ id SERIAL PRIMARY KEY, elevation int NOT NULL ); +-- create nwx.cmcam table +DROP TABLE IF EXISTS nwx.cmcam CASCADE; +CREATE TABLE nwx.cmcam( +id SERIAL PRIMARY KEY, + productid varchar(6) NOT NULL, + stnid varchar(8) NOT NULL, + stnname varchar(32) NOT NULL, + state varchar(2) NOT NULL, + country varchar(2) NOT NULL, + latitude double precision NOT NULL, + longitude double precision NOT NULL, + elevation int NOT NULL +); + --create nwx.consig table DROP TABLE IF EXISTS nwx.consig CASCADE; CREATE TABLE nwx.consig( @@ -1016,6 +1039,48 @@ id SERIAL PRIMARY KEY, elevation int NOT NULL ); +-- create nwx.ncfam table +DROP TABLE IF EXISTS nwx.ncfam CASCADE; +CREATE TABLE nwx.ncfam( +id SERIAL PRIMARY KEY, + productid varchar(6) NOT NULL, + stnid varchar(8) NOT NULL, + stnname varchar(32) NOT NULL, + state varchar(2) NOT NULL, + country varchar(2) NOT NULL, + latitude double precision NOT NULL, + longitude double precision NOT NULL, + elevation int NOT NULL +); + +-- create nwx.nesdisam table +DROP TABLE IF EXISTS nwx.nesdisam CASCADE; +CREATE TABLE nwx.nesdisam( +id SERIAL PRIMARY KEY, + productid varchar(6) NOT NULL, + stnid varchar(8) NOT NULL, + stnname varchar(32) NOT NULL, + state varchar(2) NOT NULL, + country varchar(2) NOT NULL, + latitude double precision NOT NULL, + longitude double precision NOT NULL, + elevation int NOT NULL +); + +-- create nwx.nesdispam table +DROP TABLE IF EXISTS nwx.nesdispam CASCADE; +CREATE TABLE nwx.nesdispam( +id SERIAL PRIMARY KEY, + productid varchar(6) NOT NULL, + stnid varchar(8) NOT NULL, + stnname varchar(32) NOT NULL, + state varchar(2) NOT NULL, + country varchar(2) NOT NULL, + latitude double precision NOT NULL, + longitude double precision NOT NULL, + elevation int NOT NULL +); + -- create nwx.ngmgd table DROP TABLE IF EXISTS nwx.ngmgd CASCADE; CREATE TABLE nwx.ngmgd( @@ -1058,6 +1123,20 @@ id SERIAL PRIMARY KEY, elevation int NOT NULL ); +-- create nwx.snwstgam table +DROP TABLE IF EXISTS nwx.nwstgam CASCADE; +CREATE TABLE nwx.nwstgam( +id SERIAL PRIMARY KEY, + productid varchar(6) NOT NULL, + stnid varchar(8) NOT NULL, + stnname varchar(32) NOT NULL, + state varchar(2) NOT NULL, + country varchar(2) NOT NULL, + latitude double precision NOT NULL, + longitude double precision NOT NULL, + elevation int NOT NULL +); + -- create nwx.off table DROP TABLE IF EXISTS nwx.off CASCADE; CREATE TABLE nwx.off( @@ -1400,9 +1479,37 @@ id SERIAL PRIMARY KEY, elevation int NOT NULL ); --- create nwx.sdm table -DROP TABLE IF EXISTS nwx.sdm CASCADE; -CREATE TABLE nwx.sdm( +-- create nwx.sdmam table +DROP TABLE IF EXISTS nwx.sdmam CASCADE; +CREATE TABLE nwx.sdmam( +id SERIAL PRIMARY KEY, + productid varchar(6) NOT NULL, + stnid varchar(8) NOT NULL, + stnname varchar(32) NOT NULL, + state varchar(2) NOT NULL, + country varchar(2) NOT NULL, + latitude double precision NOT NULL, + longitude double precision NOT NULL, + elevation int NOT NULL +); + +-- create nwx.sdmim table +DROP TABLE IF EXISTS nwx.sdmim CASCADE; +CREATE TABLE nwx.sdmim( +id SERIAL PRIMARY KEY, + productid varchar(6) NOT NULL, + stnid varchar(8) NOT NULL, + stnname varchar(32) NOT NULL, + state varchar(2) NOT NULL, + country varchar(2) NOT NULL, + latitude double precision NOT NULL, + longitude double precision NOT NULL, + elevation int NOT NULL +); + +-- create nwx.sdmdhm table +DROP TABLE IF EXISTS nwx.sdmdhm CASCADE; +CREATE TABLE nwx.sdmdhm( id SERIAL PRIMARY KEY, productid varchar(6) NOT NULL, stnid varchar(8) NOT NULL, diff --git a/edexOsgi/build.edex/opt/db/ddl/ncep/loadNcepNwx.sh b/edexOsgi/build.edex/opt/db/ddl/ncep/loadNcepNwx.sh index a64851106d..c358bd42fc 100644 --- a/edexOsgi/build.edex/opt/db/ddl/ncep/loadNcepNwx.sh +++ b/edexOsgi/build.edex/opt/db/ddl/ncep/loadNcepNwx.sh @@ -25,3 +25,4 @@ ${1}/bin/psql -d ncep -U ${3} -q -p ${2} -f ${4}/loadNwxReconCARCAHBulletinTable ${1}/bin/psql -d ncep -U ${3} -q -p ${2} -f ${4}/loadNwxSPCProductsBulletinTables.sql >> ${5} 2>&1 ${1}/bin/psql -d ncep -U ${3} -q -p ${2} -f ${4}/loadNwxTropicalPacificBulletinTables.sql >> ${5} 2>&1 ${1}/bin/psql -d ncep -U ${3} -q -p ${2} -f ${4}/loadNwxVolcanoProductsBulletinTables.sql >> ${5} 2>&1 +${1}/bin/psql -d ncep -U ${3} -q -p ${2} -f ${4}/loadNwxAdminMessagesBulletinTables.sql >> ${5} 2>&1 diff --git a/edexOsgi/build.edex/opt/db/ddl/ncep/loadNwxAdminMessagesBulletinTables.sql b/edexOsgi/build.edex/opt/db/ddl/ncep/loadNwxAdminMessagesBulletinTables.sql new file mode 100644 index 0000000000..bc9f0cfbec --- /dev/null +++ b/edexOsgi/build.edex/opt/db/ddl/ncep/loadNwxAdminMessagesBulletinTables.sql @@ -0,0 +1,40 @@ +-- load nwx.sdmam table +copy nwx.sdmam (productid,stnid,stnname,state,country,latitude,longitude,elevation) FROM stdin with delimiter as ','; +NOUS42,KWNO,NMC,MD,US,38.82,-76.87,86 +\. + +-- load nwx.sdmim table +copy nwx.sdmim (productid,stnid,stnname,state,country,latitude,longitude,elevation) FROM stdin with delimiter as ','; +NPXX10,KWNO,NMC,MD,US,38.82,-76.87,86 +\. + +-- load nwx.sdmdhm table +copy nwx.sdmdhm (productid,stnid,stnname,state,country,latitude,longitude,elevation) FROM stdin with delimiter as ','; +NOUS71,KWNO,NMC,MD,US,38.82,-76.87,86 +\. + +-- load nwx.nwstgam table +copy nwx.nwstgam (productid,stnid,stnname,state,country,latitude,longitude,elevation) FROM stdin with delimiter as ','; +NOXX01,KWBC,NMC,MD,US,38.82,-76.87,86 +\. + +-- load nwx.ncfam table +copy nwx.ncfam (productid,stnid,stnname,state,country,latitude,longitude,elevation) FROM stdin with delimiter as ','; +NOUS72,KNCF,NMC,MD,US,38.82,-76.87,86 +\. + +-- load nwx.nesdispm table +copy nwx.nesdispm (productid,stnid,stnname,state,country,latitude,longitude,elevation) FROM stdin with delimiter as ','; +NOUS71,KNES,NMC,MD,US,38.82,-76.87,86 +\. + +-- load nwx.nesdisam table +copy nwx.nesdisam (productid,stnid,stnname,state,country,latitude,longitude,elevation) FROM stdin with delimiter as ','; +NOUS72,KNES,NMC,MD,US,38.82,-76.87,86 +\. + +-- load nwx.cmcam table +copy nwx.cmcam (productid,stnid,stnname,state,country,latitude,longitude,elevation) FROM stdin with delimiter as ','; +NOCN05,CWAO,MONTREAL_VAAC,CN,CN,45.47,-73.75,-9999 +AACN01,CWAO,MONTREAL_VAAC,CN,CN,45.47,-73.75,-9999 +\. \ No newline at end of file diff --git a/edexOsgi/build.edex/opt/db/ddl/ncep/loadNwxMasterAndGuiProducts.sql b/edexOsgi/build.edex/opt/db/ddl/ncep/loadNwxMasterAndGuiProducts.sql index add2d2c11b..0b9412bbb3 100644 --- a/edexOsgi/build.edex/opt/db/ddl/ncep/loadNwxMasterAndGuiProducts.sql +++ b/edexOsgi/build.edex/opt/db/ddl/ncep/loadNwxMasterAndGuiProducts.sql @@ -64,6 +64,19 @@ HPC Heat Index,nwx.hpcheatindex CPC Products,nwx.cpcproducts Volcano Products,nwx.volcanoproducts Fire Weather Products,nwx.fireweatherproducts +Admin Messages,nwx.adminmessages +\. + +--load nwx.adminmessages table +copy nwx.adminmessages (productname,producttablename,producttype) FROM stdin with delimiter as ',' ; +SDM Administrative Messages,nwx.sdmam,sdm +SDM International Messages,nwx.sdmim,intl +SDM DHS Hazards Messages,nwx.sdmdhm +CMC Administrative Messages,nwx.cmcam +NWSTG Administrative Messages,nwx.nwstgam +NCF Administrative Messages,nwx.ncfam +NESDIS Product Anomaly Messages,nwx.nesdispam +NESDIS Administrative Messages,nwx.nesdisam \. --load nwx.observeddataproducts table @@ -135,8 +148,6 @@ Hawaii Discussion,nwx.pmdhi,PMDHI Alaska Discussion,nwx.pmdak,PMDAK S Amer Discussion,nwx.pmdsa,PMDSA Caribbean Discussion,nwx.pmdca,PMDCA -SDM Messages,nwx.sdm,sdm -International Messages,nwx.intl,intl Storm Summaries,nwx.stations,storm Model Diag Discussion,nwx.pmdhmd,PMDHMD Selected Cities,nwx.scs,SCS diff --git a/edexOsgi/build.edex/opt/db/ddl/ncep/loadNwxObservedDataBulletinTables.sql b/edexOsgi/build.edex/opt/db/ddl/ncep/loadNwxObservedDataBulletinTables.sql index e43add0973..46904ebae4 100644 --- a/edexOsgi/build.edex/opt/db/ddl/ncep/loadNwxObservedDataBulletinTables.sql +++ b/edexOsgi/build.edex/opt/db/ddl/ncep/loadNwxObservedDataBulletinTables.sql @@ -8658,7 +8658,7 @@ copy nwx.sfstns (productid,stnid,stnname,state,country,latitude,longitude,elevat 085010;LPFL;FLORES_ISLAND;--;AZ;39.45;-31.13;29 999999;M97;TUNICA;MS;US;34.86;-90.35;59 999999;MDD;MIDLAND;TX;US;32.04;-102.10;854 -890090;NZSP;AMUNDSEN-SCOTT_SOUTH_POLE_STN;--;NZ;-90.00;0.00;2830 +890090;NZSP;AMUNDSEN-SCOTT_SOUTH_POLE_STN;--;NZ;-89.99;0.01;2830 999999;PCZ;WAUPACA;WI;US;44.33;-89.01;252 999999;RCX;LADYSMITH;WI;US;45.50;-91.00;377 800630;SKMR;MONTERIA/LOS_GARZON;--;CO;8.82;-75.85;26 @@ -10043,7 +10043,7 @@ copy nwx.snstns (productid,stnid,stnname,state,country,latitude,longitude,elevat 87860;SAVC;COMODORO_RIVADAVIA_AERO;--;AG;-45.78;-67.50;46 88889;EGYP;MOUNT_PLEASANT_AIRPORT;--;FK;-51.81;-58.45;73 89002;--;NEUMAYER;--;AA;-70.66;-8.25;50 -89009;--;AMUNDSEN-SCOTT;--;AA;-90.00;0.00;2835 +89009;--;AMUNDSEN-SCOTT;--;AA;-89.99;0.01;2835 89022;--;HALLEY;--;AA;-75.50;-26.65;30 89050;--;BELLINGSHAUSEN_AWS;--;AA;-62.20;-58.93;14 89055;--;BASE_MARAMBIO;--;AA;-64.23;-56.71;198 diff --git a/edexOsgi/com.raytheon.edex.plugin.grib/utility/edex_static/base/grib/grids/ECMWF-wave-0p25deg.xml b/edexOsgi/com.raytheon.edex.plugin.grib/utility/edex_static/base/grib/grids/ECMWF-wave-0p25deg.xml new file mode 100644 index 0000000000..84c9349216 --- /dev/null +++ b/edexOsgi/com.raytheon.edex.plugin.grib/utility/edex_static/base/grib/grids/ECMWF-wave-0p25deg.xml @@ -0,0 +1,35 @@ + + + + ECMWF-wave-0p25deg + Global Latitude/Longitude 0.25 deg Resolution + 90.0 + -180.0 + UpperLeft + 1441 + 685 + 0.25 + 0.25 + degree + -81.0 + 180.0 + + diff --git a/edexOsgi/com.raytheon.edex.plugin.grib/utility/edex_static/base/grib/grids/grid1440721001.xml b/edexOsgi/com.raytheon.edex.plugin.grib/utility/edex_static/base/grib/grids/grid1440721001.xml new file mode 100644 index 0000000000..213257663f --- /dev/null +++ b/edexOsgi/com.raytheon.edex.plugin.grib/utility/edex_static/base/grib/grids/grid1440721001.xml @@ -0,0 +1,32 @@ + + + + 1440721001 + High Resolution (0.25 by 0.25) CED grids + 90.0 + 0.0 + UpperLeft + 1440 + 721 + .25 + .25 + degree + diff --git a/edexOsgi/com.raytheon.edex.plugin.grib/utility/edex_static/base/grib/grids/grid193.xml b/edexOsgi/com.raytheon.edex.plugin.grib/utility/edex_static/base/grib/grids/grid193.xml new file mode 100644 index 0000000000..91d67fb06c --- /dev/null +++ b/edexOsgi/com.raytheon.edex.plugin.grib/utility/edex_static/base/grib/grids/grid193.xml @@ -0,0 +1,34 @@ + + + + 193 + Global Latitude/Longitude 0.25 deg Resolution + 90.0 + 0.0 + UpperLeft + 1440 + 721 + .25 + .25 + degree + -90.0 + 359.75 + diff --git a/edexOsgi/com.raytheon.edex.plugin.grib/utility/edex_static/base/grib/models/gribModels_ECMWF-98.xml b/edexOsgi/com.raytheon.edex.plugin.grib/utility/edex_static/base/grib/models/gribModels_ECMWF-98.xml index 6b54fab4d5..041a545294 100644 --- a/edexOsgi/com.raytheon.edex.plugin.grib/utility/edex_static/base/grib/models/gribModels_ECMWF-98.xml +++ b/edexOsgi/com.raytheon.edex.plugin.grib/utility/edex_static/base/grib/models/gribModels_ECMWF-98.xml @@ -26,10 +26,10 @@ - ecmwfP25 + ecmwf0p25
98
0 - 144072101 + 193 141 142 @@ -39,6 +39,20 @@
+ + ecmwf0p25wave +
98
+ 0 + ECMWF-wave-0p25deg + + 108 + 109 + 110 + 111 + 112 + +
+ ecmwf
98
diff --git a/edexOsgi/com.raytheon.edex.plugin.sfcobs/utility/edex_static/base/distribution/sfcobs.xml b/edexOsgi/com.raytheon.edex.plugin.sfcobs/utility/edex_static/base/distribution/sfcobs.xml index 4805045032..4dad816fc0 100644 --- a/edexOsgi/com.raytheon.edex.plugin.sfcobs/utility/edex_static/base/distribution/sfcobs.xml +++ b/edexOsgi/com.raytheon.edex.plugin.sfcobs/utility/edex_static/base/distribution/sfcobs.xml @@ -19,14 +19,17 @@ further_licensing_information. --> + ^S(HV|HXX|S[^X]).* + ^S[IMN]W[^KZ].* + ^SIV[A-FJX].* ^SMUS.* ^SMCN.* ^SMMX.* - ^SMV[DCE].* - ^SIV[DCE].* - ^SNV[DCE].* + ^SMV[A-FJX].* + ^SNV[A-FXZ].* ^SSV[DCE].* ^SSVX.* - ^SXUS2[0123] KWNB.* + ^SXUS2[0123].* ^VHVD2[89] KWNB.* + ^Y[HO]XX84.* diff --git a/ncep/gov.noaa.nws.ncep.edex.plugin.airep/res/pointdata/airepdb.xml b/ncep/gov.noaa.nws.ncep.edex.plugin.airep/res/pointdata/airepdb.xml index d0ef957534..f5d166fa08 100644 --- a/ncep/gov.noaa.nws.ncep.edex.plugin.airep/res/pointdata/airepdb.xml +++ b/ncep/gov.noaa.nws.ncep.edex.plugin.airep/res/pointdata/airepdb.xml @@ -3,7 +3,8 @@ * SOFTWARE HISTORY * Date Ticket# Engineer Description * __________ _______ __________ __________________________ - * 06/28/2011 F. J. Yen Initial creation for OB11.5 + * 06/28/2011 F. J. Yen Initial creation for OB11.5 + * 07/14/2014 B. Hebbard Add refTime parameter --> @@ -11,4 +12,5 @@ + \ No newline at end of file diff --git a/ncep/gov.noaa.nws.ncep.edex.plugin.nctext/res/scripts/inputFileType.sql b/ncep/gov.noaa.nws.ncep.edex.plugin.nctext/res/scripts/inputFileType.sql index d0cc2c5f3a..efb7ca909c 100644 --- a/ncep/gov.noaa.nws.ncep.edex.plugin.nctext/res/scripts/inputFileType.sql +++ b/ncep/gov.noaa.nws.ncep.edex.plugin.nctext/res/scripts/inputFileType.sql @@ -177,3 +177,10 @@ INSERT INTO awips.nctext_inputfile_type VALUES (177,'warwatch','W'); INSERT INTO awips.nctext_inputfile_type VALUES (178,'warnsumm','W'); INSERT INTO awips.nctext_inputfile_type VALUES (179,'coutlook','W'); INSERT INTO awips.nctext_inputfile_type VALUES (180,'fwddy38','W'); +INSERT INTO awips.nctext_inputfile_type VALUES (181,'sdmdhm','W'); +INSERT INTO awips.nctext_inputfile_type VALUES (182,'cmcam','W'); +INSERT INTO awips.nctext_inputfile_type VALUES (183,'nwstgam','W'); +INSERT INTO awips.nctext_inputfile_type VALUES (184,'ncfam','W'); +INSERT INTO awips.nctext_inputfile_type VALUES (185,'nesdispm','W'); +INSERT INTO awips.nctext_inputfile_type VALUES (186,'nesdisam','W'); + diff --git a/ncep/gov.noaa.nws.ncep.edex.plugin.nctext/src/gov/noaa/nws/ncep/edex/plugin/nctext/decoder/NctextRegexMatcher.java b/ncep/gov.noaa.nws.ncep.edex.plugin.nctext/src/gov/noaa/nws/ncep/edex/plugin/nctext/decoder/NctextRegexMatcher.java index d669d9fa56..2fbda5c826 100644 --- a/ncep/gov.noaa.nws.ncep.edex.plugin.nctext/src/gov/noaa/nws/ncep/edex/plugin/nctext/decoder/NctextRegexMatcher.java +++ b/ncep/gov.noaa.nws.ncep.edex.plugin.nctext/src/gov/noaa/nws/ncep/edex/plugin/nctext/decoder/NctextRegexMatcher.java @@ -17,450 +17,1022 @@ import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; - /** *
-* Compares the lines from the file header to a map of regular expressions to determine the product type
-* 
-* SOFTWARE HISTORY
-* Date          Ticket     Engineer     Description
-* ------------ ---------- ----------- --------------------------
-* 06-Jul-2010    191       Archana.S   Initial Creation
-* 18-Aug-2010  191       Archana .S  Minor update in regex for vlcw 
-* 21-Nov-2011              Chin Chen   update and re-organize regex to fix several product type decoding errors
-* 12/10/2012               Chin Chen   update regex to support "Observed Data" group
-* 
-* @author Archana -* @version 1 -*/ + * Compares the lines from the file header to a map of regular expressions to determine the product type + * + * SOFTWARE HISTORY + * Date Ticket Engineer Description + * ------------ ---------- ----------- -------------------------- + * 06-Jul-2010 191 Archana.S Initial Creation + * 18-Aug-2010 191 Archana .S Minor update in regex for vlcw + * 21-Nov-2011 Chin Chen update and re-organize regex to fix several product type decoding errors + * 12/10/2012 Chin Chen update regex to support "Observed Data" group + * 07/10/2014 Chin Chen added support NcText new Admin Message Group + * + * + * @author Archana + * @version 1 + */ public final class NctextRegexMatcher { - /** - * - * @return - */ - public static List getProductType() { - if(strNctextProductType.size() > 0){ - return new ArrayList(strNctextProductType); - }else{ - return Collections.emptyList(); - } - } + /** + * + * @return + */ + public static List getProductType() { + if (strNctextProductType.size() > 0) { + return new ArrayList(strNctextProductType); + } else { + return Collections.emptyList(); + } + } - public static Integer getParsedDayOfMonth() { - return new Integer(parsedDate.intValue()); - } + public static Integer getParsedDayOfMonth() { + return new Integer(parsedDate.intValue()); + } - public static Integer getParsedHour() { - return new Integer(parsedHour.intValue()); - } + public static Integer getParsedHour() { + return new Integer(parsedHour.intValue()); + } - public static Integer getParsedMinute() { - return new Integer(parsedMinute.intValue()); - } - - public static Set getSetOfPatterns() { - return new HashSet(setOfPatterns); - } + public static Integer getParsedMinute() { + return new Integer(parsedMinute.intValue()); + } + + public static Set getSetOfPatterns() { + return new HashSet(setOfPatterns); + } + + private static final Map NCTEXT_PRODUCT_REGEX_MAP = initializeMap(); + + private static Integer parsedDate = -99; - private static final Map NCTEXT_PRODUCT_REGEX_MAP = initializeMap(); - private static Integer parsedDate = -99; private static Integer parsedHour = -99; - private static Integer parsedMinute= -99; - private static ArrayList strNctextProductType = new ArrayList(0); - private static final Set setOfPatterns = NCTEXT_PRODUCT_REGEX_MAP.keySet(); - /*** - * Finds the matching Nctext product type by comparing the input file content - * with each regular expression in the HashMap. - * @param fileContent - * @return true if a match was found or false otherwise - */ - protected synchronized static boolean matchFileRegex(String fileContent){ - strNctextProductType = new ArrayList(0); - boolean isMatchFound = false; - for (Pattern thisPattern: setOfPatterns){ - Matcher thisMatcher = thisPattern.matcher(fileContent); - - if(thisMatcher.matches()){ -// System.out.println("Current line in file is: " + fileContent); - //retrieve the matching product type for the regular expression - String prodType = new String(NCTEXT_PRODUCT_REGEX_MAP.get(thisPattern)); - //System.out.println("Product type is " + prodType); - //System.out.println("Matching pattern is: " + thisPattern.pattern()); - //If the product type is not already in the list... - if(!isNctextProductAlreadyInList(prodType)){ - //add it to the list - strNctextProductType.add(prodType); - - } - //System.out.println("matchFileRegex group count =" + thisMatcher.groupCount() ); - //for(int i=0; i< thisMatcher.groupCount();i++){ - // System.out.println("matchFileRegex group " + i+ "= "+thisMatcher.group(i)); - //} - if(thisMatcher.groupCount() > 1){ - //get the data captured from the groups of the matcher - String dateFromMatchedPattern = new String(thisMatcher.group(1)); - String hourFromMatchedPattern = new String(thisMatcher.group(2)); - String minuteFromMatchedPattern = new String(thisMatcher.group(3)); - try{ - parsedDate = new Integer(Integer.parseInt(dateFromMatchedPattern)); - parsedHour = new Integer(Integer.parseInt(hourFromMatchedPattern)); - parsedMinute = new Integer(Integer.parseInt(minuteFromMatchedPattern)); - } catch (NumberFormatException e){ - System.out.println("matchFileRegex(): NumberFormatException event: for product type "+prodType); - continue; - } - } - isMatchFound = true; - } - thisMatcher.reset(); - } - //System.out.println("matchFileRegex returning "+ isMatchFound); - return isMatchFound; - } - /*** - * Checks if the input Nctext product typeis already present in the list - * @param productType - the String object denoting the Nctext product type - * @return true if the product type exists in the list or false otherwise - */ - private synchronized static boolean isNctextProductAlreadyInList(String productType){ - for(String currentString: strNctextProductType){ - if(currentString.compareTo(productType)==0){ - return true; - } - } - return false; - } - - /*** - * Creates and initializes a {@code HashMap} with the regular expression as the key and the Nctext product type as - * the value.
-	 *  {@code } - the compiled regular expression
-	 *  {@code } - the Nctext product type
-	 *  
- * @return the initialized unmodifiable {@code Map} - */ - private synchronized static Map initializeMap() { - Map thisMap = new HashMap(0); - //TODO - uncomment the regular expressions for (hrly, snd, syn) once the database tables are updated - // to handle ObservedData products + private static Integer parsedMinute = -99; -// thisMap.put(Pattern.compile("^S[AP].... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])"), "hrly"); -// thisMap.put(Pattern.compile("^U[CEFGHIJKLMNPQSWXY].... .... (0[1-9]|[12][0-9]|3[01])"), "snd"); + private static ArrayList strNctextProductType = new ArrayList( + 0); - //TODO - create a separate Pattern outside the HashMap for syn, since it does not have any digits - // and the code will crash when it tries to extract a digit from the captured regular expression groups - -// thisMap.put(Pattern.compile("(^S[IM]V[IGNS])|(^SNV[INS])|(^S[IMN](W[KZ]|[^VW]))"), "syn"); - - //Chin: add \n to separate the 2 lines to make regular expression work "correctly" on those products with - //product type coded at 2nd line - thisMap.put(Pattern.compile("^FXCA62 TJSJ (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "area"); - thisMap.put(Pattern.compile("^FXUS[67][1-6] .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "area"); - thisMap.put(Pattern.compile("^FPAK20 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "area");//no data to test - thisMap.put(Pattern.compile("^FPHW03 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "area");//no data to test - //thisMap.put(Pattern.compile("^FX(HW|PN|PS)60 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "area"); - //split above pattern to the following 3 patterns so matchFileRegex() can be coded in a generic way. - thisMap.put(Pattern.compile("^FXHW60 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "area"); - thisMap.put(Pattern.compile("^FXPN60 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "area"); - thisMap.put(Pattern.compile("^FXPS60 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "area"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)FA[0-9].*"), "area"); //aviation forecasts - thisMap.put(Pattern.compile("^WWUS30 KWNS (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"),"wtch2"); - thisMap.put(Pattern.compile("^FNUS21 KWNS (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"),"fwddy1"); - thisMap.put(Pattern.compile("^FNUS22 KWNS (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"),"fwddy2"); - thisMap.put(Pattern.compile("^FNUS28 KWNS (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"),"fwddy38"); - thisMap.put(Pattern.compile("^FNUS21 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)FWDDY1.*"),"fire1"); //spc uses this regex for fwddy1 also - thisMap.put(Pattern.compile("^FNUS22 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)FWDDY2.*"),"fire2"); //spc uses this regex for fwddy2 also - thisMap.put(Pattern.compile("^WOUS64 KWNS (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "wou"); - thisMap.put(Pattern.compile("^ABNT20 KNHC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "outlk"); //clashes with TWO - thisMap.put(Pattern.compile("^ACPN50 PHFO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "outlk"); - thisMap.put(Pattern.compile("^ABPZ20 KNHC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "outlk"); - thisMap.put(Pattern.compile("^ABCA33 TJSJ (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "outlk"); - thisMap.put(Pattern.compile("^WTNT4[1-5] KNHC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "disc"); - thisMap.put(Pattern.compile("^WTPA4[1-5] PHFO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "disc"); - thisMap.put(Pattern.compile("^WTPZ4[1-5] KNHC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "disc"); - thisMap.put(Pattern.compile("^WONT41 KNHC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "disc"); - thisMap.put(Pattern.compile("^WTNT3[1-5] KNHC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "pblc"); - thisMap.put(Pattern.compile("^WTNT3[1-5] KWNH (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "pblc"); - thisMap.put(Pattern.compile("^WTPA3[1-5] PHFO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "pblc"); - thisMap.put(Pattern.compile("^WTPZ3[1-5] KNHC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "pblc"); - thisMap.put(Pattern.compile("^WTPZ3[1-5] KWNH (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "pblc"); - thisMap.put(Pattern.compile("^WTCA4[1-5] TJSJ (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "pblc"); - thisMap.put(Pattern.compile("^WHCA31 TFFF (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "pblc"); - thisMap.put(Pattern.compile("^WTPN2[1-5] PGTW (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "pblc"); - thisMap.put(Pattern.compile("^WTNT2[1-5] KNHC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "mar"); - thisMap.put(Pattern.compile("^WTPA2[1-5] PHFO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "mar"); - thisMap.put(Pattern.compile("^WTPZ2[1-5] KNHC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "mar"); - thisMap.put(Pattern.compile("^W[H|T]PS01 NFFN (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "mar"); - thisMap.put(Pattern.compile("^WTPN3[1-5] PGTW (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "mar"); - thisMap.put(Pattern.compile("^URNT12 KNHC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "rcn"); - thisMap.put(Pattern.compile("^U[RZ]NT14 KWBC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "rcn");//no test data - thisMap.put(Pattern.compile("^AXPZ20 KNHC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "tdsc"); //clashes with TWD - thisMap.put(Pattern.compile("^AXNT20 KNHC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "tdsc"); //clashes with TWD - thisMap.put(Pattern.compile("^WTNT7[1-5] KNHC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "strk"); - thisMap.put(Pattern.compile("^NOUS42 KNHC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "pod"); //no regex for aasdl and pasdl - thisMap.put(Pattern.compile("^WWJP25 RJTD (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "HSF"); - thisMap.put(Pattern.compile("^WCPA3[1-5] PHFO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "conv"); - thisMap.put(Pattern.compile("^WSUS3[1-3] KKCI (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "conv"); - thisMap.put(Pattern.compile("^WAUS4[1-6] KKCI (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "airm"); - thisMap.put(Pattern.compile("^WAAK4[7-9] PAWU (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "airm"); - thisMap.put(Pattern.compile("^FAAK2[1-6] KZAN (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "cwa"); - thisMap.put(Pattern.compile("^FAUS2[1-6] KZ.. (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "cwa"); - thisMap.put(Pattern.compile("^WCUS2[1-6] KZ.. (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "cwa"); - thisMap.put(Pattern.compile("^FAUS20 PANC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "mis"); - thisMap.put(Pattern.compile("^FOUS14 KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "ngmmos"); - thisMap.put(Pattern.compile("^FOAK2[5-9] KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "ngmmos"); - thisMap.put(Pattern.compile("^FOPA20 KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "gfsmos"); - thisMap.put(Pattern.compile("^FOUS2[1-6] KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "gfsmos"); - thisMap.put(Pattern.compile("^FOAK3[7-9] KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "gfsmos"); - thisMap.put(Pattern.compile("^FEPA20 KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "gfsxmos"); - thisMap.put(Pattern.compile("^FEUS2[1-6] KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "gfsxmos"); - thisMap.put(Pattern.compile("^FEAK3[7-9] KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "gfsxmos"); - thisMap.put(Pattern.compile("^FECN21 KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "gfsxmos"); - thisMap.put(Pattern.compile("^FOUS4[4-9] KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "etamos"); - thisMap.put(Pattern.compile("^FQUS2[1-6] KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)MMG.*"), "marnmos"); - thisMap.put(Pattern.compile("^FQAK37 KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)MMG.*"), "marnmos"); - thisMap.put(Pattern.compile("^FQPA20 KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)MMG.*"), "marnmos"); - thisMap.put(Pattern.compile("^FOUE6[0-4] KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "ngmgd"); - thisMap.put(Pattern.compile("^FOUE80 KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "ngmgd"); - thisMap.put(Pattern.compile("^FOUM6[5-9] KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "ngmgd"); - thisMap.put(Pattern.compile("^FOUM7[01] KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "ngmgd"); - thisMap.put(Pattern.compile("^FOUM8[124] KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "ngmgd"); - thisMap.put(Pattern.compile("^FOUS8[6-9] KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "ngmgd"); - thisMap.put(Pattern.compile("^FOUS90 KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "ngmgd"); - thisMap.put(Pattern.compile("^FOUW7[238] KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "ngmgd"); - thisMap.put(Pattern.compile("^FOUW83 KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "ngmgd"); - thisMap.put(Pattern.compile("^FOHW50 KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "ngmgd"); - thisMap.put(Pattern.compile("^FOCA5[12] KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "ngmgd"); - thisMap.put(Pattern.compile("^FOCN7[456] KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "ngmgd"); - thisMap.put(Pattern.compile("^FOGX77 KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "ngmgd"); - thisMap.put(Pattern.compile("^FOUS6[0-9] KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "etagd"); - thisMap.put(Pattern.compile("^FOUS7[0-8] KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "etagd"); - thisMap.put(Pattern.compile("^FXUS02 KWBC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)PMDEPD.*"), "PMDEPD"); - thisMap.put(Pattern.compile("^FXUS02 KWNH (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)PREEPD.*"), "PREEPD"); - thisMap.put(Pattern.compile("^FXUS01 KWBC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)PMDSPD.*"), "PMDSPD"); - thisMap.put(Pattern.compile("^FXHW01 KWNH (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)PMDHI.*"), "PMDHI"); - thisMap.put(Pattern.compile("^FXSA20 KWBC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)PMDSA.*"), "PMDSA"); - thisMap.put(Pattern.compile("^FXCA20 KWBC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)PMDCA.*"), "PMDCA"); - thisMap.put(Pattern.compile("^FXAK02 KWNH (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)PMDAK.*"), "PMDAK"); - thisMap.put(Pattern.compile("^NOUS42 KWBC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "sdm"); - thisMap.put(Pattern.compile("^NOUS42 KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "sdm"); - thisMap.put(Pattern.compile("^NPXX10 KWBC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "intl"); - thisMap.put(Pattern.compile("^NPXX10 KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "intl"); - thisMap.put(Pattern.compile("^FXUS10 KWNH (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "PMDHMD"); - thisMap.put(Pattern.compile("^FMUS2[34] KWNH (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)PRB[EW]HI.*"), "hmean"); - thisMap.put(Pattern.compile("^FMUS2[34] KWNH (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)PRB[EW]HH.*"), "hmax"); - thisMap.put(Pattern.compile("^FMUS2[34] KWNH (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)PRB[EW]HL.*"), "hmin"); - thisMap.put(Pattern.compile("^FXUS06 KWBC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "n610"); - thisMap.put(Pattern.compile("^FEUS40 KWBC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "f610"); //no data to test - thisMap.put(Pattern.compile("^FXUS07 KWBC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "n30"); - thisMap.put(Pattern.compile("^FXUS05 KWBC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "n90"); - thisMap.put(Pattern.compile("^FXHW40 KWBC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "hawaii"); //hawaii instead of h3090 - thisMap.put(Pattern.compile("^FXUS21 KWNC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "PMDTHR"); - thisMap.put(Pattern.compile("^FXUS25 KWNC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "drought"); - thisMap.put(Pattern.compile("^FVAK2[1-5] PAWU (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "volc"); - thisMap.put(Pattern.compile("^WUUS48 KWNS (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "ptsd48"); - thisMap.put(Pattern.compile("^FAUS20 KZ.. (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "mis"); - thisMap.put(Pattern.compile("^FANT02 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "offsh"); //no raw data at all!! - //thisMap.put(Pattern.compile("^WSUS01 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "sgmt"); //no data to test - thisMap.put(Pattern.compile("^WAHW[03]1 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "airm"); - thisMap.put(Pattern.compile("^WAUS01 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "airm"); //no data to test - thisMap.put(Pattern.compile("^WAUS1 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "airm"); //no data to test - thisMap.put(Pattern.compile("^WAAK01 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "airm"); //no data to test - thisMap.put(Pattern.compile("^WOUS20 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "stat"); - thisMap.put(Pattern.compile("^FVXX2[0-7] .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "volc"); - thisMap.put(Pattern.compile("^FVCN0[0-4] .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "volc"); - thisMap.put(Pattern.compile("^FVAU0[2-4] .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "volc"); - thisMap.put(Pattern.compile("^ACUS4[1-5] .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "storm"); - thisMap.put(Pattern.compile("^FSUS02 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "srp"); - thisMap.put(Pattern.compile("^ASUS01 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "sus"); - thisMap.put(Pattern.compile("^FXPA00 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "expac"); //no folder for raw data in server - thisMap.put(Pattern.compile("^ACUS48 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "day48"); - thisMap.put(Pattern.compile("^FNUS31 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)PFWFD1.*"), "pfwfd1"); - thisMap.put(Pattern.compile("^FNUS32 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)PFWFD2.*"), "pfwfd2"); - thisMap.put(Pattern.compile("^FNUS38 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)PFWF38.*"), "pfwf38"); - thisMap.put(Pattern.compile("^WFCN1[1|2] .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "tornado"); - thisMap.put(Pattern.compile("^WUCN1[1|2] .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "severe"); - thisMap.put(Pattern.compile("^WOCN1[1|2] .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "sps"); - thisMap.put(Pattern.compile("^WWCN1[1|2] .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "warwatch"); - thisMap.put(Pattern.compile("^WWCN3[1|2] .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "warnsumm"); - thisMap.put(Pattern.compile("^FOCN45 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "coutlook"); - thisMap.put(Pattern.compile("^ACUS01 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "day1"); - thisMap.put(Pattern.compile("^ACUS02 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "day2"); - thisMap.put(Pattern.compile("^ACUS03 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "day3"); - thisMap.put(Pattern.compile("^WWUS20 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"),"watch"); - thisMap.put(Pattern.compile("^WWUS50 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)SEV[0-9].*"),"sev"); - thisMap.put(Pattern.compile("^WWUS60 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)SEVSPC.*"),"sevmkc"); - thisMap.put(Pattern.compile("^WOUS40 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"),"public"); - thisMap.put(Pattern.compile("^NWUS22 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)STAHRY.*"),"hry"); - thisMap.put(Pattern.compile("^ACUS11 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"),"meso"); - thisMap.put(Pattern.compile("^NWUS20 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)STADTS"),"dts"); - thisMap.put(Pattern.compile("^NWUS20 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"),"svr"); - thisMap.put(Pattern.compile("^WHXX9[09] .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "mdl"); // not sure if this regex is correct - no test data to verify - thisMap.put(Pattern.compile("^WHXX0[1-4] .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "mdl"); - thisMap.put(Pattern.compile("^URNT10 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "antreco"); - thisMap.put(Pattern.compile("^URNT11 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "areco"); - thisMap.put(Pattern.compile("^URNT12 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "avortex"); - thisMap.put(Pattern.compile("^URNT14 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "asupvort"); - thisMap.put(Pattern.compile("^UZNT13 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "adrops"); - thisMap.put(Pattern.compile("^URPN10 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "pntreco"); //no data to test - thisMap.put(Pattern.compile("^URPN11 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "preco");//no data to test - thisMap.put(Pattern.compile("^URPN12 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "pvortex");//no data to test -// thisMap.put(Pattern.compile("^URNT15 KWBC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).+"), "North Atlantic High Density Observations"); -// thisMap.put(Pattern.compile("^URPA15 KWBC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).+"), "North West Pacific High Density Observations"); -// thisMap.put(Pattern.compile("^URPA11 KWBC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).+"), "North West Pacific Reco Observation"); -// thisMap.put(Pattern.compile("^URPA12 KWBC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).+"), "North West Pacific Vortex Data Message"); -// thisMap.put(Pattern.compile("^URPA10 KWBC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).+"), "North West Pacific Reco Observation non-tropical"); -// thisMap.put(Pattern.compile("^URPN15 KWBC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).+"), "North East and Central Pacific High Density Observations"); - - thisMap.put(Pattern.compile("^UZPN13 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "pdrops");//no data to test - thisMap.put(Pattern.compile("^UZPA13 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "wpdrops");//no data to test - thisMap.put(Pattern.compile("^TXUS20 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "satest"); - thisMap.put(Pattern.compile("^SXUS40 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "cgr"); - thisMap.put(Pattern.compile("^SXUS08 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "cgr"); - thisMap.put(Pattern.compile("^SXUS86 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "cgr");//regexes clash for cgr and OMR - thisMap.put(Pattern.compile("^WV.... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "vlcw"); //might clash with regex for inl and sgmt - thisMap.put(Pattern.compile("^W[CSV].... [^KP]... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "intl"); //regexes clash for intl and sgmt - //thisMap.put(Pattern.compile("^W[CSV](NT|PN|PA|AK)[01][0-9] (KKCI|PHFO|PAWU) (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "intl"); //regexes clash for intl and sgmt - //split above pattern to the following 12 patterns so matchFileRegex() can be coded in a generic way. - thisMap.put(Pattern.compile("^W[CSV](NT|PN|PA|AK)[01][0-9] KKCI (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "intl"); //regexes clash for intl and sgmt - thisMap.put(Pattern.compile("^W[CSV]NT[01][0-9] KKCI (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "intl"); //regexes clash for intl and sgmt - thisMap.put(Pattern.compile("^W[CSV]NT[01][0-9] PHFO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "intl"); //regexes clash for intl and sgmt - thisMap.put(Pattern.compile("^W[CSV]NT[01][0-9] PAWU (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "intl"); //regexes clash for intl and sgmt - thisMap.put(Pattern.compile("^W[CSV]PN[01][0-9] KKCI (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "intl"); //regexes clash for intl and sgmt - thisMap.put(Pattern.compile("^W[CSV]PN[01][0-9] PHFO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "intl"); //regexes clash for intl and sgmt - thisMap.put(Pattern.compile("^W[CSV]PN[01][0-9] PAWU (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "intl"); //regexes clash for intl and sgmt - thisMap.put(Pattern.compile("^W[CSV]PA[01][0-9] KKCI (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "intl"); //regexes clash for intl and sgmt - thisMap.put(Pattern.compile("^W[CSV]PA[01][0-9] PHFO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "intl"); //regexes clash for intl and sgmt - thisMap.put(Pattern.compile("^W[CSV]PA[01][0-9] PAWU (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "intl"); //regexes clash for intl and sgmt - thisMap.put(Pattern.compile("^W[CSV]AK[01][0-9] KKCI (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "intl"); //regexes clash for intl and sgmt - thisMap.put(Pattern.compile("^W[CSV]AK[01][0-9] PHFO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "intl"); //regexes clash for intl and sgmt - thisMap.put(Pattern.compile("^W[CSV]AK[01][0-9] PAWU (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "intl"); //regexes clash for intl and sgmt - thisMap.put(Pattern.compile("^WUUS01 KWNS (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "ptsdy1"); //regexes clash for convective outlook point product day1 - thisMap.put(Pattern.compile("^WUUS02 KWNS (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "ptsdy2"); //regexes clash for convective outlook point product day2 - thisMap.put(Pattern.compile("^WUUS03 KWNS (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "ptsdy3"); //regexes clash for convective outlook point product day3 - thisMap.put(Pattern.compile("^WSUS4[012] .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "conv"); - thisMap.put(Pattern.compile("^W[CSV]US0[1-6] KKCI (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "sgmt"); - thisMap.put(Pattern.compile("^WSUK.. .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "sgmt"); - thisMap.put(Pattern.compile("^WS[^U]... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), "sgmt"); //regexes clash for intl and sgmt - thisMap.put(Pattern.compile("^FT.... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)*TAF[A-Z]{3}(.|\r|\n)*"), "taf"); //aviation TAFS - thisMap.put(Pattern.compile("^FT.... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+TAF( |\r|\n){1}(.|\r|\n)*"), "fts"); //aviation TAFS - thisMap.put(Pattern.compile("^...... KWBC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(HSF).*"), "HSF"); //conflicts with FLN - thisMap.put(Pattern.compile("^...... PHFO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(HSF).*"), "HSF"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)*AGO.*"), "AGO"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(FZL).*"), "FZL"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(AFD).*"), "AFD"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(SFP).*"), "SFP"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(ZFP).*"), "ZFP"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(LFP).*"), "LFP"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(CCF).*"), "CCF"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(RDF).*"), "RDF"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(PFM).*"), "PFM"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(AFM).*"), "AFM"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(SFT).*"), "SFT"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(RTP).*"), "RTP"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(CLI).*"), "CLI"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(CLM).*"), "CLM"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(LSR).*"), "LSR"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(RER).*"), "RER"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(NOW).*"), "NOW"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(PNS).*"),"PNS"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(HWO).*"),"HWO"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(RWR).*"),"RWR"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(MIS).*"),"MIS"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(ADA).*"),"ADA"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(SVR).*"),"SVR"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(TOR).*"),"TOR"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(RWS).*"),"RWS"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(WSW).*"),"WSW"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(SPS).*"),"SPS"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(SVS).*"),"SVS"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(SLS).*"),"SLS"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(WCN).*"),"WCN"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(NPW).*"),"NPW"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(HLS).*"),"HLS"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(FFG).*"), "FFG"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(FFA).*"), "FFA"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(FFW).*"), "FFW"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(FFS).*"), "FFS"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(FLS).*"), "FLS"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(FLW).*"), "FLW"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(FLN).*"), "FLN"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(RVS).*"), "RVS"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(RR1).*"), "RR1"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(RR2).*"), "RR2"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(RR3).*"), "RR3"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(RR4).*"), "RR4"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(RR5).*"), "RR5"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(RR6).*"), "RR6"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(RR7).*"), "RR7"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(RR8).*"), "RR8"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(RR9).*"), "RR9"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(RRA).*"), "RRA"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(RRM).*"), "RRM"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(CWF).*"), "CWF"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(OFF).*"), "OFF"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(PLS).*"), "PLS"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(OMR).*"), "OMR"); //regexes clash for cgr and OMR - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(SMW).*"), "SMW"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(CFW).*"), "CFW"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(MWS).*"), "MWS"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(MRP).*"), "MRP"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(MIM).*"), "MIM"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(TAV).*"), "TAV"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(SCS).*"), "SCS"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(TWO).*"), "TWO"); //clashes with outlk - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(TWS).*"), "TWS"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(TWD).*"), "TWD"); //clashes with tdsc - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(TCM).*"), "TCM"); //clashes with mar - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(TCP).*"), "TCP"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(TCD).*"), "TCD"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(TCE).*"), "TCE"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(TCU).*"), "TCU"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(DSA).*"), "DSA"); //clashes with disc - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(RFW).*"), "RFW"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(FWF).*"), "FWF"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(FWM).*"), "FWM"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(RFD).*"), "RFD"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(UVI).*"), "UVI"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(QPFPFD).*"), "QPFPFD"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(QPFERD).*"), "QPFERD"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(QPFHSD).*"), "QPFHSD"); - thisMap.put(Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(FTM).*"), "ftm"); - - return Collections.unmodifiableMap(thisMap); + private static final Set setOfPatterns = NCTEXT_PRODUCT_REGEX_MAP + .keySet(); + + /*** + * Finds the matching Nctext product type by comparing the input file + * content with each regular expression in the HashMap. + * + * @param fileContent + * @return true if a match was found or false otherwise + */ + protected synchronized static boolean matchFileRegex(String fileContent) { + strNctextProductType = new ArrayList(0); + boolean isMatchFound = false; + for (Pattern thisPattern : setOfPatterns) { + Matcher thisMatcher = thisPattern.matcher(fileContent); + + if (thisMatcher.matches()) { + // System.out.println("Current line in file is: " + + // fileContent); + // retrieve the matching product type for the regular expression + String prodType = new String( + NCTEXT_PRODUCT_REGEX_MAP.get(thisPattern)); + // System.out.println("Product type is " + prodType); + // System.out.println("Matching pattern is: " + + // thisPattern.pattern()); + // If the product type is not already in the list... + if (!isNctextProductAlreadyInList(prodType)) { + // add it to the list + strNctextProductType.add(prodType); + + } + // System.out.println("matchFileRegex group count =" + + // thisMatcher.groupCount() ); + // for(int i=0; i< thisMatcher.groupCount();i++){ + // System.out.println("matchFileRegex group " + i+ + // "= "+thisMatcher.group(i)); + // } + if (thisMatcher.groupCount() > 1) { + // get the data captured from the groups of the matcher + String dateFromMatchedPattern = new String( + thisMatcher.group(1)); + String hourFromMatchedPattern = new String( + thisMatcher.group(2)); + String minuteFromMatchedPattern = new String( + thisMatcher.group(3)); + try { + parsedDate = new Integer( + Integer.parseInt(dateFromMatchedPattern)); + parsedHour = new Integer( + Integer.parseInt(hourFromMatchedPattern)); + parsedMinute = new Integer( + Integer.parseInt(minuteFromMatchedPattern)); + } catch (NumberFormatException e) { + System.out + .println("matchFileRegex(): NumberFormatException event: for product type " + + prodType); + continue; + } + } + isMatchFound = true; + } + thisMatcher.reset(); + } + // System.out.println("matchFileRegex returning "+ isMatchFound); + return isMatchFound; + } + + /*** + * Checks if the input Nctext product typeis already present in the list + * + * @param productType + * - the String object denoting the Nctext product type + * @return true if the product type exists in the list or false otherwise + */ + private synchronized static boolean isNctextProductAlreadyInList( + String productType) { + for (String currentString : strNctextProductType) { + if (currentString.compareTo(productType) == 0) { + return true; + } + } + return false; + } + + /*** + * Creates and initializes a {@code HashMap} with the + * regular expression as the key and the Nctext product type as the value. + * + *
+     *  {@code } - the compiled regular expression
+     *  {@code } - the Nctext product type
+     * 
+ * + * @return the initialized unmodifiable {@code Map} + */ + private synchronized static Map initializeMap() { + Map thisMap = new HashMap(0); + // TODO - uncomment the regular expressions for (hrly, snd, syn) once + // the database tables are updated + // to handle ObservedData products + + // thisMap.put(Pattern.compile("^S[AP].... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])"), + // "hrly"); + // thisMap.put(Pattern.compile("^U[CEFGHIJKLMNPQSWXY].... .... (0[1-9]|[12][0-9]|3[01])"), + // "snd"); + + // TODO - create a separate Pattern outside the HashMap for syn, since + // it does not have any digits + // and the code will crash when it tries to extract a digit from the + // captured regular expression groups + + // thisMap.put(Pattern.compile("(^S[IM]V[IGNS])|(^SNV[INS])|(^S[IMN](W[KZ]|[^VW]))"), + // "syn"); + + // Chin: add \n to separate the 2 lines to make regular expression work + // "correctly" on those products with + // product type coded at 2nd line + thisMap.put( + Pattern.compile("^FXCA62 TJSJ (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "area"); + thisMap.put( + Pattern.compile("^FXUS[67][1-6] .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "area"); + thisMap.put( + Pattern.compile("^FPAK20 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "area");// no data to test + thisMap.put( + Pattern.compile("^FPHW03 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "area");// no data to test + // thisMap.put(Pattern.compile("^FX(HW|PN|PS)60 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + // "area"); + // split above pattern to the following 3 patterns so matchFileRegex() + // can be coded in a generic way. + thisMap.put( + Pattern.compile("^FXHW60 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "area"); + thisMap.put( + Pattern.compile("^FXPN60 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "area"); + thisMap.put( + Pattern.compile("^FXPS60 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "area"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)FA[0-9].*"), + "area"); // aviation forecasts + thisMap.put( + Pattern.compile("^WWUS30 KWNS (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "wtch2"); + thisMap.put( + Pattern.compile("^FNUS21 KWNS (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "fwddy1"); + thisMap.put( + Pattern.compile("^FNUS22 KWNS (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "fwddy2"); + thisMap.put( + Pattern.compile("^FNUS28 KWNS (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "fwddy38"); + thisMap.put( + Pattern.compile("^FNUS21 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)FWDDY1.*"), + "fire1"); // spc uses this regex for fwddy1 also + thisMap.put( + Pattern.compile("^FNUS22 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)FWDDY2.*"), + "fire2"); // spc uses this regex for fwddy2 also + thisMap.put( + Pattern.compile("^WOUS64 KWNS (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "wou"); + thisMap.put( + Pattern.compile("^ABNT20 KNHC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "outlk"); // clashes with TWO + thisMap.put( + Pattern.compile("^ACPN50 PHFO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "outlk"); + thisMap.put( + Pattern.compile("^ABPZ20 KNHC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "outlk"); + thisMap.put( + Pattern.compile("^ABCA33 TJSJ (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "outlk"); + thisMap.put( + Pattern.compile("^WTNT4[1-5] KNHC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "disc"); + thisMap.put( + Pattern.compile("^WTPA4[1-5] PHFO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "disc"); + thisMap.put( + Pattern.compile("^WTPZ4[1-5] KNHC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "disc"); + thisMap.put( + Pattern.compile("^WONT41 KNHC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "disc"); + thisMap.put( + Pattern.compile("^WTNT3[1-5] KNHC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "pblc"); + thisMap.put( + Pattern.compile("^WTNT3[1-5] KWNH (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "pblc"); + thisMap.put( + Pattern.compile("^WTPA3[1-5] PHFO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "pblc"); + thisMap.put( + Pattern.compile("^WTPZ3[1-5] KNHC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "pblc"); + thisMap.put( + Pattern.compile("^WTPZ3[1-5] KWNH (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "pblc"); + thisMap.put( + Pattern.compile("^WTCA4[1-5] TJSJ (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "pblc"); + thisMap.put( + Pattern.compile("^WHCA31 TFFF (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "pblc"); + thisMap.put( + Pattern.compile("^WTPN2[1-5] PGTW (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "pblc"); + thisMap.put( + Pattern.compile("^WTNT2[1-5] KNHC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "mar"); + thisMap.put( + Pattern.compile("^WTPA2[1-5] PHFO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "mar"); + thisMap.put( + Pattern.compile("^WTPZ2[1-5] KNHC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "mar"); + thisMap.put( + Pattern.compile("^W[H|T]PS01 NFFN (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "mar"); + thisMap.put( + Pattern.compile("^WTPN3[1-5] PGTW (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "mar"); + thisMap.put( + Pattern.compile("^URNT12 KNHC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "rcn"); + thisMap.put( + Pattern.compile("^U[RZ]NT14 KWBC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "rcn");// no test data + thisMap.put( + Pattern.compile("^AXPZ20 KNHC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "tdsc"); // clashes with TWD + thisMap.put( + Pattern.compile("^AXNT20 KNHC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "tdsc"); // clashes with TWD + thisMap.put( + Pattern.compile("^WTNT7[1-5] KNHC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "strk"); + thisMap.put( + Pattern.compile("^NOUS42 KNHC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "pod"); // no regex for aasdl and pasdl + thisMap.put( + Pattern.compile("^WWJP25 RJTD (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "HSF"); + thisMap.put( + Pattern.compile("^WCPA3[1-5] PHFO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "conv"); + thisMap.put( + Pattern.compile("^WSUS3[1-3] KKCI (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "conv"); + thisMap.put( + Pattern.compile("^WAUS4[1-6] KKCI (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "airm"); + thisMap.put( + Pattern.compile("^WAAK4[7-9] PAWU (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "airm"); + thisMap.put( + Pattern.compile("^FAAK2[1-6] KZAN (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "cwa"); + thisMap.put( + Pattern.compile("^FAUS2[1-6] KZ.. (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "cwa"); + thisMap.put( + Pattern.compile("^WCUS2[1-6] KZ.. (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "cwa"); + thisMap.put( + Pattern.compile("^FAUS20 PANC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "mis"); + thisMap.put( + Pattern.compile("^FOUS14 KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "ngmmos"); + thisMap.put( + Pattern.compile("^FOAK2[5-9] KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "ngmmos"); + thisMap.put( + Pattern.compile("^FOPA20 KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "gfsmos"); + thisMap.put( + Pattern.compile("^FOUS2[1-6] KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "gfsmos"); + thisMap.put( + Pattern.compile("^FOAK3[7-9] KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "gfsmos"); + thisMap.put( + Pattern.compile("^FEPA20 KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "gfsxmos"); + thisMap.put( + Pattern.compile("^FEUS2[1-6] KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "gfsxmos"); + thisMap.put( + Pattern.compile("^FEAK3[7-9] KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "gfsxmos"); + thisMap.put( + Pattern.compile("^FECN21 KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "gfsxmos"); + thisMap.put( + Pattern.compile("^FOUS4[4-9] KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "etamos"); + thisMap.put( + Pattern.compile("^FQUS2[1-6] KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)MMG.*"), + "marnmos"); + thisMap.put( + Pattern.compile("^FQAK37 KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)MMG.*"), + "marnmos"); + thisMap.put( + Pattern.compile("^FQPA20 KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)MMG.*"), + "marnmos"); + thisMap.put( + Pattern.compile("^FOUE6[0-4] KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "ngmgd"); + thisMap.put( + Pattern.compile("^FOUE80 KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "ngmgd"); + thisMap.put( + Pattern.compile("^FOUM6[5-9] KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "ngmgd"); + thisMap.put( + Pattern.compile("^FOUM7[01] KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "ngmgd"); + thisMap.put( + Pattern.compile("^FOUM8[124] KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "ngmgd"); + thisMap.put( + Pattern.compile("^FOUS8[6-9] KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "ngmgd"); + thisMap.put( + Pattern.compile("^FOUS90 KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "ngmgd"); + thisMap.put( + Pattern.compile("^FOUW7[238] KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "ngmgd"); + thisMap.put( + Pattern.compile("^FOUW83 KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "ngmgd"); + thisMap.put( + Pattern.compile("^FOHW50 KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "ngmgd"); + thisMap.put( + Pattern.compile("^FOCA5[12] KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "ngmgd"); + thisMap.put( + Pattern.compile("^FOCN7[456] KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "ngmgd"); + thisMap.put( + Pattern.compile("^FOGX77 KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "ngmgd"); + thisMap.put( + Pattern.compile("^FOUS6[0-9] KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "etagd"); + thisMap.put( + Pattern.compile("^FOUS7[0-8] KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "etagd"); + thisMap.put( + Pattern.compile("^FXUS02 KWBC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)PMDEPD.*"), + "PMDEPD"); + thisMap.put( + Pattern.compile("^FXUS02 KWNH (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)PREEPD.*"), + "PREEPD"); + thisMap.put( + Pattern.compile("^FXUS01 KWBC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)PMDSPD.*"), + "PMDSPD"); + thisMap.put( + Pattern.compile("^FXHW01 KWNH (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)PMDHI.*"), + "PMDHI"); + thisMap.put( + Pattern.compile("^FXSA20 KWBC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)PMDSA.*"), + "PMDSA"); + thisMap.put( + Pattern.compile("^FXCA20 KWBC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)PMDCA.*"), + "PMDCA"); + thisMap.put( + Pattern.compile("^FXAK02 KWNH (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)PMDAK.*"), + "PMDAK"); + // Chin: new admin message group + /* + * thisMap.put( Pattern.compile( + * "^NOUS42 KWBC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+" + * ), "sdm"); thisMap.put( Pattern.compile( + * "^NOUS42 KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+" + * ), "sdm"); + */ + thisMap.put( + Pattern.compile("^NOUS42 KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "sdmam"); + thisMap.put( + Pattern.compile("^NOUS71 KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "sdmdhm"); + thisMap.put( + Pattern.compile("^NOUS72 KNCF (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "ncfam"); + thisMap.put( + Pattern.compile("^NOUS71 KNES (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "nesdispm"); + thisMap.put( + Pattern.compile("^NOUS72 KNES (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "nesdisam"); + thisMap.put( + Pattern.compile("^NOCN05 CWAO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "cmcam"); + thisMap.put( + Pattern.compile("^AACN01 CWAO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "cmcam"); + thisMap.put( + Pattern.compile("^NOXX01 KWBC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "nwstgam"); + /* + * thisMap.put( Pattern.compile( + * "^NPXX10 KWBC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+" + * ), "intl"); thisMap.put( Pattern.compile( + * "^NPXX10 KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+" + * ), "intl"); + */ + thisMap.put( + Pattern.compile("^NPXX10 KWNO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "sdmim"); + // end admin message group + thisMap.put( + Pattern.compile("^FXUS10 KWNH (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "PMDHMD"); + thisMap.put( + Pattern.compile("^FMUS2[34] KWNH (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)PRB[EW]HI.*"), + "hmean"); + thisMap.put( + Pattern.compile("^FMUS2[34] KWNH (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)PRB[EW]HH.*"), + "hmax"); + thisMap.put( + Pattern.compile("^FMUS2[34] KWNH (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)PRB[EW]HL.*"), + "hmin"); + thisMap.put( + Pattern.compile("^FXUS06 KWBC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "n610"); + thisMap.put( + Pattern.compile("^FEUS40 KWBC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "f610"); // no data to test + thisMap.put( + Pattern.compile("^FXUS07 KWBC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "n30"); + thisMap.put( + Pattern.compile("^FXUS05 KWBC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "n90"); + thisMap.put( + Pattern.compile("^FXHW40 KWBC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "hawaii"); // hawaii instead of h3090 + thisMap.put( + Pattern.compile("^FXUS21 KWNC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "PMDTHR"); + thisMap.put( + Pattern.compile("^FXUS25 KWNC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "drought"); + thisMap.put( + Pattern.compile("^FVAK2[1-5] PAWU (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "volc"); + thisMap.put( + Pattern.compile("^WUUS48 KWNS (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "ptsd48"); + thisMap.put( + Pattern.compile("^FAUS20 KZ.. (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "mis"); + thisMap.put( + Pattern.compile("^FANT02 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "offsh"); // no raw data at all!! + // thisMap.put(Pattern.compile("^WSUS01 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + // "sgmt"); //no data to test + thisMap.put( + Pattern.compile("^WAHW[03]1 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "airm"); + thisMap.put( + Pattern.compile("^WAUS01 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "airm"); // no data to test + thisMap.put( + Pattern.compile("^WAUS1 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "airm"); // no data to test + thisMap.put( + Pattern.compile("^WAAK01 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "airm"); // no data to test + thisMap.put( + Pattern.compile("^WOUS20 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "stat"); + thisMap.put( + Pattern.compile("^FVXX2[0-7] .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "volc"); + thisMap.put( + Pattern.compile("^FVCN0[0-4] .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "volc"); + thisMap.put( + Pattern.compile("^FVAU0[2-4] .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "volc"); + thisMap.put( + Pattern.compile("^ACUS4[1-5] .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "storm"); + thisMap.put( + Pattern.compile("^FSUS02 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "srp"); + thisMap.put( + Pattern.compile("^ASUS01 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "sus"); + thisMap.put( + Pattern.compile("^FXPA00 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "expac"); // no folder for raw data in server + thisMap.put( + Pattern.compile("^ACUS48 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "day48"); + thisMap.put( + Pattern.compile("^FNUS31 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)PFWFD1.*"), + "pfwfd1"); + thisMap.put( + Pattern.compile("^FNUS32 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)PFWFD2.*"), + "pfwfd2"); + thisMap.put( + Pattern.compile("^FNUS38 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)PFWF38.*"), + "pfwf38"); + thisMap.put( + Pattern.compile("^WFCN1[1|2] .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "tornado"); + thisMap.put( + Pattern.compile("^WUCN1[1|2] .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "severe"); + thisMap.put( + Pattern.compile("^WOCN1[1|2] .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "sps"); + thisMap.put( + Pattern.compile("^WWCN1[1|2] .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "warwatch"); + thisMap.put( + Pattern.compile("^WWCN3[1|2] .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "warnsumm"); + thisMap.put( + Pattern.compile("^FOCN45 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "coutlook"); + thisMap.put( + Pattern.compile("^ACUS01 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "day1"); + thisMap.put( + Pattern.compile("^ACUS02 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "day2"); + thisMap.put( + Pattern.compile("^ACUS03 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "day3"); + thisMap.put( + Pattern.compile("^WWUS20 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "watch"); + thisMap.put( + Pattern.compile("^WWUS50 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)SEV[0-9].*"), + "sev"); + thisMap.put( + Pattern.compile("^WWUS60 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)SEVSPC.*"), + "sevmkc"); + thisMap.put( + Pattern.compile("^WOUS40 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "public"); + thisMap.put( + Pattern.compile("^NWUS22 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)STAHRY.*"), + "hry"); + thisMap.put( + Pattern.compile("^ACUS11 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "meso"); + thisMap.put( + Pattern.compile("^NWUS20 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)STADTS"), + "dts"); + thisMap.put( + Pattern.compile("^NWUS20 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "svr"); + thisMap.put( + Pattern.compile("^WHXX9[09] .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "mdl"); // not sure if this regex is correct - no test data to + // verify + thisMap.put( + Pattern.compile("^WHXX0[1-4] .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "mdl"); + thisMap.put( + Pattern.compile("^URNT10 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "antreco"); + thisMap.put( + Pattern.compile("^URNT11 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "areco"); + thisMap.put( + Pattern.compile("^URNT12 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "avortex"); + thisMap.put( + Pattern.compile("^URNT14 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "asupvort"); + thisMap.put( + Pattern.compile("^UZNT13 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "adrops"); + thisMap.put( + Pattern.compile("^URPN10 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "pntreco"); // no data to test + thisMap.put( + Pattern.compile("^URPN11 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "preco");// no data to test + thisMap.put( + Pattern.compile("^URPN12 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "pvortex");// no data to test + // thisMap.put(Pattern.compile("^URNT15 KWBC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).+"), + // "North Atlantic High Density Observations"); + // thisMap.put(Pattern.compile("^URPA15 KWBC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).+"), + // "North West Pacific High Density Observations"); + // thisMap.put(Pattern.compile("^URPA11 KWBC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).+"), + // "North West Pacific Reco Observation"); + // thisMap.put(Pattern.compile("^URPA12 KWBC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).+"), + // "North West Pacific Vortex Data Message"); + // thisMap.put(Pattern.compile("^URPA10 KWBC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).+"), + // "North West Pacific Reco Observation non-tropical"); + // thisMap.put(Pattern.compile("^URPN15 KWBC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).+"), + // "North East and Central Pacific High Density Observations"); + + thisMap.put( + Pattern.compile("^UZPN13 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "pdrops");// no data to test + thisMap.put( + Pattern.compile("^UZPA13 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "wpdrops");// no data to test + thisMap.put( + Pattern.compile("^TXUS20 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "satest"); + thisMap.put( + Pattern.compile("^SXUS40 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "cgr"); + thisMap.put( + Pattern.compile("^SXUS08 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "cgr"); + thisMap.put( + Pattern.compile("^SXUS86 .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "cgr");// regexes clash for cgr and OMR + thisMap.put( + Pattern.compile("^WV.... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "vlcw"); // might clash with regex for inl and sgmt + thisMap.put( + Pattern.compile("^W[CSV].... [^KP]... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "intl"); // regexes clash for intl and sgmt + // thisMap.put(Pattern.compile("^W[CSV](NT|PN|PA|AK)[01][0-9] (KKCI|PHFO|PAWU) (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + // "intl"); //regexes clash for intl and sgmt + // split above pattern to the following 12 patterns so matchFileRegex() + // can be coded in a generic way. + thisMap.put( + Pattern.compile("^W[CSV](NT|PN|PA|AK)[01][0-9] KKCI (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "intl"); // regexes clash for intl and sgmt + thisMap.put( + Pattern.compile("^W[CSV]NT[01][0-9] KKCI (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "intl"); // regexes clash for intl and sgmt + thisMap.put( + Pattern.compile("^W[CSV]NT[01][0-9] PHFO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "intl"); // regexes clash for intl and sgmt + thisMap.put( + Pattern.compile("^W[CSV]NT[01][0-9] PAWU (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "intl"); // regexes clash for intl and sgmt + thisMap.put( + Pattern.compile("^W[CSV]PN[01][0-9] KKCI (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "intl"); // regexes clash for intl and sgmt + thisMap.put( + Pattern.compile("^W[CSV]PN[01][0-9] PHFO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "intl"); // regexes clash for intl and sgmt + thisMap.put( + Pattern.compile("^W[CSV]PN[01][0-9] PAWU (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "intl"); // regexes clash for intl and sgmt + thisMap.put( + Pattern.compile("^W[CSV]PA[01][0-9] KKCI (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "intl"); // regexes clash for intl and sgmt + thisMap.put( + Pattern.compile("^W[CSV]PA[01][0-9] PHFO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "intl"); // regexes clash for intl and sgmt + thisMap.put( + Pattern.compile("^W[CSV]PA[01][0-9] PAWU (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "intl"); // regexes clash for intl and sgmt + thisMap.put( + Pattern.compile("^W[CSV]AK[01][0-9] KKCI (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "intl"); // regexes clash for intl and sgmt + thisMap.put( + Pattern.compile("^W[CSV]AK[01][0-9] PHFO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "intl"); // regexes clash for intl and sgmt + thisMap.put( + Pattern.compile("^W[CSV]AK[01][0-9] PAWU (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "intl"); // regexes clash for intl and sgmt + thisMap.put( + Pattern.compile("^WUUS01 KWNS (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "ptsdy1"); // regexes clash for convective outlook point product + // day1 + thisMap.put( + Pattern.compile("^WUUS02 KWNS (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "ptsdy2"); // regexes clash for convective outlook point product + // day2 + thisMap.put( + Pattern.compile("^WUUS03 KWNS (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "ptsdy3"); // regexes clash for convective outlook point product + // day3 + thisMap.put( + Pattern.compile("^WSUS4[012] .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "conv"); + thisMap.put( + Pattern.compile("^W[CSV]US0[1-6] KKCI (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "sgmt"); + thisMap.put( + Pattern.compile("^WSUK.. .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "sgmt"); + thisMap.put( + Pattern.compile("^WS[^U]... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+"), + "sgmt"); // regexes clash for intl and sgmt + thisMap.put( + Pattern.compile("^FT.... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)*TAF[A-Z]{3}(.|\r|\n)*"), + "taf"); // aviation TAFS + thisMap.put( + Pattern.compile("^FT.... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)+TAF( |\r|\n){1}(.|\r|\n)*"), + "fts"); // aviation TAFS + thisMap.put( + Pattern.compile("^...... KWBC (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(HSF).*"), + "HSF"); // conflicts with FLN + thisMap.put( + Pattern.compile("^...... PHFO (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(HSF).*"), + "HSF"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])(.|\r|\n)*AGO.*"), + "AGO"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(FZL).*"), + "FZL"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(AFD).*"), + "AFD"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(SFP).*"), + "SFP"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(ZFP).*"), + "ZFP"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(LFP).*"), + "LFP"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(CCF).*"), + "CCF"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(RDF).*"), + "RDF"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(PFM).*"), + "PFM"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(AFM).*"), + "AFM"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(SFT).*"), + "SFT"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(RTP).*"), + "RTP"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(CLI).*"), + "CLI"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(CLM).*"), + "CLM"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(LSR).*"), + "LSR"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(RER).*"), + "RER"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(NOW).*"), + "NOW"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(PNS).*"), + "PNS"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(HWO).*"), + "HWO"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(RWR).*"), + "RWR"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(MIS).*"), + "MIS"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(ADA).*"), + "ADA"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(SVR).*"), + "SVR"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(TOR).*"), + "TOR"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(RWS).*"), + "RWS"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(WSW).*"), + "WSW"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(SPS).*"), + "SPS"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(SVS).*"), + "SVS"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(SLS).*"), + "SLS"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(WCN).*"), + "WCN"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(NPW).*"), + "NPW"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(HLS).*"), + "HLS"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(FFG).*"), + "FFG"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(FFA).*"), + "FFA"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(FFW).*"), + "FFW"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(FFS).*"), + "FFS"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(FLS).*"), + "FLS"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(FLW).*"), + "FLW"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(FLN).*"), + "FLN"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(RVS).*"), + "RVS"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(RR1).*"), + "RR1"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(RR2).*"), + "RR2"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(RR3).*"), + "RR3"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(RR4).*"), + "RR4"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(RR5).*"), + "RR5"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(RR6).*"), + "RR6"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(RR7).*"), + "RR7"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(RR8).*"), + "RR8"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(RR9).*"), + "RR9"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(RRA).*"), + "RRA"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(RRM).*"), + "RRM"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(CWF).*"), + "CWF"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(OFF).*"), + "OFF"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(PLS).*"), + "PLS"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(OMR).*"), + "OMR"); // regexes clash for cgr and OMR + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(SMW).*"), + "SMW"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(CFW).*"), + "CFW"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(MWS).*"), + "MWS"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(MRP).*"), + "MRP"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(MIM).*"), + "MIM"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(TAV).*"), + "TAV"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(SCS).*"), + "SCS"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(TWO).*"), + "TWO"); // clashes with outlk + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(TWS).*"), + "TWS"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(TWD).*"), + "TWD"); // clashes with tdsc + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(TCM).*"), + "TCM"); // clashes with mar + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(TCP).*"), + "TCP"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(TCD).*"), + "TCD"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(TCE).*"), + "TCE"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(TCU).*"), + "TCU"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(DSA).*"), + "DSA"); // clashes with disc + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(RFW).*"), + "RFW"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(FWF).*"), + "FWF"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(FWM).*"), + "FWM"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(RFD).*"), + "RFD"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(UVI).*"), + "UVI"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(QPFPFD).*"), + "QPFPFD"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(QPFERD).*"), + "QPFERD"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(QPFHSD).*"), + "QPFHSD"); + thisMap.put( + Pattern.compile("^...... .... (0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]).*(\n|\r)(FTM).*"), + "ftm"); + + return Collections.unmodifiableMap(thisMap); + + } - } - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ncep/gov.noaa.nws.ncep.edex.plugin.nctext/src/gov/noaa/nws/ncep/edex/plugin/nctext/decoder/NctextSeparator.java b/ncep/gov.noaa.nws.ncep.edex.plugin.nctext/src/gov/noaa/nws/ncep/edex/plugin/nctext/decoder/NctextSeparator.java index 87bdb48e95..8824c2d70b 100644 --- a/ncep/gov.noaa.nws.ncep.edex.plugin.nctext/src/gov/noaa/nws/ncep/edex/plugin/nctext/decoder/NctextSeparator.java +++ b/ncep/gov.noaa.nws.ncep.edex.plugin.nctext/src/gov/noaa/nws/ncep/edex/plugin/nctext/decoder/NctextSeparator.java @@ -10,6 +10,7 @@ * Date Ticket# Engineer Description * ------- ------- -------- ----------- * 10/23/2009 TBD Chin Chen Initial coding + * 07/10/2014 Chin Chen .fixed month adjustment * * * @@ -63,20 +64,41 @@ public class NctextSeparator extends AbstractRecordSeparator { public static final String R_TYPE_SEPARATOR2 = "00///"; public static final String R_TYPE_SEPARATOR3 = "[A-Z]{3,4}"; - - public static String [][] gdStnGp= {{"PWM","BGR","CAR","CON","AFA"},{"ALB","BOS","PHL","BTV","LGA","IPT"},{"DCA","RDU","ILM","ORF","HAT"}, - {"CAE","MIA","TLH","SAV","LAL"},{"BUF","CLE","CRW","PIT","DAY","IND"},{"STL","MEM","TYS","SDF","BNA","ATL"},{"BHM","JAN","SHV","MOB","MSY","LIT"}, - {"DTW","MKE","INL","SSM","MSP","ORD"},{"DSM","DDC","LBF","TOP","OMA","BFF"},{"OKC","SAT","BRO","DFW","IAH","DRT"},{"BIS","RAP","BIL","FSD","GTF","MSO"}, - {"LBB","ABQ","DEN","ELP","PHX","CYS"},{"SEA","PDX","BOI","GEG","MFR","PIH"},{"SFO","LAX","SLC","FAT","RNO","CDC"},{"YQB","YOW","YYB","YQT","YMW","YLH"}, - {"YWG","YQR","YYC","YQD","YPA","YEG"},{"MCD","YXC","YVR","YRV","YCG","YXS"}, {"X68","EDW","LWS","UCC","BTNM","LGIN"}, {"SYR","ROA","ZZV","AOO","AVL"}, - {"SGF","GRB","GJT","JKL","MLI","FAR","LND"},{"MAF","LCH","TUL","DHT","DHN","DAB"},{"GGW","RDD","LAS","PDT","EKO","FLG"}, - {"AKN","CZF","EDF","EHM","SVW","TLJ"},{"EIL","GAL","LUR","TNC","UTO"},{"ANC","ANN","CDV","JNU","ORT","YAK"},{"ADQ","BET","CDB","MCG","SNP"}, - {"BRW","BTI","BTT","FAI","OME","OTZ"},{"TJSJ","TJMZ","TJPS","TJBQ","TJGU","TJAD"},{"TIST","TISX","TNCM","TKPK","TJNR","TISJ"},{"PHNL","PHLI","PHOG","PHTO","HIB1","HIB4"}}; + + public static String[][] gdStnGp = { { "PWM", "BGR", "CAR", "CON", "AFA" }, + { "ALB", "BOS", "PHL", "BTV", "LGA", "IPT" }, + { "DCA", "RDU", "ILM", "ORF", "HAT" }, + { "CAE", "MIA", "TLH", "SAV", "LAL" }, + { "BUF", "CLE", "CRW", "PIT", "DAY", "IND" }, + { "STL", "MEM", "TYS", "SDF", "BNA", "ATL" }, + { "BHM", "JAN", "SHV", "MOB", "MSY", "LIT" }, + { "DTW", "MKE", "INL", "SSM", "MSP", "ORD" }, + { "DSM", "DDC", "LBF", "TOP", "OMA", "BFF" }, + { "OKC", "SAT", "BRO", "DFW", "IAH", "DRT" }, + { "BIS", "RAP", "BIL", "FSD", "GTF", "MSO" }, + { "LBB", "ABQ", "DEN", "ELP", "PHX", "CYS" }, + { "SEA", "PDX", "BOI", "GEG", "MFR", "PIH" }, + { "SFO", "LAX", "SLC", "FAT", "RNO", "CDC" }, + { "YQB", "YOW", "YYB", "YQT", "YMW", "YLH" }, + { "YWG", "YQR", "YYC", "YQD", "YPA", "YEG" }, + { "MCD", "YXC", "YVR", "YRV", "YCG", "YXS" }, + { "X68", "EDW", "LWS", "UCC", "BTNM", "LGIN" }, + { "SYR", "ROA", "ZZV", "AOO", "AVL" }, + { "SGF", "GRB", "GJT", "JKL", "MLI", "FAR", "LND" }, + { "MAF", "LCH", "TUL", "DHT", "DHN", "DAB" }, + { "GGW", "RDD", "LAS", "PDT", "EKO", "FLG" }, + { "AKN", "CZF", "EDF", "EHM", "SVW", "TLJ" }, + { "EIL", "GAL", "LUR", "TNC", "UTO" }, + { "ANC", "ANN", "CDV", "JNU", "ORT", "YAK" }, + { "ADQ", "BET", "CDB", "MCG", "SNP" }, + { "BRW", "BTI", "BTT", "FAI", "OME", "OTZ" }, + { "TJSJ", "TJMZ", "TJPS", "TJBQ", "TJGU", "TJAD" }, + { "TIST", "TISX", "TNCM", "TKPK", "TJNR", "TISJ" }, + { "PHNL", "PHLI", "PHOG", "PHTO", "HIB1", "HIB4" } }; public static final byte ASCII_RS = 0x1E; // record separator "^^" + public static final byte ASCII_SP = 0x20; // SPACE - - // private static final int DTGROUP_SIZE = 6; private String cccc = null; @@ -143,6 +165,8 @@ public class NctextSeparator extends AbstractRecordSeparator { */ public NctextSeparator(String traceId) { this.traceId = traceId; + System.out.println("NctextSeparator constructed with traceId=" + + traceId); nctextInputFileTypeDao = new NctextInputFileTypeDao(); int ind = traceId.indexOf('.'); if (ind > 0) @@ -335,299 +359,164 @@ public class NctextSeparator extends AbstractRecordSeparator { */ @Override public void setData(byte[] rawMessage, Headers headers) { - /* - currentReport = -1; - - // Now check for some binary data types, Stop decoding, if it is binary - String sRawMessage = new String(rawMessage); - int pos = sRawMessage.indexOf("BUFR"); - boolean notStored = false; - notStored = notStored || ((pos >= 0) && (pos < 20)); - pos = sRawMessage.indexOf("GRIB"); - notStored = notStored || ((pos >= 0) && (pos < 20)); - pos = sRawMessage.indexOf("JPG"); - notStored = notStored || ((pos >= 0) && (pos < 20)); - pos = sRawMessage.indexOf("PNG"); - notStored = notStored || ((pos >= 0) && (pos < 20)); - pos = sRawMessage.indexOf("GIF87"); - notStored = notStored || ((pos >= 0) && (pos < 20)); - - int rawMsglength = rawMessage.length; // - // * start from this, and - // * decremented when each bulletin - // * found - // - int rawMsgPointer = 0;//* - // * start from 0 and incremented when each bulletin - // * found - // - int recordId = 1; ///* to record number of records with same AWIPS header - reports = new ArrayList(); - String sRawMsgInProcessing = null; - int endPos; - int rsPos, nextRsPos, curPos; - if (!notStored) { - String fileType = nctextInputFileTypeDao - .getFiletypeType(ingestFileExt); - while (rawMsglength > 0) { - sRawMsgInProcessing = sRawMessage.substring(rawMsgPointer); - // Parsing record header and find a "section" A section may - // contain more than one record for some data type, e.g. M type - // (MOS). - if (parseHeader(sRawMsgInProcessing)) { - // Start of a "section" found after a Ctl-A, - endPos = sRawMsgInProcessing - .indexOf(IDecoderConstants.ASCII_ETX); // Ctl-C - // set data to record - if (endPos > messageDataStart) { - // handle special type of data, e.g M,etc.. type - if (fileType.equals("M")) { - - // M type data has several records in one "section". - // They are separated by Record Separator "^^". - rsPos = sRawMsgInProcessing.indexOf(ASCII_RS); // find - // first - // RS - // testCount++; - // if((testCount %50) == 0){ - // System.out.println("M type data: " + testCount+ - // " enterred! end position = "+ endPos+ - // "1st rs pos = "+rsPos); - // } - - // cumRsPos = rsPos; - if ((rsPos >= 0) && (rsPos < endPos)) { - // String sMRawMsg = - // sRawMsgInProcessing.substring(rsPos+1);//move - // string to after first RS - // get stnid=xxxx which is 4 chars right after - // RS, like this ^^XXXX - // String stnId = sMRawMsg.substring(0, 4); - String stnId = sRawMsgInProcessing.substring( - rsPos + 1, rsPos + 5); - // nextRsPos = sMRawMsg.indexOf(ASCII_RS); //2nd - // RS - curPos = rsPos + 1; - nextRsPos = sRawMsgInProcessing.indexOf( - ASCII_RS, curPos); // 2nd RS - // cumRsPos = cumRsPos + nextRsPos; - int testCount1 = 0; - while ((nextRsPos >= 0) - && (nextRsPos < endPos)) { - // find record(s) within the section, store - // it - testCount1++; - // if((testCount1 %50) == 1) - // System.out.println(" number RS = "+ - // testCount); - // System.out.println("cur pos = "+curPos+ - // " next rs pos = "+ nextRsPos); - NctextRecord nctextrecord = new NctextRecord(); - setNctextRecord(nctextrecord); - // nctextrecord.setRawRecord(sMRawMsg.substring(0, - // nextRsPos-1)); - nctextrecord - .setRawRecord(sRawMsgInProcessing - .substring(curPos, - nextRsPos - 1)); - nctextrecord.setRecordId(recordId++); - nctextrecord.setIssueSite(stnId); // replace - // cccc - // with - // stndId - // found - // for - // this - // record - reports.add(nctextrecord); - - // sMRawMsg = - // sMRawMsg.substring(nextRsPos+1);//move - // string to after current next RS - // nextRsPos = - // sMRawMsg.indexOf(ASCII_RS);//new next RS - stnId = sRawMsgInProcessing.substring( - nextRsPos + 1, nextRsPos + 5); - // cumRsPos = cumRsPos + nextRsPos; - curPos = nextRsPos + 1; - - nextRsPos = sRawMsgInProcessing.indexOf( - ASCII_RS, nextRsPos + 1);// new next - // RS - // stnId = sMRawMsg.substring(0, 4); - - } - // Handle the last record which is NOT saved in - // the while loop - NctextRecord nctextrecord = new NctextRecord(); - setNctextRecord(nctextrecord); - // nctextrecord.setRawRecord(sMRawMsg); - nctextrecord.setRawRecord(sRawMsgInProcessing - .substring(curPos, endPos - 1)); - nctextrecord.setRecordId(recordId++); - nctextrecord.setIssueSite(stnId); // replace - // cccc with - // stndId - // found for - // this record - reports.add(nctextrecord); - // System.out.println(" number RS = "+ - // testCount); - } else { - // Chin debug - System.out - .println("setData for M type: find wmoHeader " - + (recordId - 1) - + ": " - + WMOId - + " " - + cccc - + " " - + YYGGgg - + " " - + awipsId - + " BUT, no RS ^^ found!"); - - rawMsglength = 0; ///* get out of here - } - // System.out.println("M type report size : "+ - // reports.size()); - - } else { - // other data type - I.e. B,Z,R,O,F, W type - int recordEndPos = endPos; - recordEndPos--; // exclude Ctl-C - // Adjust record end position by skipping CR and LN - // at end of record - while (recordEndPos > 0) { - if ((sRawMsgInProcessing.charAt(recordEndPos) == IDecoderConstants.ASCII_LF) - || (sRawMsgInProcessing - .charAt(recordEndPos) == IDecoderConstants.ASCII_CR)) { - recordEndPos--; - - } else { - break; - } - } - NctextRecord nctextrecord = new NctextRecord(); - setNctextRecord(nctextrecord); - nctextrecord.setReportData(sRawMsgInProcessing - .substring(messageDataStart, - recordEndPos + 1)); - nctextrecord.setRawRecord(sRawMsgInProcessing - .substring(recordStart, recordEndPos + 1)); - nctextrecord.setRecordId(recordId++); - - reports.add(nctextrecord); - } - // adjust pointers for next possible section/record - rawMsglength = rawMsglength - (endPos + 1); // string - // index - // start - // with 0 - rawMsgPointer = rawMsgPointer + (endPos + 1); - // Chin debug - // logger.info("setData : find wmoHeader " - // +(recordId-1)+ ": " - // + WMOId + " " + cccc + " " + YYGGgg+ " " + awipsId + - // " " + proType - // /*+"\n rawMsgLn " + rawMsglength + "rawMsgPointer " + - // rawMsgPointer + "endPos " + endPos); - resetVaraable(); - - } else { - // Chin debug - logger.info("setData : find wmoHeader " - + (recordId - 1) + ": " + WMOId + " " + cccc - + " " + YYGGgg + " " + awipsId - + " BUT, no message data end Ctl-C found! "//* - // * + - // * " rawMsgLn " - // * + - // * rawMsglength - /// * + - // * " rawMsgPointer " - // * + - // * rawMsgPointer - // * + - // * " endPos " - // * + - // * endPos - // ); - - rawMsglength = 0; ///* get out of here - } - } - // Chin debug - else { - int ePos; - switch (parseErr) { - case NO_AWIPS_HDR: - logger.info("setData : no header found. Stop here! "); - rawMsglength = 0;// get out of here - logErrToFile("No AWIPS header found in this file. Stop Parsing!\n"); - break; - case NO_AWIPS_HDR_IN_BULLETIN: - logger.info("setData : no header found in a bulletin. "); - // Skip this part of data. adjust buffer to next - // possible bulletin - ePos = sRawMsgInProcessing - .indexOf(IDecoderConstants.ASCII_ETX); // Ctl-C - rawMsglength = rawMsglength - (ePos + 1); // string - // index start - // with 0 - rawMsgPointer = rawMsgPointer + (ePos + 1); - logErrToFile("A Bulletin without good AWIPS header found. Skip it!\n"); - break; - case NO_CTLA_IN_BULLETIN: - logger.info("setData : no ctl-A found in a bulletin. "); - // Skip this part of data. adjust buffer to next - // possible bulletin - ePos = sRawMsgInProcessing - .indexOf(IDecoderConstants.ASCII_ETX); // Ctl-C - rawMsglength = rawMsglength - (ePos + 1); // string - // index start - // with 0 - rawMsgPointer = rawMsgPointer + (ePos + 1); - logErrToFile("A Bulletin without ctl-A found. Skip it!\n"); - break; - case NO_CTLA_TO_END: - logger.info("setData : no ctl-A found from this point down. Stop here! "); - // Skip this part of data. adjust buffer to next - // possible bulletin - rawMsglength = 0;// get out of here - logErrToFile("No ctl-A found from this point down. Stop here!\n"); - break; - case NO_CTLC_TO_END: - logger.info("setData : no ctl-C found from this point down. Stop here! "); - // Skip this part of data. adjust buffer to next - // possible bulletin - rawMsglength = 0;// get out of here - logErrToFile("No ctl-C found from this point down. Stop here!\n"); - break; - case NO_ERR: - logger.info("setData : end of file. Stop here! "); - rawMsglength = 0;// get out of here - break; - default: - logger.info("setData : general error! Stop here! "); - logErrToFile("Unknow parsing error. Stop here!\n"); - rawMsglength = 0;// get out of here - break; - } - } - - }// While loop - - } - - if ((reports != null) && (reports.size() > 0)) { - currentReport = 0; - } else { - // Chin debug - logger.info(traceId + " - setData():No reports found in data."); - } - */ + /* + * currentReport = -1; + * + * // Now check for some binary data types, Stop decoding, if it is + * binary String sRawMessage = new String(rawMessage); int pos = + * sRawMessage.indexOf("BUFR"); boolean notStored = false; notStored = + * notStored || ((pos >= 0) && (pos < 20)); pos = + * sRawMessage.indexOf("GRIB"); notStored = notStored || ((pos >= 0) && + * (pos < 20)); pos = sRawMessage.indexOf("JPG"); notStored = notStored + * || ((pos >= 0) && (pos < 20)); pos = sRawMessage.indexOf("PNG"); + * notStored = notStored || ((pos >= 0) && (pos < 20)); pos = + * sRawMessage.indexOf("GIF87"); notStored = notStored || ((pos >= 0) && + * (pos < 20)); + * + * int rawMsglength = rawMessage.length; // // * start from this, and // + * * decremented when each bulletin // * found // int rawMsgPointer = + * 0;//* // * start from 0 and incremented when each bulletin // * found + * // int recordId = 1; ///* to record number of records with same AWIPS + * header reports = new ArrayList(); String + * sRawMsgInProcessing = null; int endPos; int rsPos, nextRsPos, curPos; + * if (!notStored) { String fileType = nctextInputFileTypeDao + * .getFiletypeType(ingestFileExt); while (rawMsglength > 0) { + * sRawMsgInProcessing = sRawMessage.substring(rawMsgPointer); // + * Parsing record header and find a "section" A section may // contain + * more than one record for some data type, e.g. M type // (MOS). if + * (parseHeader(sRawMsgInProcessing)) { // Start of a "section" found + * after a Ctl-A, endPos = sRawMsgInProcessing + * .indexOf(IDecoderConstants.ASCII_ETX); // Ctl-C // set data to record + * if (endPos > messageDataStart) { // handle special type of data, e.g + * M,etc.. type if (fileType.equals("M")) { + * + * // M type data has several records in one "section". // They are + * separated by Record Separator "^^". rsPos = + * sRawMsgInProcessing.indexOf(ASCII_RS); // find // first // RS // + * testCount++; // if((testCount %50) == 0){ // + * System.out.println("M type data: " + testCount+ // + * " enterred! end position = "+ endPos+ // "1st rs pos = "+rsPos); // } + * + * // cumRsPos = rsPos; if ((rsPos >= 0) && (rsPos < endPos)) { // + * String sMRawMsg = // sRawMsgInProcessing.substring(rsPos+1);//move // + * string to after first RS // get stnid=xxxx which is 4 chars right + * after // RS, like this ^^XXXX // String stnId = sMRawMsg.substring(0, + * 4); String stnId = sRawMsgInProcessing.substring( rsPos + 1, rsPos + + * 5); // nextRsPos = sMRawMsg.indexOf(ASCII_RS); //2nd // RS curPos = + * rsPos + 1; nextRsPos = sRawMsgInProcessing.indexOf( ASCII_RS, + * curPos); // 2nd RS // cumRsPos = cumRsPos + nextRsPos; int testCount1 + * = 0; while ((nextRsPos >= 0) && (nextRsPos < endPos)) { // find + * record(s) within the section, store // it testCount1++; // + * if((testCount1 %50) == 1) // System.out.println(" number RS = "+ // + * testCount); // System.out.println("cur pos = "+curPos+ // + * " next rs pos = "+ nextRsPos); NctextRecord nctextrecord = new + * NctextRecord(); setNctextRecord(nctextrecord); // + * nctextrecord.setRawRecord(sMRawMsg.substring(0, // nextRsPos-1)); + * nctextrecord .setRawRecord(sRawMsgInProcessing .substring(curPos, + * nextRsPos - 1)); nctextrecord.setRecordId(recordId++); + * nctextrecord.setIssueSite(stnId); // replace // cccc // with // + * stndId // found // for // this // record reports.add(nctextrecord); + * + * // sMRawMsg = // sMRawMsg.substring(nextRsPos+1);//move // string to + * after current next RS // nextRsPos = // + * sMRawMsg.indexOf(ASCII_RS);//new next RS stnId = + * sRawMsgInProcessing.substring( nextRsPos + 1, nextRsPos + 5); // + * cumRsPos = cumRsPos + nextRsPos; curPos = nextRsPos + 1; + * + * nextRsPos = sRawMsgInProcessing.indexOf( ASCII_RS, nextRsPos + 1);// + * new next // RS // stnId = sMRawMsg.substring(0, 4); + * + * } // Handle the last record which is NOT saved in // the while loop + * NctextRecord nctextrecord = new NctextRecord(); + * setNctextRecord(nctextrecord); // + * nctextrecord.setRawRecord(sMRawMsg); + * nctextrecord.setRawRecord(sRawMsgInProcessing .substring(curPos, + * endPos - 1)); nctextrecord.setRecordId(recordId++); + * nctextrecord.setIssueSite(stnId); // replace // cccc with // stndId + * // found for // this record reports.add(nctextrecord); // + * System.out.println(" number RS = "+ // testCount); } else { // Chin + * debug System.out .println("setData for M type: find wmoHeader " + + * (recordId - 1) + ": " + WMOId + " " + cccc + " " + YYGGgg + " " + + * awipsId + " BUT, no RS ^^ found!"); + * + * rawMsglength = 0; ///* get out of here } // + * System.out.println("M type report size : "+ // reports.size()); + * + * } else { // other data type - I.e. B,Z,R,O,F, W type int recordEndPos + * = endPos; recordEndPos--; // exclude Ctl-C // Adjust record end + * position by skipping CR and LN // at end of record while + * (recordEndPos > 0) { if ((sRawMsgInProcessing.charAt(recordEndPos) == + * IDecoderConstants.ASCII_LF) || (sRawMsgInProcessing + * .charAt(recordEndPos) == IDecoderConstants.ASCII_CR)) { + * recordEndPos--; + * + * } else { break; } } NctextRecord nctextrecord = new NctextRecord(); + * setNctextRecord(nctextrecord); + * nctextrecord.setReportData(sRawMsgInProcessing + * .substring(messageDataStart, recordEndPos + 1)); + * nctextrecord.setRawRecord(sRawMsgInProcessing .substring(recordStart, + * recordEndPos + 1)); nctextrecord.setRecordId(recordId++); + * + * reports.add(nctextrecord); } // adjust pointers for next possible + * section/record rawMsglength = rawMsglength - (endPos + 1); // string + * // index // start // with 0 rawMsgPointer = rawMsgPointer + (endPos + + * 1); // Chin debug // logger.info("setData : find wmoHeader " // + * +(recordId-1)+ ": " // + WMOId + " " + cccc + " " + YYGGgg+ " " + + * awipsId + // " " + proType // /*+"\n rawMsgLn " + rawMsglength + + * "rawMsgPointer " + // rawMsgPointer + "endPos " + endPos); + * resetVaraable(); + * + * } else { // Chin debug logger.info("setData : find wmoHeader " + + * (recordId - 1) + ": " + WMOId + " " + cccc + " " + YYGGgg + " " + + * awipsId + " BUT, no message data end Ctl-C found! "//* // * + // * + * " rawMsgLn " // * + // * rawMsglength /// * + // * " rawMsgPointer " + * // * + // * rawMsgPointer // * + // * " endPos " // * + // * endPos + * // ); + * + * rawMsglength = 0; ///* get out of here } } // Chin debug else { int + * ePos; switch (parseErr) { case NO_AWIPS_HDR: + * logger.info("setData : no header found. Stop here! "); rawMsglength = + * 0;// get out of here + * logErrToFile("No AWIPS header found in this file. Stop Parsing!\n"); + * break; case NO_AWIPS_HDR_IN_BULLETIN: + * logger.info("setData : no header found in a bulletin. "); // Skip + * this part of data. adjust buffer to next // possible bulletin ePos = + * sRawMsgInProcessing .indexOf(IDecoderConstants.ASCII_ETX); // Ctl-C + * rawMsglength = rawMsglength - (ePos + 1); // string // index start // + * with 0 rawMsgPointer = rawMsgPointer + (ePos + 1); + * logErrToFile("A Bulletin without good AWIPS header found. Skip it!\n" + * ); break; case NO_CTLA_IN_BULLETIN: + * logger.info("setData : no ctl-A found in a bulletin. "); // Skip this + * part of data. adjust buffer to next // possible bulletin ePos = + * sRawMsgInProcessing .indexOf(IDecoderConstants.ASCII_ETX); // Ctl-C + * rawMsglength = rawMsglength - (ePos + 1); // string // index start // + * with 0 rawMsgPointer = rawMsgPointer + (ePos + 1); + * logErrToFile("A Bulletin without ctl-A found. Skip it!\n"); break; + * case NO_CTLA_TO_END: + * logger.info("setData : no ctl-A found from this point down. Stop here! " + * ); // Skip this part of data. adjust buffer to next // possible + * bulletin rawMsglength = 0;// get out of here + * logErrToFile("No ctl-A found from this point down. Stop here!\n"); + * break; case NO_CTLC_TO_END: + * logger.info("setData : no ctl-C found from this point down. Stop here! " + * ); // Skip this part of data. adjust buffer to next // possible + * bulletin rawMsglength = 0;// get out of here + * logErrToFile("No ctl-C found from this point down. Stop here!\n"); + * break; case NO_ERR: + * logger.info("setData : end of file. Stop here! "); rawMsglength = + * 0;// get out of here break; default: + * logger.info("setData : general error! Stop here! "); + * logErrToFile("Unknow parsing error. Stop here!\n"); rawMsglength = + * 0;// get out of here break; } } + * + * }// While loop + * + * } + * + * if ((reports != null) && (reports.size() > 0)) { currentReport = 0; } + * else { // Chin debug logger.info(traceId + + * " - setData():No reports found in data."); } + */ } private synchronized boolean parseRcdHeader(String sInputMessageData) { @@ -719,15 +608,16 @@ public class NctextSeparator extends AbstractRecordSeparator { } return isValid; } - private String[] getGdStnGp(String stnId){ - for(String[] stnGp: gdStnGp){ - for(int i=0; i < stnGp.length; i++){ - if(stnId.equals(stnGp[i])){ - return stnGp; - } - } - } - return null; + + private String[] getGdStnGp(String stnId) { + for (String[] stnGp : gdStnGp) { + for (int i = 0; i < stnGp.length; i++) { + if (stnId.equals(stnGp[i])) { + return stnGp; + } + } + } + return null; } /** @@ -743,9 +633,10 @@ public class NctextSeparator extends AbstractRecordSeparator { // Now check for some binary data types, Stop decoding, if it is binary String sRawMessage = new String(rawMessage); - //some reports contains null char which will cause DB persistence error. Replace all null with + // some reports contains null char which will cause DB persistence + // error. Replace all null with // Space. - sRawMessage = sRawMessage.replace((char)0x0, (char)0x20); + sRawMessage = sRawMessage.replace((char) 0x0, (char) 0x20); int pos = sRawMessage.indexOf("BUFR"); boolean notStored = false; notStored = notStored || ((pos >= 0) && (pos < 20)); @@ -780,12 +671,13 @@ public class NctextSeparator extends AbstractRecordSeparator { // They are separated by Record Separator "^^". rsPos = strRcd.indexOf(ASCII_RS); // find first RS if ((rsPos >= 0) && (rsPos < endPos)) { - int stnidEnd; - - stnidEnd = strRcd.substring(rsPos + 1).indexOf(ASCII_SP) + 1; //Chin fix mos stnid bug - - String stnId = strRcd.substring(rsPos + 1, - rsPos + stnidEnd); + int stnidEnd; + + stnidEnd = strRcd.substring(rsPos + 1).indexOf( + ASCII_SP) + 1; // Chin fix mos stnid bug + + String stnId = strRcd.substring(rsPos + 1, rsPos + + stnidEnd); curPos = rsPos + 1; nextRsPos = strRcd.indexOf(ASCII_RS, curPos); // 2nd // RS @@ -800,9 +692,15 @@ public class NctextSeparator extends AbstractRecordSeparator { // stndId // found for // this record - if(stnId.length() <= 8) //Chin : to make sure we do not get unwanted/bad record with longer than 8 chars stnid - reports.add(nctextrecord); - stnidEnd = strRcd.substring(nextRsPos + 1).indexOf(ASCII_SP) + 1; //Chin fix mos stnid bug + if (stnId.length() <= 8) // Chin : to make sure + // we do not get + // unwanted/bad record + // with longer than 8 + // chars stnid + reports.add(nctextrecord); + stnidEnd = strRcd.substring(nextRsPos + 1) + .indexOf(ASCII_SP) + 1; // Chin fix mos + // stnid bug stnId = strRcd.substring(nextRsPos + 1, nextRsPos + stnidEnd); curPos = nextRsPos + 1; @@ -821,8 +719,8 @@ public class NctextSeparator extends AbstractRecordSeparator { // with stndId // found for this // record - if(stnId.length() <= 8) - reports.add(nctextrecord); + if (stnId.length() <= 8) + reports.add(nctextrecord); } else { // Chin debug System.out @@ -837,57 +735,64 @@ public class NctextSeparator extends AbstractRecordSeparator { + " " + awipsId + " BUT, no RS ^^ found!"); } - } - else if (fileType.equals("R")){ - Pattern p = Pattern.compile(R_TYPE_SEPARATOR); - Matcher m =p.matcher(strRcd); - String stnIdFound="NA", subStr; - String[] stnGp=null; - boolean saveit = false; - if (m.find()) { - stnIdFound = m.group(); - stnIdFound = stnIdFound.substring(0, stnIdFound.length()-2); - stnGp = getGdStnGp(stnIdFound); - if(stnGp !=null) - saveit =true; - } else { //This record may have different format, Its Stn ID is one line before "00///" - p = Pattern.compile(R_TYPE_SEPARATOR2); - m = p.matcher(strRcd); - if (m.find()) { - subStr = strRcd.substring(m.start()); - // find the first "00///" and move str to here - //from subStr, find a first stn id of this gp stns - //this stn is actually not the first stn in the record. but it is ok, we only need one stn id in the gp. - p = Pattern.compile(R_TYPE_SEPARATOR3); - m = p.matcher(subStr); - if (m.find()){ - stnIdFound = m.group(); - stnGp = getGdStnGp(stnIdFound); - if(stnGp !=null) - saveit = true; - } else { - logger.info("Could not find stn id in RGD file record !!!"); - } - } else { - logger.info("Could not find stn id in RGD file record!" ); - } - } - if(saveit == true && stnGp != null) { - //For consistent with all other text record, we have to save smae record for each stn in the gp, - // so appication can query record based on stnId - for(String stn: stnGp){ - NctextRecord nctextrecord = new NctextRecord(); - setNctextRecord(nctextrecord); - nctextrecord.setRawRecord(strRcd.substring(recordStart,endPos-1)); - nctextrecord.setRecordId(recordId++); - nctextrecord.setIssueSite(stn); - // replace cccc with group stndId found for this record - reports.add(nctextrecord); - } - } else - logger.info("stn id "+ stnIdFound + " But gp Stn is not found"); - } - else if (fileType.equals("O")) { + } else if (fileType.equals("R")) { + Pattern p = Pattern.compile(R_TYPE_SEPARATOR); + Matcher m = p.matcher(strRcd); + String stnIdFound = "NA", subStr; + String[] stnGp = null; + boolean saveit = false; + if (m.find()) { + stnIdFound = m.group(); + stnIdFound = stnIdFound.substring(0, + stnIdFound.length() - 2); + stnGp = getGdStnGp(stnIdFound); + if (stnGp != null) + saveit = true; + } else { // This record may have different format, Its + // Stn ID is one line before "00///" + p = Pattern.compile(R_TYPE_SEPARATOR2); + m = p.matcher(strRcd); + if (m.find()) { + subStr = strRcd.substring(m.start()); + // find the first "00///" and move str to here + // from subStr, find a first stn id of this gp + // stns + // this stn is actually not the first stn in the + // record. but it is ok, we only need one stn id + // in the gp. + p = Pattern.compile(R_TYPE_SEPARATOR3); + m = p.matcher(subStr); + if (m.find()) { + stnIdFound = m.group(); + stnGp = getGdStnGp(stnIdFound); + if (stnGp != null) + saveit = true; + } else { + logger.info("Could not find stn id in RGD file record !!!"); + } + } else { + logger.info("Could not find stn id in RGD file record!"); + } + } + if (saveit == true && stnGp != null) { + // For consistent with all other text record, we + // have to save smae record for each stn in the gp, + // so appication can query record based on stnId + for (String stn : stnGp) { + NctextRecord nctextrecord = new NctextRecord(); + setNctextRecord(nctextrecord); + nctextrecord.setRawRecord(strRcd.substring( + recordStart, endPos - 1)); + nctextrecord.setRecordId(recordId++); + nctextrecord.setIssueSite(stn); + // replace cccc with group stndId found for this + // record + reports.add(nctextrecord); + } + } else + logger.info("stn id " + stnIdFound + + " But gp Stn is not found"); + } else if (fileType.equals("O")) { logger.info("Observer data is not supported now!!!"); } else { // other data types - I.e. B, W, Z, F types @@ -958,7 +863,8 @@ public class NctextSeparator extends AbstractRecordSeparator { currentReport = 0; } else { // Chin debug - logger.info(traceId + " - setRecordData():No reports found in data."); + logger.info(traceId + + " - setRecordData():No reports found in data."); } } @@ -984,24 +890,28 @@ public class NctextSeparator extends AbstractRecordSeparator { // TODO Auto-generated catch block e.printStackTrace(); } - if (traceId.length() >= YYYYMMDD_LENGTH) { - try { - // Adjust year and month from ingest file name - String date = traceId.substring(0, YYYYMMDD_LENGTH); - int iDay = Integer.parseInt(date.substring(6, 8).trim()); - int iMonth = Integer.parseInt(date.substring(4, 6).trim()); - int iYear = Integer.parseInt(date.substring(0, 4).trim()); - // Note: month's index starts from 0 - cal.set(iYear, iMonth - 1, iDay); - } catch (NumberFormatException n) { - // do nothing, if can't get yy/mon/day info from file name, just - // use current date - } + // Chin:: call to Util.findCurrentTime(YYGGgg); already takes care of + // year/month adjustment. + // if (traceId.length() >= YYYYMMDD_LENGTH) { + // try { + // // Adjust year and month from ingest file name + // String date = traceId.substring(0, YYYYMMDD_LENGTH); + // int iDay = Integer.parseInt(date.substring(6, 8).trim()); + // int iMonth = Integer.parseInt(date.substring(4, 6).trim()); + // int iYear = Integer.parseInt(date.substring(0, 4).trim()); + // // Note: month's index starts from 0 + // cal.set(iYear, iMonth - 1, iDay); + // } catch (NumberFormatException n) { + // // do nothing, if can't get yy/mon/day info from file name, just + // // use current date + // } + // + // } - } nctextrecord.setIssueTime(cal); nctextrecord.setDataTime(new DataTime(cal)); - + System.out.println("YYGGgg=" + YYGGgg + " traceId=" + traceId); + System.out.println("refTime= issueTime=" + cal.getTime().toGMTString()); // set data productType, // String proType = nctextProductDao.getProductType(WMOId); nctextrecord.setProductType(ingestFileExt); @@ -1021,6 +931,7 @@ public class NctextSeparator extends AbstractRecordSeparator { */ public void setTraceId(String traceId) { this.traceId = traceId; + System.out.println("NctextSeparator set traceId=" + traceId); } } diff --git a/ncep/gov.noaa.nws.ncep.edex.plugin.pirep/res/pointdata/pirepdb.xml b/ncep/gov.noaa.nws.ncep.edex.plugin.pirep/res/pointdata/pirepdb.xml new file mode 100644 index 0000000000..b72ce25c64 --- /dev/null +++ b/ncep/gov.noaa.nws.ncep.edex.plugin.pirep/res/pointdata/pirepdb.xml @@ -0,0 +1,16 @@ + + + + + + + + + + \ No newline at end of file diff --git a/ncep/gov.noaa.nws.ncep.edex.plugin.pirep/utility/edex_static/base/distribution/pirep.xml b/ncep/gov.noaa.nws.ncep.edex.plugin.pirep/utility/edex_static/base/distribution/pirep.xml index 683f9e18a6..dcc5f59049 100644 --- a/ncep/gov.noaa.nws.ncep.edex.plugin.pirep/utility/edex_static/base/distribution/pirep.xml +++ b/ncep/gov.noaa.nws.ncep.edex.plugin.pirep/utility/edex_static/base/distribution/pirep.xml @@ -20,4 +20,5 @@ --> ^UB.... KWBC.* + ^YIXX84 KAWN.* diff --git a/ncep/gov.noaa.nws.ncep.edex.plugin.tcm/utility/edex_static/base/distribution/tcm.xml b/ncep/gov.noaa.nws.ncep.edex.plugin.tcm/utility/edex_static/base/distribution/tcm.xml index 4a1b601d1a..682228c58c 100644 --- a/ncep/gov.noaa.nws.ncep.edex.plugin.tcm/utility/edex_static/base/distribution/tcm.xml +++ b/ncep/gov.noaa.nws.ncep.edex.plugin.tcm/utility/edex_static/base/distribution/tcm.xml @@ -2,6 +2,6 @@ ^WT(NT|PZ)[23][1-5] ^WTPA[23][1-5] - ^WTPN[23][1-5] + ^WTPN[235][1-5] ^W[HT]PS01 diff --git a/rpms/awips2.core/Installer.ncep-database/component.spec b/rpms/awips2.core/Installer.ncep-database/component.spec index 399e3d2c93..670711a567 100644 --- a/rpms/awips2.core/Installer.ncep-database/component.spec +++ b/rpms/awips2.core/Installer.ncep-database/component.spec @@ -294,6 +294,7 @@ rm -rf ${RPM_BUILD_ROOT} %dir /awips2/database/sqlScripts/share/sql %dir /awips2/database/sqlScripts/share/sql/ncep %attr(777,root,root) /awips2/database/sqlScripts/share/sql/ncep/ncep_sql_install.log +%attr(755,awips,fxalpha) /awips2/database/sqlScripts/share/sql/ncep/addNcepNwxAdminMessageGpTable.sql %attr(755,awips,fxalpha) /awips2/database/sqlScripts/share/sql/ncep/createNcepConfigTables.sql %attr(755,awips,fxalpha) /awips2/database/sqlScripts/share/sql/ncep/createNcepDb.sh %attr(755,awips,fxalpha) /awips2/database/sqlScripts/share/sql/ncep/createNcepDb.sql @@ -336,6 +337,7 @@ rm -rf ${RPM_BUILD_ROOT} %attr(755,awips,fxalpha) /awips2/database/sqlScripts/share/sql/ncep/loadNcStnsCountyclust.sql %attr(755,awips,fxalpha) /awips2/database/sqlScripts/share/sql/ncep/loadNexrad.sql %attr(755,awips,fxalpha) /awips2/database/sqlScripts/share/sql/ncep/loadNgmmos.sql +%attr(755,awips,fxalpha) /awips2/database/sqlScripts/share/sql/ncep/loadNwxAdminMessagesBulletinTables.sql %attr(755,awips,fxalpha) /awips2/database/sqlScripts/share/sql/ncep/loadNwxAviationforecastsBulletinTables.sql %attr(755,awips,fxalpha) /awips2/database/sqlScripts/share/sql/ncep/loadNwxCPCProductsBulletinTables.sql %attr(755,awips,fxalpha) /awips2/database/sqlScripts/share/sql/ncep/loadNwxFlashFloodBulletinTables.sql