diff --git a/.idea/runConfigurations/MVBatchTest_handSelectedDates.xml b/.idea/runConfigurations/MVBatchTest_handSelectedDates.xml
new file mode 100644
index 00000000..79a5b98a
--- /dev/null
+++ b/.idea/runConfigurations/MVBatchTest_handSelectedDates.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/R_work/include/agg_stat.R b/R_work/include/agg_stat.R
index f76b26b1..406c5f53 100644
--- a/R_work/include/agg_stat.R
+++ b/R_work/include/agg_stat.R
@@ -10,7 +10,7 @@ listArgs = commandArgs(TRUE)
if( 0 < length(listArgs) ) {
strInputInfoFile = listArgs[1];
}
-cat("agg_stat.R\ninput file: ", strInputInfoFile, "\n", sep="");
+cat("input file: ", strInputInfoFile, "\n", sep="");
source(strInputInfoFile);
setwd(strWorkingDir);
@@ -30,7 +30,8 @@ listStat = NA;
if ( nrow(sampleData) > 0){
classes <- sapply(sampleData, class);
numeric_columns <- c('stat_value', 'stat_bcl', 'stat_bcu', 'stat_ncu', 'stat_ncl','fbs', 'fss',
-'fbar', 'obar', 'fobar', 'ffbar', 'oobar', 'var_mean','total', 'me', 'rmse', 'crps','crpss', 'ign', 'spread', 'me_oerr','rmse_oerr','spread_oerr', 'spread_plus_oerr'
+'fbar', 'obar', 'fobar', 'ffbar', 'oobar', 'var_mean','total', 'me', 'rmse', 'crps',
+ 'crpss', 'ign', 'spread', 'me_oerr','rmse_oerr','spread_oerr', 'spread_plus_oerr', 'mae'
);
integer_columns <- c('fcst_lead','nstats');
character_columns <- c('fcst_var', 'model', 'stat_name')
@@ -1062,7 +1063,3 @@ cat(
" seed: ", intRandomSeed, "\n",
" stats: ", length(listStat), "\n",
sep="");
-
-
-# clean up
-cat("agg_stat.R done\n");
\ No newline at end of file
diff --git a/R_work/include/agg_stat_bootstrap.R b/R_work/include/agg_stat_bootstrap.R
index 53eff670..0d4561f7 100644
--- a/R_work/include/agg_stat_bootstrap.R
+++ b/R_work/include/agg_stat_bootstrap.R
@@ -6,7 +6,7 @@ listArgs = commandArgs(TRUE)
if( 0 < length(listArgs) ) {
strInputInfoFile = listArgs[1];
}
-cat("agg_stat_bootstrap.R\ninput file: ", strInputInfoFile, "\n", sep="");
+cat("input file: ", strInputInfoFile, "\n", sep="");
source(strInputInfoFile);
setwd(strWorkingDir);
@@ -1213,13 +1213,11 @@ for(strIndyVal in listIndyVal){
} # END: for intY
- cat(" PROC TIME: ", formatTimeSpan(as.numeric(Sys.time() - stBoot, units="secs")), "\n")
+ #cat(" PROC TIME: ", formatTimeSpan(as.numeric(Sys.time() - stBoot, units="secs")), "\n")
} # END: for strIndyVal
write.table( dfOut, file=strOutputFile, row.names=FALSE, quote=FALSE, sep="\t" );
-# clean up
-cat("agg_stat_bootstrap.R done\n");
diff --git a/R_work/include/sum_stat.R b/R_work/include/sum_stat.R
index 8d647428..5d70e672 100644
--- a/R_work/include/sum_stat.R
+++ b/R_work/include/sum_stat.R
@@ -10,7 +10,7 @@ listArgs = commandArgs(TRUE)
if( 0 < length(listArgs) ) {
strInputInfoFile = listArgs[1];
}
-cat("sum_stat.R\ninput file: ", strInputInfoFile, "\n", sep="");
+cat("file: ", strInputInfoFile, "\n", sep="");
source(strInputInfoFile);
setwd(strWorkingDir);
@@ -214,5 +214,3 @@ cat(
" total time: ", formatTimeSpan(as.numeric(Sys.time() - stStart, units="secs")), "\n",
sep="");
-# clean up
-cat("sum_stat.R done\n");
\ No newline at end of file
diff --git a/R_work/include/util_plot.R b/R_work/include/util_plot.R
index e3d3bf11..02f94842 100644
--- a/R_work/include/util_plot.R
+++ b/R_work/include/util_plot.R
@@ -396,7 +396,7 @@ formatTimeSpan = function(s){
if( 10 > intMins ){ strFormat = paste(strFormat, "0", sep=""); }
strFormat = paste(strFormat, intMins, ":", sep="");
if( 10 > dblSec ){ strFormat = paste(strFormat, "0", sep=""); }
- strFormat = paste(strFormat, format(dblSec, digits=6), sep="");
+ strFormat = paste(strFormat, format(dblSec, digits=3), sep="");
return( strFormat );
}
diff --git a/java/edu/ucar/metviewer/MVBatch.java b/java/edu/ucar/metviewer/MVBatch.java
index 44a2f2c7..29682846 100644
--- a/java/edu/ucar/metviewer/MVBatch.java
+++ b/java/edu/ucar/metviewer/MVBatch.java
@@ -2,8 +2,6 @@
import java.io.File;
import java.io.PrintStream;
-import java.time.LocalDateTime;
-import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -328,12 +326,12 @@ public static void main(String[] argv) throws Exception {
bat.setNumPlots(bat.getNumPlots() + intNumJobPlots);
}
- LocalDateTime dateStart = LocalDateTime.now();
- bat.print("Running " + bat.numPlots + " plots\n"
- + "Begin time: " + MVUtil.APP_DATE_FORMATTER.format(dateStart) + "\n");
+ StopWatch jobsStopWatch = new StopWatch();
+ bat.print("Running " + bat.numPlots + " plots");
for (int intJob = 0; intJob < jobs.length; intJob++) {
+ jobsStopWatch.start();
if (0 < intJob) {
bat.print(
"\n# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n");
@@ -377,24 +375,27 @@ public static void main(String[] argv) throws Exception {
jobManager.runJob(jobs[intJob]);
bat.numPlotsRun++;
+ jobsStopWatch.stop();
+ bat.print("\n" + "Job " + (intJob+1) + " execution time " + jobsStopWatch.getFormattedDuration());
}
+ stopWatch.stop();
+ long plotAvg= (jobsStopWatch.getTotalDuration()/ 1000000) / (long) bat.numPlots;
- LocalDateTime dateEnd = LocalDateTime.now();
- long plotTime = dateStart.until(dateEnd, ChronoUnit.MILLIS);
- long plotAvg = 0 < bat.numPlots ? plotTime / (long) bat.numPlots : 0;
bat.print("\n"
- + MVUtil.padBegin("End time: ") + MVUtil.APP_DATE_FORMATTER.format(dateEnd) + "\n"
+ MVUtil.padBegin("Plots run: ") + bat.getNumPlotsRun() + " of " + bat.getNumPlots()
+ "\n"
- + MVUtil.padBegin("Total time: ") + MVUtil.formatTimeSpan(plotTime) + "\n"
+ + MVUtil.padBegin("Total time: ") + jobsStopWatch.getFormattedTotalDuration() + "\n"
+ MVUtil.padBegin("Avg plot time: ") + MVUtil.formatTimeSpan(plotAvg) + "\n");
+
+
} catch (Exception e) {
bat.print(" ** ERROR: " + e.getMessage());
}
bat.print("---- MVBatch Done ----");
+
bat.print("\nTotal execution time " + stopWatch.getFormattedTotalDuration());
}
diff --git a/java/edu/ucar/metviewer/scorecard/Scorecard.java b/java/edu/ucar/metviewer/scorecard/Scorecard.java
index fd05e303..dc4cc501 100644
--- a/java/edu/ucar/metviewer/scorecard/Scorecard.java
+++ b/java/edu/ucar/metviewer/scorecard/Scorecard.java
@@ -13,6 +13,7 @@
import java.util.List;
import java.util.Map;
+import edu.ucar.metviewer.StopWatch;
import edu.ucar.metviewer.scorecard.db.AggDatabaseManagerMySQL;
import edu.ucar.metviewer.scorecard.db.DatabaseManager;
import edu.ucar.metviewer.scorecard.db.SumDatabaseManagerMySQL;
@@ -35,6 +36,8 @@
public class Scorecard {
private static final Logger logger = LogManager.getLogger("Console");
+ private static final String USAGE = "USAGE: mv_scorecard.sh db_type \n" +
+ " where db_type - mysql \n specifies the XML scorecard specification document\n";
private String databaseName;
private String user;
private String pwd;
@@ -60,8 +63,117 @@ public class Scorecard {
private String stat = "DIFF_SIG";
private String thresholdFile = null;
- private static final String USAGE = "USAGE: mv_scorecard.sh db_type \n" +
- " where db_type - mysql \n specifies the XML scorecard specification document\n";
+ public static void main(String[] args) throws Exception {
+
+ String filename;
+ String dbType = "mysql";
+ StopWatch stopWatch = new StopWatch();
+ stopWatch.start();
+ if (0 == args.length) {
+ logger.error(" Error: no arguments!!!");
+ logger.info(USAGE);
+
+ } else {
+
+ int intArg = 0;
+ for (; intArg < args.length && !args[intArg].matches(".*\\.xml$"); intArg++) {
+ if (args[intArg].equals("mysql")) {
+ dbType = "mysql";
+ }
+ }
+
+ filename = args[intArg];
+ XmlParser xmlParser = new XmlParser();
+ // parce XML and init parameters
+ Scorecard scorecard = xmlParser.parseParameters(filename);
+
+ //add a second model ( the same as the first one) if only one is selected
+ scorecard.fillValues();
+
+ //remove previous output with similar names
+ scorecard.cleanOldResults();
+
+ //TODO implement validation
+ boolean isValid = scorecard.validate();
+ if (isValid) {
+
+ DatabaseManager scorecardDbManager = null;
+ RscriptManager rscriptManager = null;
+ //create a list of each row with statistic as a key and columns
+ List