changeset 7:869e7d06bdf3 draft

Uploaded
author greg
date Wed, 01 Aug 2018 08:47:20 -0400
parents 0d9a74365270
children cf6a06a2346c
files extract_ipm_date_interval.R
diffstat 1 files changed, 7 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/extract_ipm_date_interval.R	Wed Aug 01 08:47:08 2018 -0400
+++ b/extract_ipm_date_interval.R	Wed Aug 01 08:47:20 2018 -0400
@@ -52,19 +52,6 @@
 # Display the total number of days in the Galaxy history item blurb.
 cat("Number of days in date interval: ", num_days, "\n");
 
-# Get the year from the start_date.
-year = get_year_from_date(start_date);
-# Get the DOY for start_date and end_date.
-start_date_doy = as.integer(strftime(start_date, format="%j"));
-end_date_doy = as.integer(strftime(end_date, format="%j"));
-# Get the ticks date labels for plots.
-ticks_and_labels = get_x_axis_ticks_and_labels(temperature_data_frame, date_interval=TRUE);
-ticks = c(unlist(ticks_and_labels[1]));
-date_labels = c(unlist(ticks_and_labels[2]));
-# All latitude values are the same, so get the value
-# for plots from the first row.
-latitude = temperature_data_frame$LATITUDE[1];
-
 input_files = list.files(path=input_dir, full.names=TRUE);
 for(input_file in input_files) {
     temperature_data_frame = get_new_temperature_data_frame(input_file);
@@ -72,6 +59,13 @@
     end_date_row = which(temperature_data_frame$DATE==end_date);
     # Extract the date interval.
     temperature_data_frame = temperature_data_frame[start_date_row:end_date_row,];
+    # Get the ticks date labels for plots.
+        ticks_and_labels = get_x_axis_ticks_and_labels(temperature_data_frame, date_interval=TRUE);
+        ticks = c(unlist(ticks_and_labels[1]));
+        date_labels = c(unlist(ticks_and_labels[2]));
+    # All latitude values are the same, so get the value
+    # for plots from the first row.
+        latitude = temperature_data_frame$LATITUDE[1];
     # Save the date interval data into an output file
     # named the same as the input.
     file_path = paste("output_data_dir", input_file, sep="/");