FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Commit ca165b95 authored by Richard Stutt's avatar Richard Stutt
Browse files

Added script that can run historic NAME data output with reduced user pain.

parent d9a5329f
No related branches found
No related tags found
No related merge requests found
......@@ -148,6 +148,15 @@ unless(-d $todayOutputDir) {
handleError("ERROR: Didn't manage to unzip the output directory: ".$todayOutputDir." from ".$todayOutputFileName);
}
#Rename the folder for Dan:
my $oldTodayOutputDir = $todayOutputDir;
$todayOutputDir = "NAME_wheatrust_".$todayString;
unless($oldTodayOutputDir eq $todayOutputDir) {#They will only differ if we're using a set of testing NAME output
dircopy($oldTodayOutputDir, $todayOutputDir) or handleError("ERROR: Unable to copy directory from ".$oldTodayOutputDir." to ".$todayOutputDir);
}
#Check if the zip actually had output inside it - maininput.txt and at least one file of each depositionEthiopia_Stem_*.txt, depositionEthiopia_Stripe_*.txt
my @necessaryOutputs = (
$todayOutputDir."/maininput.txt",
......
This diff is collapsed.
#!/usr/bin/perl
use warnings;
use strict;
use JSON::MaybeXS;
use File::Slurp;
use DateTime;
use DateTime::Format::HTTP;
my $startDateString = "2018-11-23";
my $nDays = 7;
my $class = 'DateTime::Format::HTTP';
my $startDt = $class->parse_datetime($startDateString);
my $endDt = $startDt->add(days =>$nDays);
my $endDateString = $endDt->strftime("%Y-%m-%d");
print($endDateString."\n");
my $plottingPath = "/storage/app/Ethiopia-EWS/Plotting/";
my $cfgSubPath = "config/rs481/";
my $cfgFileName = "NAME_plotting.json";
my $cfgFileFullPath = $plottingPath."/".$cfgSubPath."/".$cfgFileName;
my $cfgTemplateFileFullPath = $plottingPath."/".$cfgSubPath."/TEMPLATE_".$cfgFileName;
my $cfgString = read_file($cfgFileFullPath) or die $!;
my $cfgJSON = decode_json($cfgString) or die $!;
$cfgJSON->{"OutputDirectory"} = "output/TEST_NAMEOUTPUT_".$startDateString;
$cfgJSON->{"PastDataExtractionStartDate"} = $startDateString;
$cfgJSON->{"PastDataExtractionEndDate"} = $endDateString;
my $NAMEDateString = $startDateString =~ s/-//gr;
$cfgJSON->{"NOTDAN_InputDirectory"} = "/storage/app/Ethiopia-EWS/Ethiopia-EWS-Workspace/DEPOSITION_TESTING/NAME_species_wheatrust_".$NAMEDateString;
my $json = JSON::MaybeXS->new(utf8 => 1, pretty => 1);
my $cfgStringOut = $json->encode($cfgJSON) or die $!;
write_file($cfgFileFullPath, $cfgStringOut)or die $!;
chdir($plottingPath) or die $!;
my $cmd = "/usr/local/R/bin/Rscript Submit_mass_Gilligan.R ".$cfgSubPath."/".$cfgFileName." --fastanimation --NAME";
print $cmd."\n";
print `$cmd`;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment