-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart_script.m
More file actions
33 lines (26 loc) · 1.75 KB
/
start_script.m
File metadata and controls
33 lines (26 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
%% set up the input parameters
locationR = input("Enter File Path to the Rscipt.exe file: (Include Quotes)", 's'); %filepath to the Rscript.exe file in the R Program Files as a string with quotation marks
siteName = input("Enter Site Name: (Must Be One String) ", 's'); %string value for the site name (must have no spaces), used in the R process
lat = input("Enter Latitude Value of Site (Decimal): ", 's'); %decimal value for the latitude of the site
long = input("Enter Longitude Value of Site (Decimal): ", 's'); %decimal value for the longitude of the site
timeShift = input("Enter Hour Shift to UTC: ", 's'); %integer value, of the number of hours shift to UTC
inputFileName = input("Enter Filename of Pre-Processed Input data: ", 's'); %string value of the pre-processed data file, (no spaces)
%% run either day or night processing
day = input("Run Daytime Processing (Y/N)? ", 's');
if day == 'Y'
outFile = input("File Name for Daytime Output: ", 's'); %string value of name to save data to, (no spaces)
filePath = append(pwd, '\dayscript.R', ' ', inputFileName, ' ', siteName, ' ', lat, ' ', long, ' ', timeShift, ' ', outFile, '.txt');
filePath = append(locationR, ' ', filePath);
system(filePath);
disp('dayscript.R Completed');
dayPostProc
end
night = input("Run Nighttime Processing (Y/N)? ", 's');
if night == 'Y'
outFile = input("File Name for Nighttime Output: ", 's'); %string value of name to save data to, (no spaces)
filePath = append(pwd, '\nightscript.R', ' ', inputFileName, ' ', siteName, ' ', lat, ' ', long, ' ', timeShift, ' ', outFile, '.txt');
filePath = append(locationR, ' ', filePath);
system(filePath);
disp('nightscript.R Completed');
nightPostProc
end