Skip to content

Commit

Permalink
Fix line ordering bug in METviewer GUI. #86
Browse files Browse the repository at this point in the history
  • Loading branch information
TatianaBurek committed Nov 7, 2018
1 parent 5c79af4 commit c6f1546
Show file tree
Hide file tree
Showing 15 changed files with 255 additions and 193 deletions.
28 changes: 28 additions & 0 deletions .idea/runConfigurations/MVBatchTest_handSelectedDates.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 3 additions & 6 deletions R_work/include/agg_stat.R
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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')
Expand Down Expand Up @@ -1062,7 +1063,3 @@ cat(
" seed: ", intRandomSeed, "\n",
" stats: ", length(listStat), "\n",
sep="");


# clean up
cat("agg_stat.R done\n");
6 changes: 2 additions & 4 deletions R_work/include/agg_stat_bootstrap.R
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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");

4 changes: 1 addition & 3 deletions R_work/include/sum_stat.R
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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");
2 changes: 1 addition & 1 deletion R_work/include/util_plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
Expand Down
21 changes: 11 additions & 10 deletions java/edu/ucar/metviewer/MVBatch.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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());

}
Expand Down
Loading

0 comments on commit c6f1546

Please sign in to comment.