Project

General

Profile

« Previous | Next » 

Revision 7526fb1c

Added by Jim Regetz over 12 years ago

  • ID 7526fb1cb18019e825df2c99a3ecd5c5b0473ea7

added in various previously uncommitted scripts

View differences:

climate/extra/gdd-worldclim-tmean-map-algebra.txt
1
GDD = ((con ([tmean_1] <= 100, 100, [tmean_1]) - 100)  +  (con ([tmean_2] <= 100, 100, [tmean_2]) - 100) + (con ([tmean_3] <= 100, 100, [tmean_3]) - 100) + (con ([tmean_4] <= 100, 100, [tmean_4]) - 100) + (con ([tmean_5] <= 100, 100, [tmean_5]) - 100) + (con ([tmean_6] <= 100, 100, [tmean_6]) - 100) + (con ([tmean_7] <= 100, 100, [tmean_7]) - 100) + (con ([tmean_8] <= 100, 100, [tmean_8]) - 100) + (con ([tmean_9] <= 100, 100, [tmean_9]) - 100) + (con ([tmean_10] <= 100, 100, [tmean_10]) - 100) + (con ([tmean_11] <= 100, 100, [tmean_11]) - 100) + (con ([tmean_12] <= 100, 100, [tmean_12]) - 100)) / 10
climate/procedures/cru_3.0_data_extract.r
1
##
2
##
3
##
4

  
5
rm(list=ls(all=TRUE))
6

  
7
setwd("C:\\Users\\Frank\\Documents\\Data\\Climate_data\\CRU_TS_3.0")
8

  
9
library(ncdf)
10

  
11
vrb<-c("pre","tmn","tmp","tmx")
12
for(v in 4:4){
13
  # open data file
14
  nc<-open.ncdf(paste("cru_ts_3_00.1901.2006.",vrb[v],".nc",sep=""))           # open datafile
15

  
16
  nodata<-nc$var$tas$missval                                   # nodata value
17
  time.dim<-nc$dim$time$len                                    # time dimension
18
  time.base<-as.numeric(substr(nc$dim$time$units,14,17))       # base year
19
  time.start<-round(nc$dim$time$vals[1]/12)+time.base         # year simulation started
20
  time.end<-floor(nc$dim$time$vals[time.dim]/12)+time.base    # year simulation ended
21

  
22
  # build flip matrix
23
  I<-matrix(0,360,360)
24
  y<-360
25
  for(x in 1:360){
26
    I[x,y]<-1
27
    y<-y-1
28
  }
29

  
30
  ## extract data for 1968 to 2006 and output as ESRI ASCII files
31
  for(i in 1:time.dim){
32
    # define year and month
33
    if(trunc(i/12)!=i/12){
34
      year<-floor(i/12)+time.start
35
      month<-round((i/12-trunc(i/12))*12)
36
    }else{
37
      year<-floor(i/12)+time.start-1
38
      month<-12
39
    }
40
    if(year<2005) next
41

  
42
   # read data
43
    ncd<-get.var.ncdf(nc,start=c(1,1,i),count=c(720,360,1))
44

  
45
    # flip matrix
46
    grd<-I%*%(t(ncd))
47

  
48
    # ouput to file in ESRI ASCII format
49
    esri<-c(paste("ncols",720),
50
            paste("nrows",360),
51
            paste("xllcorner",-180),
52
            paste("yllcorner",-90),
53
            paste("cellsize",0.5),
54
            paste("nodata_value",-99.9))
55
        path2<-paste("cru_ts_3.0_",vrb[v],"_",year,"_",month,".asc",sep="")
56
        write.table(esri,path2,row.names=F,col.names=F,quote=F,append=F)
57
        write.table(data.frame(grd),path2,row.names=F,col.names=F,quote=F,append=T)
58
  }
59
  close.ncdf(nc) # close datafile
60
}
61

  
climate/research/oregon/modis-lst/Calc Clear Day Daily Avg.r
1
# Calculates the daily average clear day coverage for the clear day
2
# MODIS layer extracted from the MODIS LST files
3
#
4
# Reads a directory of .img files and groups them by day to calculate
5
# a daily aveage. This script also applies the clear day scaling factor
6
# to the resulting average raster and writes one raster for each day
7
# of the 1-year 2000 to 2010 period (one file for each 10-year group)
8
#
9
# Developed by John Donoghue
10
# Created: 16 October 2010
11
# Last Updated:
12
#
13
# For NCEAS Working Group Environment and Organisms
14
#
15

  
16
#setwd("/data/project/organisms/R")
17
#source("Calc Clear Day Daily Avg.r", echo=TRUE, print.eval=TRUE)
18

  
19
setwd("/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL")
20
inFiles <- list.files(pattern="*.img$")
21

  
22
library(raster)
23

  
24
print("")
25
print("Processing h08v04 tiles")
26
print("")
27

  
28
# process h08v04 tiles
29
# Create day averages for each day in the year
30
for(i in 1:366){
31
if (i < 9) {f <- "00"}
32
if ((i > 9) & (i <99 )) {f <- "0"}
33
if (i > 99) {f <- ""}
34
fpart <- paste(toString(f), toString(i), sep="")
35

  
36
# get a list of all files for that day of the year
37
print("")
38
print(sprintf("Reading day: %s", toString(fpart)))
39
myFiles <- grep(fpart,substr(inFiles, 14,16))
40
nFiles <-  length(myFiles)
41

  
42
# for each file in the list
43
filestoStack <- list()
44
for (iCtr in 1 : nFiles)
45
{
46
mFile <- myFiles[iCtr]
47
if (substr(inFiles[mFile],18,23) == "h08v04") {
48
print(sprintf("..Reading file: %s",inFiles[mFile]))
49
inputRaster <- raster()
50
inputRaster <- raster(inFiles[mFile])
51
filestoStack <- c(filestoStack, inFiles[mFile])
52
}
53
}
54
# now calculate the mean cell values
55
myStack <- stack(filestoStack)
56
print(sprintf("....Averaging Daily Values"))
57

  
58
# Check if file exists
59
outFile <- paste("Day_",toString(i),"_Average_Scaled_h08v04",".img",sep="")
60
if (file.exists(outFile) == FALSE) {
61
meanRaster <- mean(myStack, na.rm=TRUE)
62
scaledRaster <- meanRaster * 0.0005 # apply scaling factor to raster
63
print(sprintf("......Writing file: %s",outFile))
64
writeRaster(scaledRaster,filename=outFile,format="HFA",overwrite=TRUE)
65
}
66
}
67

  
68
print("")
69
print("Processing h09v04 tiles")
70
print("")
71

  
72
# now reloop and process h09v04 tiles
73
# Create day averages for each day in the year
74
for(i in 1:366){
75
if (i < 9) {f <- "00"}
76
if ((i > 9) & (i <99 )) {f <- "0"}
77
if (i > 99) {f <- ""}
78
fpart <- paste(toString(f), toString(i), sep="")
79

  
80
# get a list of all files for that day of the year
81
print("")
82
print(sprintf("Reading day: %s", toString(fpart)))
83
myFiles <- grep(fpart,substr(inFiles, 14,16))
84
nFiles <-  length(myFiles)
85

  
86
# for each file in the list
87
filestoStack <- list()
88
for (iCtr in 1 : nFiles)
89
{
90
mFile <- myFiles[iCtr]
91
if (substr(inFiles[mFile],18,23) == "h09v04") {
92
print(sprintf("..Reading file: %s",inFiles[mFile]))
93
inputRaster <- raster()
94
inputRaster <- raster(inFiles[mFile])
95
filestoStack <- c(filestoStack, inFiles[mFile])
96
}
97
}
98
# now calculate the mean cell values
99
myStack <- stack(filestoStack)
100
print(sprintf("....Averaging Daily Values"))
101

  
102
# Check if file exists
103
outFile <- paste("Day_",toString(i),"_Average_Scaled_h09v04",".img",sep="")
104
if (file.exists(outFile) == FALSE) {
105
meanRaster <- mean(myStack, na.rm=TRUE)
106
scaledRaster <- meanRaster * 0.0005 # apply scaling factor to raster
107
print(sprintf("......Writing file: %s",outFile))
108
writeRaster(scaledRaster,filename=outFile,format="HFA",overwrite=TRUE)
109
}
110
}
111

  
112
# finished
113
print("Finished")
114

  
climate/research/oregon/modis-lst/Calc Clear Day Monthly Avg.r
1
# Calculates the monthly average clear day coverage for the clear day
2
# MODIS layer extracted from the MODIS LST files
3
#
4
# Reads a directory of .img files and groups them by month to calculate
5
# a monthly aveage. This script also applies the clear day scaling factor
6
# to the resulting average raster and writes one raster for each month
7
# of the 1-year 2000 to 2010 period (one file for each month of the
8
# 10-year group)
9
#
10
# Developed by John Donoghue
11
# Created: 20 October 2010
12
# Last Updated:
13
#
14
# For NCEAS Working Group Environment and Organisms
15
#
16

  
17
#setwd("/data/project/organisms/R")
18
#source("Calc Clear Day Monthly Avg.r", echo=TRUE, print.eval=TRUE)
19

  
20
wkDir <- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/ClearDay_Original_IMG_Extracts/ByDate"
21
setwd(wkDir)
22

  
23
inFiles <- list.files(pattern="*h08v04.005.ClearDay.img$")
24
nFiles <- length(inFiles)
25

  
26
library(raster)
27

  
28
# build a list of the files for each month
29
janList <- list()
30
febList <- list()
31
marList <- list()
32
aprList <- list()
33
mayList <- list()
34
junList <- list()
35
julList <- list()
36
augList <- list()
37
sepList <- list()
38
octList <- list()
39
novList <- list()
40
decList <- list()
41

  
42
# for each file in the list
43
for (i in 1:nFiles) {
44

  
45
#print(inFiles[i])
46

  
47
# get month of file
48
theMonth <- substr(inFiles[i], 16,17)
49
if (substr(theMonth, 2,2) == ".") {theMonth <- substr(theMonth, 1, 1)}
50

  
51
# group by month
52
if (theMonth == "1") {
53
a <- length(janList)
54
janList[a+1] <- inFiles[i]
55
}
56

  
57
if (theMonth == "2") {
58
a <- length(febList)
59
febList[a+1] <- inFiles[i]
60
}
61

  
62
if (theMonth == "3") {
63
a <- length(marList)
64
marList[a+1] <- inFiles[i]
65
}
66

  
67
if (theMonth == "4") {
68
a <- length(aprList)
69
aprList[a+1] <- inFiles[i]
70
}
71

  
72
if (theMonth == "5") {
73
a <- length(mayList)
74
mayList[a+1] <- inFiles[i]
75
}
76

  
77
if (theMonth == "6") {
78
a <- length(junList)
79
junList[a+1] <- inFiles[i]
80
}
81

  
82
if (theMonth == "7") {
83
a <- length(julList)
84
julList[a+1] <- inFiles[i]
85
}
86

  
87
if (theMonth == "8") {
88
a <- length(augList)
89
augList[a+1] <- inFiles[i]
90
}
91

  
92
if (theMonth == "9") {
93
a <- length(sepList)
94
sepList[a+1] <- inFiles[i]
95
}
96

  
97
if (theMonth == "10") {
98
a <- length(octList)
99
octList[a+1] <- inFiles[i]
100
}
101

  
102
if (theMonth == "11") {
103
a <- length(novList)
104
novList[a+1] <- inFiles[i]
105
}
106

  
107
if (theMonth == "12") {
108
a <- length(decList)
109
decList[a+1] <- inFiles[i]
110
}
111

  
112
# end list files
113
}
114

  
115
print("")
116
print("PROCESSING h08v04 FILES")
117
print("")
118

  
119
# for each file in the list
120
for (f in 1:12) {
121
if (f == 1) {myList <- janList}
122
if (f == 2) {myList <- febList}
123
if (f == 3) {myList <- marList}
124
if (f == 4) {myList <- aprList}
125
if (f == 5) {myList <- mayList}
126
if (f == 6) {myList <- junList}
127
if (f == 7) {myList <- julList}
128
if (f == 8) {myList <- augList}
129
if (f == 9) {myList <- sepList}
130
if (f == 10) {myList <- octList}
131
if (f == 11) {myList <- novList}
132
if (f == 12) {myList <- decList}
133

  
134
print ("")
135
print ("")
136

  
137
filestoStack <- raster()
138
for (iCtr in 1 : length(myList))
139
{
140
mFile <- myList[iCtr]
141
print(sprintf("..Reading file: %s",mFile))
142
myFile <- paste(wkDir, "/", mFile, sep="")
143
inputRaster <- raster()
144
inputRaster <- mFile
145
filestoStack <- c(filestoStack, inputRaster)
146
}
147

  
148
# now calculate the mean cell values
149
print("....Stacking Grids")
150
myStack <- stack(filestoStack)
151

  
152
# Check if file exists
153
outFile <- paste("Month_", f ,"_ClearDay_Average",".img",sep="")
154
if (file.exists(outFile) == FALSE) {
155
print("....Averaging Monthly Values")
156
meanRaster <- mean(myStack, na.rm=TRUE)
157
print("....Applying Scale Factor")
158
scaledRaster <- meanRaster * 0.0005 # apply scaling factor to raster
159
print(sprintf("......Writing file: %s",outFile))
160
writeRaster(scaledRaster,filename=outFile,format="HFA",overwrite=TRUE)
161
}
162
}
163

  
164
# finished
165
print("Finished")
166

  
climate/research/oregon/modis-lst/Conversion_hdf_to_img.py
1
#This is a simple code to convert hdf file into img format
2

  
3
listfiles1=glob.glob('*.hdf')
4

  
5
infile=listfiles1[1]
6
outfile=infile[:-4]+'.img' #this select the name of file without its extension
7

  
8

  
climate/research/oregon/modis-lst/Convert MODIS Day of Year to Date File Name.py
1
# renames MODIS files from a year and day to year.month.day
2
# ---------------------------------------------------------------------------
3
# Developed by John Donoghue II
4
# 620 October, 2010
5

  
6
# Convert MODIS Day of Year to Date File Name.py
7

  
8
import sys
9
import string
10
import os
11
import shutil
12

  
13
sourceDir = "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/ClearDay_Original_IMG_Extracts"
14
outputDir = "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/ClearDay_Original_IMG_Extracts/ByDate"
15

  
16
# Loop through the folder
17
for dirname, dirnames, filenames in os.walk(sourceDir):
18
    for filename in filenames:
19
        ext = os.path.splitext(filename)[1]
20
        if ext == ".img":
21
		print "processing " + filename
22

  
23
		# process the file
24
		inFile = sourceDir + "/" + filename
25
		
26
		# rename the file to the month and day
27
		theYear = filename[9:13]
28
		theDay = filename[13:16]
29
		prefix = filename[0:9]
30
		tile = filename[17:27]
31

  
32
		# convert day to month and year
33
		theYear = int(theYear)
34
		theDay = int(theDay)
35
		from datetime import date
36
		myDate = date.fromordinal(date(theYear, 1, 1).toordinal() + theDay - 1)
37
		
38
		myYear = myDate.year
39
		myMonth = myDate.month
40
		myDay = myDate.day
41
				
42
		outFile = prefix + "."  + str(myYear) + "." + str(myMonth) + "." + str(myDay) + "." + tile + ".ClearDay.img"
43
		print ".. Writing " + outFile
44
	
45
		#print theYear + ' ' + theDay
46
		outFile = outputDir + "/" + outFile
47
            
48
		# remove outfile if present
49
		if not os.path.exists(outFile) == True:
50
			#os.remove(outFile)
51
			shutil.copy2(inFile,outFile)
52

  
53
		# Process: Extract Subdataset
54
                #print "   saving " + filename[0:27] + "_ClearDay.img"
55
                #myCommand = "gdal_translate -of HFA HDF4_EOS:EOS_GRID:" + filename + ":MODIS_Grid_Daily_1km_LST:Clear_day_cov " + outFile
56
                #output = os.popen(myCommand).read() # shows the ouput data of the command
57
            
58
print "Finished"
climate/research/oregon/modis-lst/ConvertMODIStobil.py
1
import sys
2
import string
3
import os
4
import osgeo
5
from osgeo import gdal, gdalconst
6
import re
7
import subprocess
8
from osgeo.gdalconst import *
9

  
10
driver = gdal.GetDriverByName('Ehdr')
11
driver2=gdal.GetDriverByName('HFA')
12
driver.Register()
13
driver2.Register()
14

  
15
# Convert Monthly averages to .bil
16
sourceDir = "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_MonthlyAvgs_Mosaics"
17
outputDir = "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_MonthlyAvgs_Mosaics"
18

  
19
# Loop through the folder
20
for dirname, dirnames, filenames in os.walk(sourceDir):
21
  for filename in filenames:
22
     ext = os.path.splitext(filename)[1]
23
     if ext == ".img":
24
       infile= sourceDir + "/" + filename
25
       outfile= re.sub(".img",".bil",infile)
26
       subprocess.call(["gdalwarp","-s_srs", "+proj=sinu +lon_0=0 +x_0=0 +y_0=0 +a=6371007.181 +b=6371007.181 +units=m +no_defs","-t_srs", "+proj=sinu +lon_0=0 +x_0=0 +y_0=0 +a=6371007.181 +b=6371007.181 +units=m +no_defs", "-ot", "int16", "-srcnodata", "3.39999999999999996e+38", "-dstnodata", "3.39999999999999996e+38", "-of", "EHdr", "-overwrite", infile, outfile])
27

  
28
#subprocess.call(["gdal_translate", "-ot", "int16", "-of", "EHdr", infile, outfile])
29

  
30
# Convert Daily averages to .bil
31
sourceDir2 = "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Mosaics"
32
outputDir2 = "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Mosaics"
33

  
34
# Loop through the folder
35
for dirname, dirnames, filenames in os.walk(sourceDir2):
36
  for filename in filenames:
37
     ext = os.path.splitext(filename)[1]
38
     if ext == ".img":
39
       infile2= sourceDir2 + "/" + filename
40
       outfile2= re.sub(".img",".bil",infile2)
41
       subprocess.call(["gdalwarp","-ot", "int16", "-srcnodata", "3.39999999999999996e+38", "-dstnodata", "3.39999999999999996e+38", "-of", "EHdr", "-overwrite", infile2, outfile2])
42

  
43
#subprocess.call(["gdal_translate", "-ot", "int16", "-of", "EHdr", infile2, outfile2])
44
       
45

  
46

  
47

  
48
gdalwarp -ot int16 -srcnodata "3.39999999999999996e+38" -dstnodata "3.39999999999999996e+38" -of EHdr infile2 outfile2 
climate/research/oregon/modis-lst/DayAVGCalcs_h08v04TIles.r
1
library (raster)
2

  
3
path<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/ClearDay_Original_IMG_Extracts/ByDate/BadPixelsCorrected_Tiles"
4

  
5
#Find daily means for h08v04 tiles:
6
h08v04_infiles <- list.files(path=path, pattern="*.h08v04.005.ClearDay_corrected.img$")
7
for (i in 1: length(h08v04_infiles)){
8
  h08v04_infiles[i]<- paste (path,"/",h08v04_infiles[i],sep="")
9
}
10
h08v04_infiles
11

  
12
#Creating empty vectors in the form of day_1- day_366
13
N<- c(1:366)*NA
14
val<- c(1:length(h08v04_infiles))*NA
15

  
16
for (i in 1:366){
17
   N[i]<- paste("day_",i,"_h08v04",sep="")
18
   assign (N[i],val)
19
}
20

  
21
#Avg. calcs days 1-59:
22

  
23
for (i in 1:length(h08v04_infiles)){
24
    if(length(grep("\\.1.1.h",h08v04_infiles[i])!=0)){
25
        day_1_h08v04[i]<- h08v04_infiles[i]         
26
    } else if (length(grep("\\.1.2.h",h08v04_infiles[i])!=0)){
27
        day_2_h08v04[i]<- h08v04_infiles[i]
28
    } else if (length(grep("\\.1.3.h",h08v04_infiles[i])!=0)){
29
        day_3_h08v04[i]<- h08v04_infiles[i]
30
    } else if (length(grep("\\.1.4.h",h08v04_infiles[i])!=0)){
31
        day_4_h08v04[i]<- h08v04_infiles[i]
32
    } else if (length(grep("\\.1.5.h",h08v04_infiles[i])!=0)){
33
        day_5_h08v04[i]<- h08v04_infiles[i]
34
    } else if (length(grep("\\.1.6.h",h08v04_infiles[i])!=0)){
35
        day_6_h08v04[i]<- h08v04_infiles[i]
36
    } else if (length(grep("\\.1.7.h",h08v04_infiles[i])!=0)){
37
        day_7_h08v04[i]<- h08v04_infiles[i]
38
    } else if (length(grep("\\.1.8.h",h08v04_infiles[i])!=0)){
39
        day_8_h08v04[i]<- h08v04_infiles[i]
40
    } else if (length(grep("\\.1.9.h",h08v04_infiles[i])!=0)){
41
        day_9_h08v04[i]<- h08v04_infiles[i]
42
    } else if (length(grep("\\.1.10.h",h08v04_infiles[i])!=0)){
43
        day_10_h08v04[i]<- h08v04_infiles[i]
44
    } else if(length(grep("\\.1.11.h",h08v04_infiles[i])!=0)){
45
        day_11_h08v04[i]<- h08v04_infiles[i]         
46
    } else if (length(grep("\\.1.12.h",h08v04_infiles[i])!=0)){
47
        day_12_h08v04[i]<- h08v04_infiles[i]
48
    } else if (length(grep("\\.1.13.h",h08v04_infiles[i])!=0)){
49
        day_13_h08v04[i]<- h08v04_infiles[i]
50
    } else if (length(grep("\\.1.14.h",h08v04_infiles[i])!=0)){
51
        day_14_h08v04[i]<- h08v04_infiles[i]
52
    } else if (length(grep("\\.1.15.h",h08v04_infiles[i])!=0)){
53
        day_15_h08v04[i]<- h08v04_infiles[i]
54
    } else if (length(grep("\\.1.16.h",h08v04_infiles[i])!=0)){
55
        day_16_h08v04[i]<- h08v04_infiles[i]
56
    } else if (length(grep("\\.1.17.h",h08v04_infiles[i])!=0)){
57
        day_17_h08v04[i]<- h08v04_infiles[i]
58
    } else if (length(grep("\\.1.18.h",h08v04_infiles[i])!=0)){
59
        day_18_h08v04[i]<- h08v04_infiles[i]
60
    } else if (length(grep("\\.1.19.h",h08v04_infiles[i])!=0)){
61
        day_19_h08v04[i]<- h08v04_infiles[i]
62
    } else if (length(grep("\\.1.20.h",h08v04_infiles[i])!=0)){
63
        day_20_h08v04[i]<- h08v04_infiles[i]
64
    } else if(length(grep("\\.1.21.h",h08v04_infiles[i])!=0)){
65
        day_21_h08v04[i]<- h08v04_infiles[i]         
66
    } else if (length(grep("\\.1.22.h",h08v04_infiles[i])!=0)){
67
        day_22_h08v04[i]<- h08v04_infiles[i]
68
    } else if (length(grep("\\.1.23.h",h08v04_infiles[i])!=0)){
69
        day_23_h08v04[i]<- h08v04_infiles[i]
70
    } else if (length(grep("\\.1.24.h",h08v04_infiles[i])!=0)){
71
        day_24_h08v04[i]<- h08v04_infiles[i]
72
    } else if (length(grep("\\.1.25.h",h08v04_infiles[i])!=0)){
73
        day_25_h08v04[i]<- h08v04_infiles[i]
74
    } else if (length(grep("\\.1.26.h",h08v04_infiles[i])!=0)){
75
        day_26_h08v04[i]<- h08v04_infiles[i]
76
    } else if (length(grep("\\.1.27.h",h08v04_infiles[i])!=0)){
77
        day_27_h08v04[i]<- h08v04_infiles[i]
78
    } else if (length(grep("\\.1.28.h",h08v04_infiles[i])!=0)){
79
        day_28_h08v04[i]<- h08v04_infiles[i]
80
    } else if (length(grep("\\.1.29.h",h08v04_infiles[i])!=0)){
81
        day_29_h08v04[i]<- h08v04_infiles[i]
82
    } else if (length(grep("\\.1.30.h",h08v04_infiles[i])!=0)){
83
        day_30_h08v04[i]<- h08v04_infiles[i]
84
    } else if (length(grep("\\.1.31.h",h08v04_infiles[i])!=0)){
85
        day_31_h08v04[i]<- h08v04_infiles[i]
86
    }  else if(length(grep("\\.2.1.h",h08v04_infiles[i])!=0)){
87
        day_32_h08v04[i]<- h08v04_infiles[i]         
88
    } else if (length(grep("\\.2.2.h",h08v04_infiles[i])!=0)){
89
        day_33_h08v04[i]<- h08v04_infiles[i]
90
    } else if (length(grep("\\.2.3.h",h08v04_infiles[i])!=0)){
91
        day_34_h08v04[i]<- h08v04_infiles[i]
92
    } else if (length(grep("\\.2.4.h",h08v04_infiles[i])!=0)){
93
        day_35_h08v04[i]<- h08v04_infiles[i]
94
    } else if (length(grep("\\.2.5.h",h08v04_infiles[i])!=0)){
95
        day_36_h08v04[i]<- h08v04_infiles[i]
96
    } else if (length(grep("\\.2.6.h",h08v04_infiles[i])!=0)){
97
        day_37_h08v04[i]<- h08v04_infiles[i]
98
    } else if (length(grep("\\.2.7.h",h08v04_infiles[i])!=0)){
99
        day_38_h08v04[i]<- h08v04_infiles[i]
100
    } else if (length(grep("\\.2.8.h",h08v04_infiles[i])!=0)){
101
        day_39_h08v04[i]<- h08v04_infiles[i]
102
    } else if (length(grep("\\.2.9.h",h08v04_infiles[i])!=0)){
103
        day_40_h08v04[i]<- h08v04_infiles[i]
104
    } else if (length(grep("\\.2.10.h",h08v04_infiles[i])!=0)){
105
        day_41_h08v04[i]<- h08v04_infiles[i]
106
    } else if(length(grep("\\.2.11.h",h08v04_infiles[i])!=0)){
107
        day_42_h08v04[i]<- h08v04_infiles[i]         
108
    } else if (length(grep("\\.2.12.h",h08v04_infiles[i])!=0)){
109
        day_43_h08v04[i]<- h08v04_infiles[i]  
110
    } else if (length(grep("\\.2.13.h",h08v04_infiles[i])!=0)){
111
        day_44_h08v04[i]<- h08v04_infiles[i]
112
    } else if (length(grep("\\.2.14.h",h08v04_infiles[i])!=0)){
113
        day_45_h08v04[i]<- h08v04_infiles[i]
114
    } else if (length(grep("\\.2.15.h",h08v04_infiles[i])!=0)){
115
        day_46_h08v04[i]<- h08v04_infiles[i]
116
    } else if (length(grep("\\.2.16.h",h08v04_infiles[i])!=0)){
117
        day_47_h08v04[i]<- h08v04_infiles[i]
118
    } else if (length(grep("\\.2.17.h",h08v04_infiles[i])!=0)){
119
        day_48_h08v04[i]<- h08v04_infiles[i]
120
    } else if (length(grep("\\.2.18.h",h08v04_infiles[i])!=0)){
121
        day_49_h08v04[i]<- h08v04_infiles[i]
122
    } else if (length(grep("\\.2.19.h",h08v04_infiles[i])!=0)){
123
        day_50_h08v04[i]<- h08v04_infiles[i]
124
    } else if (length(grep("\\.2.20.h",h08v04_infiles[i])!=0)){
125
        day_51_h08v04[i]<- h08v04_infiles[i]
126
    } else if(length(grep("\\.2.21.h",h08v04_infiles[i])!=0)){
127
        day_52_h08v04[i]<- h08v04_infiles[i]         
128
    } else if (length(grep("\\.2.22.h",h08v04_infiles[i])!=0)){
129
        day_53_h08v04[i]<- h08v04_infiles[i]
130
    } else if (length(grep("\\.2.23.h",h08v04_infiles[i])!=0)){
131
        day_54_h08v04[i]<- h08v04_infiles[i]
132
    } else if (length(grep("\\.2.24.h",h08v04_infiles[i])!=0)){
133
        day_55_h08v04[i]<- h08v04_infiles[i]
134
    } else if (length(grep("\\.2.25.h",h08v04_infiles[i])!=0)){
135
        day_56_h08v04[i]<- h08v04_infiles[i]
136
    } else if (length(grep("\\.2.26.h",h08v04_infiles[i])!=0)){
137
        day_57_h08v04[i]<- h08v04_infiles[i]
138
    } else if (length(grep("\\.2.27.h",h08v04_infiles[i])!=0)){
139
        day_58_h08v04[i]<- h08v04_infiles[i]
140
    } else if (length(grep("\\.2.28.h",h08v04_infiles[i])!=0)){
141
        day_59_h08v04[i]<- h08v04_infiles[i]
142
    }
143
}
144

  
145
day_1_h08v04<- day_1_h08v04[!is.na(day_1_h08v04)]
146
day_2_h08v04<- day_2_h08v04[!is.na(day_2_h08v04)]
147
day_3_h08v04<- day_3_h08v04[!is.na(day_3_h08v04)]
148
day_4_h08v04<- day_4_h08v04[!is.na(day_4_h08v04)]
149
day_5_h08v04<- day_5_h08v04[!is.na(day_5_h08v04)]
150
day_6_h08v04<- day_6_h08v04[!is.na(day_6_h08v04)]
151
day_7_h08v04<- day_7_h08v04[!is.na(day_7_h08v04)]
152
day_8_h08v04<- day_8_h08v04[!is.na(day_8_h08v04)]
153
day_9_h08v04<- day_9_h08v04[!is.na(day_9_h08v04)]
154
day_10_h08v04<- day_10_h08v04[!is.na(day_10_h08v04)]
155
day_11_h08v04<- day_11_h08v04[!is.na(day_11_h08v04)]
156
day_12_h08v04<- day_12_h08v04[!is.na(day_12_h08v04)]
157
day_13_h08v04<- day_13_h08v04[!is.na(day_13_h08v04)]
158
day_14_h08v04<- day_14_h08v04[!is.na(day_14_h08v04)]
159
day_15_h08v04<- day_15_h08v04[!is.na(day_15_h08v04)]
160
day_16_h08v04<- day_16_h08v04[!is.na(day_16_h08v04)]
161
day_17_h08v04<- day_17_h08v04[!is.na(day_17_h08v04)]
162
day_18_h08v04<- day_18_h08v04[!is.na(day_18_h08v04)]
163
day_19_h08v04<- day_19_h08v04[!is.na(day_19_h08v04)]
164
day_20_h08v04<- day_20_h08v04[!is.na(day_20_h08v04)]
165
day_21_h08v04<- day_21_h08v04[!is.na(day_21_h08v04)]
166
day_22_h08v04<- day_22_h08v04[!is.na(day_22_h08v04)]
167
day_23_h08v04<- day_23_h08v04[!is.na(day_23_h08v04)]
168
day_24_h08v04<- day_24_h08v04[!is.na(day_24_h08v04)]
169
day_25_h08v04<- day_25_h08v04[!is.na(day_25_h08v04)]
170
day_26_h08v04<- day_26_h08v04[!is.na(day_26_h08v04)]
171
day_27_h08v04<- day_27_h08v04[!is.na(day_27_h08v04)]
172
day_28_h08v04<- day_28_h08v04[!is.na(day_28_h08v04)]
173
day_29_h08v04<- day_29_h08v04[!is.na(day_29_h08v04)]
174
day_30_h08v04<- day_30_h08v04[!is.na(day_30_h08v04)]
175
day_31_h08v04<- day_31_h08v04[!is.na(day_31_h08v04)]
176
day_32_h08v04<- day_32_h08v04[!is.na(day_32_h08v04)]
177
day_33_h08v04<- day_33_h08v04[!is.na(day_33_h08v04)]
178
day_34_h08v04<- day_34_h08v04[!is.na(day_34_h08v04)]
179
day_35_h08v04<- day_35_h08v04[!is.na(day_35_h08v04)]
180
day_36_h08v04<- day_36_h08v04[!is.na(day_36_h08v04)]
181
day_37_h08v04<- day_37_h08v04[!is.na(day_37_h08v04)]
182
day_38_h08v04<- day_38_h08v04[!is.na(day_38_h08v04)]
183
day_39_h08v04<- day_39_h08v04[!is.na(day_39_h08v04)]
184
day_40_h08v04<- day_40_h08v04[!is.na(day_40_h08v04)]
185
day_41_h08v04<- day_41_h08v04[!is.na(day_41_h08v04)]
186
day_42_h08v04<- day_42_h08v04[!is.na(day_42_h08v04)]
187
day_43_h08v04<- day_43_h08v04[!is.na(day_43_h08v04)]
188
day_44_h08v04<- day_44_h08v04[!is.na(day_44_h08v04)]
189
day_45_h08v04<- day_45_h08v04[!is.na(day_45_h08v04)]
190
day_46_h08v04<- day_46_h08v04[!is.na(day_46_h08v04)]
191
day_47_h08v04<- day_47_h08v04[!is.na(day_47_h08v04)]
192
day_48_h08v04<- day_48_h08v04[!is.na(day_48_h08v04)]
193
day_49_h08v04<- day_49_h08v04[!is.na(day_49_h08v04)]
194
day_50_h08v04<- day_50_h08v04[!is.na(day_50_h08v04)]
195
day_51_h08v04<- day_51_h08v04[!is.na(day_51_h08v04)]
196
day_52_h08v04<- day_52_h08v04[!is.na(day_52_h08v04)]
197
day_53_h08v04<- day_53_h08v04[!is.na(day_53_h08v04)]
198
day_54_h08v04<- day_54_h08v04[!is.na(day_54_h08v04)]
199
day_55_h08v04<- day_55_h08v04[!is.na(day_55_h08v04)]
200
day_56_h08v04<- day_56_h08v04[!is.na(day_56_h08v04)]
201
day_57_h08v04<- day_57_h08v04[!is.na(day_57_h08v04)]
202
day_58_h08v04<- day_58_h08v04[!is.na(day_58_h08v04)]
203
day_59_h08v04<- day_59_h08v04[!is.na(day_59_h08v04)]
204

  
205
day_1_h08v04_stack<- stack(day_1_h08v04)
206
nlayers(day_1_h08v04_stack) 
207
day_1_h08v04_mn<- mean(day_1_h08v04_stack, na.rm=TRUE)
208
day_1_h08v04_mnScaled<- day_1_h08v04_mn*0.0005
209
Out_day_1<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_1_h08v04_AVG_Scaled.img"
210
writeRaster (day_1_h08v04_mnScaled, filename=Out_day_1,format="HFA",overwrite=TRUE)
211
day_2_h08v04_stack<- stack(day_2_h08v04)
212
nlayers(day_2_h08v04_stack) 
213
day_2_h08v04_mn<- mean(day_2_h08v04_stack, na.rm=TRUE)
214
day_2_h08v04_mnScaled<- day_2_h08v04_mn*0.0005
215
Out_day_2<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_2_h08v04_AVG_Scaled.img"
216
writeRaster (day_2_h08v04_mnScaled, filename=Out_day_2,format="HFA",overwrite=TRUE)
217
day_3_h08v04_stack<- stack(day_3_h08v04)
218
nlayers(day_3_h08v04_stack) 
219
day_3_h08v04_mn<- mean(day_3_h08v04_stack, na.rm=TRUE)
220
day_3_h08v04_mnScaled<- day_3_h08v04_mn*0.0005
221
Out_day_3<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_3_h08v04_AVG_Scaled.img"
222
writeRaster (day_3_h08v04_mnScaled, filename=Out_day_3,format="HFA",overwrite=TRUE)
223
day_4_h08v04_stack<- stack(day_4_h08v04)
224
nlayers(day_4_h08v04_stack) 
225
day_4_h08v04_mn<- mean(day_4_h08v04_stack, na.rm=TRUE)
226
day_4_h08v04_mnScaled<- day_4_h08v04_mn*0.0005
227
Out_day_4<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_4_h08v04_AVG_Scaled.img"
228
writeRaster (day_4_h08v04_mnScaled, filename=Out_day_4,format="HFA",overwrite=TRUE)
229
day_5_h08v04_stack<- stack(day_5_h08v04)
230
nlayers(day_5_h08v04_stack) 
231
day_5_h08v04_mn<- mean(day_5_h08v04_stack, na.rm=TRUE)
232
day_5_h08v04_mnScaled<- day_5_h08v04_mn*0.0005
233
Out_day_5<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_5_h08v04_AVG_Scaled.img"
234
writeRaster (day_5_h08v04_mnScaled, filename=Out_day_5,format="HFA",overwrite=TRUE)
235
day_6_h08v04_stack<- stack(day_6_h08v04)
236
nlayers(day_6_h08v04_stack) 
237
day_6_h08v04_mn<- mean(day_6_h08v04_stack, na.rm=TRUE)
238
day_6_h08v04_mnScaled<- day_6_h08v04_mn*0.0005
239
Out_day_6<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_6_h08v04_AVG_Scaled.img"
240
writeRaster (day_6_h08v04_mnScaled, filename=Out_day_6,format="HFA",overwrite=TRUE)
241
day_7_h08v04_stack<- stack(day_7_h08v04)
242
nlayers(day_7_h08v04_stack) 
243
day_7_h08v04_mn<- mean(day_7_h08v04_stack, na.rm=TRUE)
244
day_7_h08v04_mnScaled<- day_7_h08v04_mn*0.0005
245
Out_day_7<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_7_h08v04_AVG_Scaled.img"
246
writeRaster (day_7_h08v04_mnScaled, filename=Out_day_7,format="HFA",overwrite=TRUE)
247
day_8_h08v04_stack<- stack(day_8_h08v04)
248
nlayers(day_8_h08v04_stack) 
249
day_8_h08v04_mn<- mean(day_8_h08v04_stack, na.rm=TRUE)
250
day_8_h08v04_mnScaled<- day_8_h08v04_mn*0.0005
251
Out_day_8<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_8_h08v04_AVG_Scaled.img"
252
writeRaster (day_8_h08v04_mnScaled, filename=Out_day_8,format="HFA",overwrite=TRUE)
253
day_9_h08v04_stack<- stack(day_9_h08v04)
254
nlayers(day_9_h08v04_stack) 
255
day_9_h08v04_mn<- mean(day_9_h08v04_stack, na.rm=TRUE)
256
day_9_h08v04_mnScaled<- day_9_h08v04_mn*0.0005
257
Out_day_9<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_9_h08v04_AVG_Scaled.img"
258
writeRaster (day_9_h08v04_mnScaled, filename=Out_day_9,format="HFA",overwrite=TRUE)
259
day_10_h08v04_stack<- stack(day_10_h08v04)
260
nlayers(day_10_h08v04_stack) 
261
day_10_h08v04_mn<- mean(day_10_h08v04_stack, na.rm=TRUE)
262
day_10_h08v04_mnScaled<- day_10_h08v04_mn*0.0005
263
Out_day_10<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_10_h08v04_AVG_Scaled.img"
264
writeRaster (day_10_h08v04_mnScaled, filename=Out_day_10,format="HFA",overwrite=TRUE)
265
day_11_h08v04_stack<- stack(day_11_h08v04)
266
nlayers(day_11_h08v04_stack) 
267
day_11_h08v04_mn<- mean(day_11_h08v04_stack, na.rm=TRUE)
268
day_11_h08v04_mnScaled<- day_11_h08v04_mn*0.0005
269
Out_day_11<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_11_h08v04_AVG_Scaled.img"
270
writeRaster (day_11_h08v04_mnScaled, filename=Out_day_11,format="HFA",overwrite=TRUE)
271
day_12_h08v04_stack<- stack(day_12_h08v04)
272
nlayers(day_12_h08v04_stack) 
273
day_12_h08v04_mn<- mean(day_12_h08v04_stack, na.rm=TRUE)
274
day_12_h08v04_mnScaled<- day_12_h08v04_mn*0.0005
275
Out_day_12<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_12_h08v04_AVG_Scaled.img"
276
writeRaster (day_12_h08v04_mnScaled, filename=Out_day_12,format="HFA",overwrite=TRUE)
277
day_13_h08v04_stack<- stack(day_13_h08v04)
278
nlayers(day_13_h08v04_stack) 
279
day_13_h08v04_mn<- mean(day_13_h08v04_stack, na.rm=TRUE)
280
day_13_h08v04_mnScaled<- day_13_h08v04_mn*0.0005
281
Out_day_13<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_13_h08v04_AVG_Scaled.img"
282
writeRaster (day_13_h08v04_mnScaled, filename=Out_day_13,format="HFA",overwrite=TRUE)
283
day_14_h08v04_stack<- stack(day_14_h08v04)
284
nlayers(day_14_h08v04_stack) 
285
day_14_h08v04_mn<- mean(day_14_h08v04_stack, na.rm=TRUE)
286
day_14_h08v04_mnScaled<- day_14_h08v04_mn*0.0005
287
Out_day_14<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_14_h08v04_AVG_Scaled.img"
288
writeRaster (day_14_h08v04_mnScaled, filename=Out_day_14,format="HFA",overwrite=TRUE)
289
day_15_h08v04_stack<- stack(day_15_h08v04)
290
nlayers(day_15_h08v04_stack) 
291
day_15_h08v04_mn<- mean(day_15_h08v04_stack, na.rm=TRUE)
292
day_15_h08v04_mnScaled<- day_15_h08v04_mn*0.0005
293
Out_day_15<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_15_h08v04_AVG_Scaled.img"
294
writeRaster (day_15_h08v04_mnScaled, filename=Out_day_15,format="HFA",overwrite=TRUE)
295
day_16_h08v04_stack<- stack(day_16_h08v04)
296
nlayers(day_16_h08v04_stack) 
297
day_16_h08v04_mn<- mean(day_16_h08v04_stack, na.rm=TRUE)
298
day_16_h08v04_mnScaled<- day_16_h08v04_mn*0.0005
299
Out_day_16<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_16_h08v04_AVG_Scaled.img"
300
writeRaster (day_16_h08v04_mnScaled, filename=Out_day_16,format="HFA",overwrite=TRUE)
301
day_17_h08v04_stack<- stack(day_17_h08v04)
302
nlayers(day_17_h08v04_stack) 
303
day_17_h08v04_mn<- mean(day_17_h08v04_stack, na.rm=TRUE)
304
day_17_h08v04_mnScaled<- day_17_h08v04_mn*0.0005
305
Out_day_17<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_17_h08v04_AVG_Scaled.img"
306
writeRaster (day_17_h08v04_mnScaled, filename=Out_day_17,format="HFA",overwrite=TRUE)
307
day_18_h08v04_stack<- stack(day_18_h08v04)
308
nlayers(day_18_h08v04_stack) 
309
day_18_h08v04_mn<- mean(day_18_h08v04_stack, na.rm=TRUE)
310
day_18_h08v04_mnScaled<- day_18_h08v04_mn*0.0005
311
Out_day_18<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_18_h08v04_AVG_Scaled.img"
312
writeRaster (day_18_h08v04_mnScaled, filename=Out_day_18,format="HFA",overwrite=TRUE)
313
day_19_h08v04_stack<- stack(day_19_h08v04)
314
nlayers(day_19_h08v04_stack) 
315
day_19_h08v04_mn<- mean(day_19_h08v04_stack, na.rm=TRUE)
316
day_19_h08v04_mnScaled<- day_19_h08v04_mn*0.0005
317
Out_day_19<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_19_h08v04_AVG_Scaled.img"
318
writeRaster (day_19_h08v04_mnScaled, filename=Out_day_19,format="HFA",overwrite=TRUE)
319
day_20_h08v04_stack<- stack(day_20_h08v04)
320
nlayers(day_20_h08v04_stack) 
321
day_20_h08v04_mn<- mean(day_20_h08v04_stack, na.rm=TRUE)
322
day_20_h08v04_mnScaled<- day_20_h08v04_mn*0.0005
323
Out_day_20<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_20_h08v04_AVG_Scaled.img"
324
writeRaster (day_20_h08v04_mnScaled, filename=Out_day_20,format="HFA",overwrite=TRUE)
325
day_21_h08v04_stack<- stack(day_21_h08v04)
326
nlayers(day_21_h08v04_stack) 
327
day_21_h08v04_mn<- mean(day_21_h08v04_stack, na.rm=TRUE)
328
day_21_h08v04_mnScaled<- day_21_h08v04_mn*0.0005
329
Out_day_21<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_21_h08v04_AVG_Scaled.img"
330
writeRaster (day_21_h08v04_mnScaled, filename=Out_day_21,format="HFA",overwrite=TRUE)
331
day_22_h08v04_stack<- stack(day_22_h08v04)
332
nlayers(day_22_h08v04_stack) 
333
day_22_h08v04_mn<- mean(day_22_h08v04_stack, na.rm=TRUE)
334
day_22_h08v04_mnScaled<- day_22_h08v04_mn*0.0005
335
Out_day_22<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_22_h08v04_AVG_Scaled.img"
336
writeRaster (day_22_h08v04_mnScaled, filename=Out_day_22,format="HFA",overwrite=TRUE)
337
day_23_h08v04_stack<- stack(day_23_h08v04)
338
nlayers(day_23_h08v04_stack) 
339
day_23_h08v04_mn<- mean(day_23_h08v04_stack, na.rm=TRUE)
340
day_23_h08v04_mnScaled<- day_23_h08v04_mn*0.0005
341
Out_day_23<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_23_h08v04_AVG_Scaled.img"
342
writeRaster (day_23_h08v04_mnScaled, filename=Out_day_23,format="HFA",overwrite=TRUE)
343
day_24_h08v04_stack<- stack(day_24_h08v04)
344
nlayers(day_24_h08v04_stack) 
345
day_24_h08v04_mn<- mean(day_24_h08v04_stack, na.rm=TRUE)
346
day_24_h08v04_mnScaled<- day_24_h08v04_mn*0.0005
347
Out_day_24<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_24_h08v04_AVG_Scaled.img"
348
writeRaster (day_24_h08v04_mnScaled, filename=Out_day_24,format="HFA",overwrite=TRUE)
349
day_25_h08v04_stack<- stack(day_25_h08v04)
350
nlayers(day_25_h08v04_stack) 
351
day_25_h08v04_mn<- mean(day_25_h08v04_stack, na.rm=TRUE)
352
day_25_h08v04_mnScaled<- day_25_h08v04_mn*0.0005
353
Out_day_25<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_25_h08v04_AVG_Scaled.img"
354
writeRaster (day_25_h08v04_mnScaled, filename=Out_day_25,format="HFA",overwrite=TRUE)
355
day_26_h08v04_stack<- stack(day_26_h08v04)
356
nlayers(day_26_h08v04_stack) 
357
day_26_h08v04_mn<- mean(day_26_h08v04_stack, na.rm=TRUE)
358
day_26_h08v04_mnScaled<- day_26_h08v04_mn*0.0005
359
Out_day_26<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_26_h08v04_AVG_Scaled.img"
360
writeRaster (day_26_h08v04_mnScaled, filename=Out_day_26,format="HFA",overwrite=TRUE)
361
day_27_h08v04_stack<- stack(day_27_h08v04)
362
nlayers(day_27_h08v04_stack) 
363
day_27_h08v04_mn<- mean(day_27_h08v04_stack, na.rm=TRUE)
364
day_27_h08v04_mnScaled<- day_27_h08v04_mn*0.0005
365
Out_day_27<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_27_h08v04_AVG_Scaled.img"
366
writeRaster (day_27_h08v04_mnScaled, filename=Out_day_27,format="HFA",overwrite=TRUE)
367
day_28_h08v04_stack<- stack(day_28_h08v04)
368
nlayers(day_28_h08v04_stack) 
369
day_28_h08v04_mn<- mean(day_28_h08v04_stack, na.rm=TRUE)
370
day_28_h08v04_mnScaled<- day_28_h08v04_mn*0.0005
371
Out_day_28<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_28_h08v04_AVG_Scaled.img"
372
writeRaster (day_28_h08v04_mnScaled, filename=Out_day_28,format="HFA",overwrite=TRUE)
373
day_29_h08v04_stack<- stack(day_29_h08v04)
374
nlayers(day_29_h08v04_stack) 
375
day_29_h08v04_mn<- mean(day_29_h08v04_stack, na.rm=TRUE)
376
day_29_h08v04_mnScaled<- day_29_h08v04_mn*0.0005
377
Out_day_29<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_29_h08v04_AVG_Scaled.img"
378
writeRaster (day_29_h08v04_mnScaled, filename=Out_day_29,format="HFA",overwrite=TRUE)
379
day_30_h08v04_stack<- stack(day_30_h08v04)
380
nlayers(day_30_h08v04_stack) 
381
day_30_h08v04_mn<- mean(day_30_h08v04_stack, na.rm=TRUE)
382
day_30_h08v04_mnScaled<- day_30_h08v04_mn*0.0005
383
Out_day_30<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_30_h08v04_AVG_Scaled.img"
384
writeRaster (day_30_h08v04_mnScaled, filename=Out_day_30,format="HFA",overwrite=TRUE)
385
day_31_h08v04_stack<- stack(day_31_h08v04)
386
nlayers(day_31_h08v04_stack) 
387
day_31_h08v04_mn<- mean(day_31_h08v04_stack, na.rm=TRUE)
388
day_31_h08v04_mnScaled<- day_31_h08v04_mn*0.0005
389
Out_day_31<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_31_h08v04_AVG_Scaled.img"
390
writeRaster (day_31_h08v04_mnScaled, filename=Out_day_31,format="HFA",overwrite=TRUE)
391
day_32_h08v04_stack<- stack(day_32_h08v04)
392
nlayers(day_32_h08v04_stack) 
393
day_32_h08v04_mn<- mean(day_32_h08v04_stack, na.rm=TRUE)
394
day_32_h08v04_mnScaled<- day_32_h08v04_mn*0.0005
395
Out_day_32<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_32_h08v04_AVG_Scaled.img"
396
writeRaster (day_32_h08v04_mnScaled, filename=Out_day_32,format="HFA",overwrite=TRUE)
397
day_33_h08v04_stack<- stack(day_33_h08v04)
398
nlayers(day_33_h08v04_stack) 
399
day_33_h08v04_mn<- mean(day_33_h08v04_stack, na.rm=TRUE)
400
day_33_h08v04_mnScaled<- day_33_h08v04_mn*0.0005
401
Out_day_33<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_33_h08v04_AVG_Scaled.img"
402
writeRaster (day_33_h08v04_mnScaled, filename=Out_day_33,format="HFA",overwrite=TRUE)
403
day_34_h08v04_stack<- stack(day_34_h08v04)
404
nlayers(day_34_h08v04_stack) 
405
day_34_h08v04_mn<- mean(day_34_h08v04_stack, na.rm=TRUE)
406
day_34_h08v04_mnScaled<- day_34_h08v04_mn*0.0005
407
Out_day_34<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_34_h08v04_AVG_Scaled.img"
408
writeRaster (day_34_h08v04_mnScaled, filename=Out_day_34,format="HFA",overwrite=TRUE)
409
day_35_h08v04_stack<- stack(day_35_h08v04)
410
nlayers(day_35_h08v04_stack) 
411
day_35_h08v04_mn<- mean(day_35_h08v04_stack, na.rm=TRUE)
412
day_35_h08v04_mnScaled<- day_35_h08v04_mn*0.0005
413
Out_day_35<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_35_h08v04_AVG_Scaled.img"
414
writeRaster (day_35_h08v04_mnScaled, filename=Out_day_35,format="HFA",overwrite=TRUE)
415
day_36_h08v04_stack<- stack(day_36_h08v04)
416
nlayers(day_36_h08v04_stack) 
417
day_36_h08v04_mn<- mean(day_36_h08v04_stack, na.rm=TRUE)
418
day_36_h08v04_mnScaled<- day_36_h08v04_mn*0.0005
419
Out_day_36<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_36_h08v04_AVG_Scaled.img"
420
writeRaster (day_36_h08v04_mnScaled, filename=Out_day_36,format="HFA",overwrite=TRUE)
421
day_37_h08v04_stack<- stack(day_37_h08v04)
422
nlayers(day_37_h08v04_stack) 
423
day_37_h08v04_mn<- mean(day_37_h08v04_stack, na.rm=TRUE)
424
day_37_h08v04_mnScaled<- day_37_h08v04_mn*0.0005
425
Out_day_37<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_37_h08v04_AVG_Scaled.img"
426
writeRaster (day_37_h08v04_mnScaled, filename=Out_day_37,format="HFA",overwrite=TRUE)
427
day_38_h08v04_stack<- stack(day_38_h08v04)
428
nlayers(day_38_h08v04_stack) 
429
day_38_h08v04_mn<- mean(day_38_h08v04_stack, na.rm=TRUE)
430
day_38_h08v04_mnScaled<- day_38_h08v04_mn*0.0005
431
Out_day_38<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_38_h08v04_AVG_Scaled.img"
432
writeRaster (day_38_h08v04_mnScaled, filename=Out_day_38,format="HFA",overwrite=TRUE)
433
day_39_h08v04_stack<- stack(day_39_h08v04)
434
nlayers(day_39_h08v04_stack) 
435
day_39_h08v04_mn<- mean(day_39_h08v04_stack, na.rm=TRUE)
436
day_39_h08v04_mnScaled<- day_39_h08v04_mn*0.0005
437
Out_day_39<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_39_h08v04_AVG_Scaled.img"
438
writeRaster (day_39_h08v04_mnScaled, filename=Out_day_39,format="HFA",overwrite=TRUE)
439
day_40_h08v04_stack<- stack(day_40_h08v04)
440
nlayers(day_40_h08v04_stack) 
441
day_40_h08v04_mn<- mean(day_40_h08v04_stack, na.rm=TRUE)
442
day_40_h08v04_mnScaled<- day_40_h08v04_mn*0.0005
443
Out_day_40<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_40_h08v04_AVG_Scaled.img"
444
writeRaster (day_40_h08v04_mnScaled, filename=Out_day_40,format="HFA",overwrite=TRUE)
445
day_41_h08v04_stack<- stack(day_41_h08v04)
446
nlayers(day_41_h08v04_stack) 
447
day_41_h08v04_mn<- mean(day_41_h08v04_stack, na.rm=TRUE)
448
day_41_h08v04_mnScaled<- day_41_h08v04_mn*0.0005
449
Out_day_41<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_41_h08v04_AVG_Scaled.img"
450
writeRaster (day_41_h08v04_mnScaled, filename=Out_day_41,format="HFA",overwrite=TRUE)
451
day_42_h08v04_stack<- stack(day_42_h08v04)
452
nlayers(day_42_h08v04_stack) 
453
day_42_h08v04_mn<- mean(day_42_h08v04_stack, na.rm=TRUE)
454
day_42_h08v04_mnScaled<- day_42_h08v04_mn*0.0005
455
Out_day_42<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_42_h08v04_AVG_Scaled.img"
456
writeRaster (day_42_h08v04_mnScaled, filename=Out_day_42,format="HFA",overwrite=TRUE)
457
day_43_h08v04_stack<- stack(day_43_h08v04)
458
nlayers(day_43_h08v04_stack) 
459
day_43_h08v04_mn<- mean(day_43_h08v04_stack, na.rm=TRUE)
460
day_43_h08v04_mnScaled<- day_43_h08v04_mn*0.0005
461
Out_day_43<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_43_h08v04_AVG_Scaled.img"
462
writeRaster (day_43_h08v04_mnScaled, filename=Out_day_43,format="HFA",overwrite=TRUE)
463
day_44_h08v04_stack<- stack(day_44_h08v04)
464
nlayers(day_44_h08v04_stack) 
465
day_44_h08v04_mn<- mean(day_44_h08v04_stack, na.rm=TRUE)
466
day_44_h08v04_mnScaled<- day_44_h08v04_mn*0.0005
467
Out_day_44<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_44_h08v04_AVG_Scaled.img"
468
writeRaster (day_44_h08v04_mnScaled, filename=Out_day_44,format="HFA",overwrite=TRUE)
469
day_45_h08v04_stack<- stack(day_45_h08v04)
470
nlayers(day_45_h08v04_stack) 
471
day_45_h08v04_mn<- mean(day_45_h08v04_stack, na.rm=TRUE)
472
day_45_h08v04_mnScaled<- day_45_h08v04_mn*0.0005
473
Out_day_45<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_45_h08v04_AVG_Scaled.img"
474
writeRaster (day_45_h08v04_mnScaled, filename=Out_day_45,format="HFA",overwrite=TRUE)
475
day_46_h08v04_stack<- stack(day_46_h08v04)
476
nlayers(day_46_h08v04_stack) 
477
day_46_h08v04_mn<- mean(day_46_h08v04_stack, na.rm=TRUE)
478
day_46_h08v04_mnScaled<- day_46_h08v04_mn*0.0005
479
Out_day_46<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_46_h08v04_AVG_Scaled.img"
480
writeRaster (day_46_h08v04_mnScaled, filename=Out_day_46,format="HFA",overwrite=TRUE)
481
day_47_h08v04_stack<- stack(day_47_h08v04)
482
nlayers(day_47_h08v04_stack) 
483
day_47_h08v04_mn<- mean(day_47_h08v04_stack, na.rm=TRUE)
484
day_47_h08v04_mnScaled<- day_47_h08v04_mn*0.0005
485
Out_day_47<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_47_h08v04_AVG_Scaled.img"
486
writeRaster (day_47_h08v04_mnScaled, filename=Out_day_47,format="HFA",overwrite=TRUE)
487
day_48_h08v04_stack<- stack(day_48_h08v04)
488
nlayers(day_48_h08v04_stack) 
489
day_48_h08v04_mn<- mean(day_48_h08v04_stack, na.rm=TRUE)
490
day_48_h08v04_mnScaled<- day_48_h08v04_mn*0.0005
491
Out_day_48<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_48_h08v04_AVG_Scaled.img"
492
writeRaster (day_48_h08v04_mnScaled, filename=Out_day_48,format="HFA",overwrite=TRUE)
493
day_49_h08v04_stack<- stack(day_49_h08v04)
494
nlayers(day_49_h08v04_stack) 
495
day_49_h08v04_mn<- mean(day_49_h08v04_stack, na.rm=TRUE)
496
day_49_h08v04_mnScaled<- day_49_h08v04_mn*0.0005
497
Out_day_49<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_49_h08v04_AVG_Scaled.img"
498
writeRaster (day_49_h08v04_mnScaled, filename=Out_day_49,format="HFA",overwrite=TRUE)
499
day_50_h08v04_stack<- stack(day_50_h08v04)
500
nlayers(day_50_h08v04_stack) 
501
day_50_h08v04_mn<- mean(day_50_h08v04_stack, na.rm=TRUE)
502
day_50_h08v04_mnScaled<- day_50_h08v04_mn*0.0005
503
Out_day_50<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_50_h08v04_AVG_Scaled.img"
504
writeRaster (day_50_h08v04_mnScaled, filename=Out_day_50,format="HFA",overwrite=TRUE)
505
day_51_h08v04_stack<- stack(day_51_h08v04)
506
nlayers(day_51_h08v04_stack) 
507
day_51_h08v04_mn<- mean(day_51_h08v04_stack, na.rm=TRUE)
508
day_51_h08v04_mnScaled<- day_51_h08v04_mn*0.0005
509
Out_day_51<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_51_h08v04_AVG_Scaled.img"
510
writeRaster (day_51_h08v04_mnScaled, filename=Out_day_51,format="HFA",overwrite=TRUE)
511
day_52_h08v04_stack<- stack(day_52_h08v04)
512
nlayers(day_52_h08v04_stack) 
513
day_52_h08v04_mn<- mean(day_52_h08v04_stack, na.rm=TRUE)
514
day_52_h08v04_mnScaled<- day_52_h08v04_mn*0.0005
515
Out_day_52<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_52_h08v04_AVG_Scaled.img"
516
writeRaster (day_52_h08v04_mnScaled, filename=Out_day_52,format="HFA",overwrite=TRUE)
517
day_53_h08v04_stack<- stack(day_53_h08v04)
518
nlayers(day_53_h08v04_stack) 
519
day_53_h08v04_mn<- mean(day_53_h08v04_stack, na.rm=TRUE)
520
day_53_h08v04_mnScaled<- day_53_h08v04_mn*0.0005
521
Out_day_53<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_53_h08v04_AVG_Scaled.img"
522
writeRaster (day_53_h08v04_mnScaled, filename=Out_day_53,format="HFA",overwrite=TRUE)
523
day_54_h08v04_stack<- stack(day_54_h08v04)
524
nlayers(day_54_h08v04_stack) 
525
day_54_h08v04_mn<- mean(day_54_h08v04_stack, na.rm=TRUE)
526
day_54_h08v04_mnScaled<- day_54_h08v04_mn*0.0005
527
Out_day_54<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_54_h08v04_AVG_Scaled.img"
528
writeRaster (day_54_h08v04_mnScaled, filename=Out_day_54,format="HFA",overwrite=TRUE)
529
day_55_h08v04_stack<- stack(day_55_h08v04)
530
nlayers(day_55_h08v04_stack) 
531
day_55_h08v04_mn<- mean(day_55_h08v04_stack, na.rm=TRUE)
532
day_55_h08v04_mnScaled<- day_55_h08v04_mn*0.0005
533
Out_day_55<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_55_h08v04_AVG_Scaled.img"
534
writeRaster (day_55_h08v04_mnScaled, filename=Out_day_55,format="HFA",overwrite=TRUE)
535
day_56_h08v04_stack<- stack(day_56_h08v04)
536
nlayers(day_56_h08v04_stack) 
537
day_56_h08v04_mn<- mean(day_56_h08v04_stack, na.rm=TRUE)
538
day_56_h08v04_mnScaled<- day_56_h08v04_mn*0.0005
539
Out_day_56<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_56_h08v04_AVG_Scaled.img"
540
writeRaster (day_56_h08v04_mnScaled, filename=Out_day_56,format="HFA",overwrite=TRUE)
541
day_57_h08v04_stack<- stack(day_57_h08v04)
542
nlayers(day_57_h08v04_stack) 
543
day_57_h08v04_mn<- mean(day_57_h08v04_stack, na.rm=TRUE)
544
day_57_h08v04_mnScaled<- day_57_h08v04_mn*0.0005
545
Out_day_57<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_57_h08v04_AVG_Scaled.img"
546
writeRaster (day_57_h08v04_mnScaled, filename=Out_day_57,format="HFA",overwrite=TRUE)
547
day_58_h08v04_stack<- stack(day_58_h08v04)
548
nlayers(day_58_h08v04_stack) 
549
day_58_h08v04_mn<- mean(day_58_h08v04_stack, na.rm=TRUE)
550
day_58_h08v04_mnScaled<- day_58_h08v04_mn*0.0005
551
Out_day_58<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_58_h08v04_AVG_Scaled.img"
552
writeRaster (day_58_h08v04_mnScaled, filename=Out_day_58,format="HFA",overwrite=TRUE)
553
day_59_h08v04_stack<- stack(day_59_h08v04)
554
nlayers(day_59_h08v04_stack) 
555
day_59_h08v04_mn<- mean(day_59_h08v04_stack, na.rm=TRUE)
556
day_59_h08v04_mnScaled<- day_59_h08v04_mn*0.0005
557
Out_day_59<- "/data/project/organisms/MODIS_LST_Oregon/ClearDayGDAL/NewClearDay_DailyAvgs_Tiles/day_59_h08v04_AVG_Scaled.img"
558
writeRaster (day_59_h08v04_mnScaled, filename=Out_day_59,format="HFA",overwrite=TRUE)
559

  
560
# Days 60-365 or 366-----------------------------------------------------------------------------
561
for (i in 1:length(h08v04_infiles)){
562
  if (length(grep("\\.2004\\.",h08v04_infiles[i])!=0)|| length(grep("\\.2008\\.",h08v04_infiles[i])!=0)){
563
    if(length(grep("\\.2.29.h",h08v04_infiles[i])!=0)){
564
        day_60_h08v04[i]<- h08v04_infiles[i]
565
    } else if(length(grep("\\.3.1.h",h08v04_infiles[i])!=0)){
566
        day_61_h08v04[i]<- h08v04_infiles[i]         
567
    } else if (length(grep("\\.3.2.h",h08v04_infiles[i])!=0)){
568
        day_62_h08v04[i]<- h08v04_infiles[i]
569
    } else if (length(grep("\\.3.3.h",h08v04_infiles[i])!=0)){
570
        day_63_h08v04[i]<- h08v04_infiles[i]
571
    } else if (length(grep("\\.3.4.h",h08v04_infiles[i])!=0)){
572
        day_64_h08v04[i]<- h08v04_infiles[i]
573
    } else if (length(grep("\\.3.5.h",h08v04_infiles[i])!=0)){
574
        day_65_h08v04[i]<- h08v04_infiles[i]
575
    } else if (length(grep("\\.3.6.h",h08v04_infiles[i])!=0)){
576
        day_66_h08v04[i]<- h08v04_infiles[i]
577
    } else if (length(grep("\\.3.7.h",h08v04_infiles[i])!=0)){
578
        day_67_h08v04[i]<- h08v04_infiles[i]
579
    } else if (length(grep("\\.3.8.h",h08v04_infiles[i])!=0)){
580
        day_68_h08v04[i]<- h08v04_infiles[i]
581
    } else if (length(grep("\\.3.9.h",h08v04_infiles[i])!=0)){
582
        day_69_h08v04[i]<- h08v04_infiles[i]
583
    } else if (length(grep("\\.3.10.h",h08v04_infiles[i])!=0)){
584
        day_70_h08v04[i]<- h08v04_infiles[i]
585
    } else if(length(grep("\\.3.11.h",h08v04_infiles[i])!=0)){
586
        day_71_h08v04[i]<- h08v04_infiles[i]         
587
    } else if (length(grep("\\.3.12.h",h08v04_infiles[i])!=0)){
588
        day_72_h08v04[i]<- h08v04_infiles[i]
589
    } else if (length(grep("\\.3.13.h",h08v04_infiles[i])!=0)){
590
        day_73_h08v04[i]<- h08v04_infiles[i]
591
    } else if (length(grep("\\.3.14.h",h08v04_infiles[i])!=0)){
592
        day_74_h08v04[i]<- h08v04_infiles[i]
593
    } else if (length(grep("\\.3.15.h",h08v04_infiles[i])!=0)){
594
        day_75_h08v04[i]<- h08v04_infiles[i]
595
    } else if (length(grep("\\.3.16.h",h08v04_infiles[i])!=0)){
596
        day_76_h08v04[i]<- h08v04_infiles[i]
597
    } else if (length(grep("\\.3.17.h",h08v04_infiles[i])!=0)){
598
        day_77_h08v04[i]<- h08v04_infiles[i]
599
    } else if (length(grep("\\.3.18.h",h08v04_infiles[i])!=0)){
600
        day_78_h08v04[i]<- h08v04_infiles[i]
601
    } else if (length(grep("\\.3.19.h",h08v04_infiles[i])!=0)){
602
        day_79_h08v04[i]<- h08v04_infiles[i]
603
    } else if (length(grep("\\.3.20.h",h08v04_infiles[i])!=0)){
604
        day_80_h08v04[i]<- h08v04_infiles[i]
605
    } else if(length(grep("\\.3.21.h",h08v04_infiles[i])!=0)){
606
        day_81_h08v04[i]<- h08v04_infiles[i]         
607
    } else if (length(grep("\\.3.22.h",h08v04_infiles[i])!=0)){
608
        day_82_h08v04[i]<- h08v04_infiles[i]
609
    } else if (length(grep("\\.3.23.h",h08v04_infiles[i])!=0)){
610
        day_83_h08v04[i]<- h08v04_infiles[i]
611
    } else if (length(grep("\\.3.24.h",h08v04_infiles[i])!=0)){
612
        day_84_h08v04[i]<- h08v04_infiles[i]
613
    } else if (length(grep("\\.3.25.h",h08v04_infiles[i])!=0)){
614
        day_85_h08v04[i]<- h08v04_infiles[i]
615
    } else if (length(grep("\\.3.26.h",h08v04_infiles[i])!=0)){
616
        day_86_h08v04[i]<- h08v04_infiles[i]
617
    } else if (length(grep("\\.3.27.h",h08v04_infiles[i])!=0)){
618
        day_87_h08v04[i]<- h08v04_infiles[i]
619
    } else if (length(grep("\\.3.28.h",h08v04_infiles[i])!=0)){
620
        day_88_h08v04[i]<- h08v04_infiles[i]
621
    } else if (length(grep("\\.3.29.h",h08v04_infiles[i])!=0)){
622
        day_89_h08v04[i]<- h08v04_infiles[i]
623
    } else if (length(grep("\\.3.30.h",h08v04_infiles[i])!=0)){
624
        day_90_h08v04[i]<- h08v04_infiles[i]
625
    } else if (length(grep("\\.3.31.h",h08v04_infiles[i])!=0)){
626
        day_91_h08v04[i]<- h08v04_infiles[i]
627
    } else if(length(grep("\\.4.1.h",h08v04_infiles[i])!=0)){
628
        day_92_h08v04[i]<- h08v04_infiles[i]         
629
    } else if (length(grep("\\.4.2.h",h08v04_infiles[i])!=0)){
630
        day_93_h08v04[i]<- h08v04_infiles[i]
631
    } else if (length(grep("\\.4.3.h",h08v04_infiles[i])!=0)){
632
        day_94_h08v04[i]<- h08v04_infiles[i]
633
    } else if (length(grep("\\.4.4.h",h08v04_infiles[i])!=0)){
634
        day_95_h08v04[i]<- h08v04_infiles[i]
635
    } else if (length(grep("\\.4.5.h",h08v04_infiles[i])!=0)){
636
        day_96_h08v04[i]<- h08v04_infiles[i]
637
    } else if (length(grep("\\.4.6.h",h08v04_infiles[i])!=0)){
638
        day_97_h08v04[i]<- h08v04_infiles[i]
639
    } else if (length(grep("\\.4.7.h",h08v04_infiles[i])!=0)){
640
        day_98_h08v04[i]<- h08v04_infiles[i]
641
    } else if (length(grep("\\.4.8.h",h08v04_infiles[i])!=0)){
642
        day_99_h08v04[i]<- h08v04_infiles[i]
643
    } else if (length(grep("\\.4.9.h",h08v04_infiles[i])!=0)){
644
        day_100_h08v04[i]<- h08v04_infiles[i]
645
    } else if (length(grep("\\.4.10.h",h08v04_infiles[i])!=0)){
646
        day_101_h08v04[i]<- h08v04_infiles[i]
647
    } else if(length(grep("\\.4.11.h",h08v04_infiles[i])!=0)){
648
        day_102_h08v04[i]<- h08v04_infiles[i]         
649
    } else if (length(grep("\\.4.12.h",h08v04_infiles[i])!=0)){
650
        day_103_h08v04[i]<- h08v04_infiles[i]
651
    } else if (length(grep("\\.4.13.h",h08v04_infiles[i])!=0)){
652
        day_104_h08v04[i]<- h08v04_infiles[i]
653
    } else if (length(grep("\\.4.14.h",h08v04_infiles[i])!=0)){
654
        day_105_h08v04[i]<- h08v04_infiles[i]
655
    } else if (length(grep("\\.4.15.h",h08v04_infiles[i])!=0)){
656
        day_106_h08v04[i]<- h08v04_infiles[i]
657
    } else if (length(grep("\\.4.16.h",h08v04_infiles[i])!=0)){
658
        day_107_h08v04[i]<- h08v04_infiles[i]
659
    } else if (length(grep("\\.4.17.h",h08v04_infiles[i])!=0)){
660
        day_108_h08v04[i]<- h08v04_infiles[i]
661
    } else if (length(grep("\\.4.18.h",h08v04_infiles[i])!=0)){
662
        day_109_h08v04[i]<- h08v04_infiles[i]
663
    } else if (length(grep("\\.4.19.h",h08v04_infiles[i])!=0)){
664
        day_110_h08v04[i]<- h08v04_infiles[i]
665
    } else if (length(grep("\\.4.20.h",h08v04_infiles[i])!=0)){
666
        day_111_h08v04[i]<- h08v04_infiles[i]
667
    } else if(length(grep("\\.4.21.h",h08v04_infiles[i])!=0)){
668
        day_112_h08v04[i]<- h08v04_infiles[i]         
669
    } else if (length(grep("\\.4.22.h",h08v04_infiles[i])!=0)){
670
        day_113_h08v04[i]<- h08v04_infiles[i]
671
    } else if (length(grep("\\.4.23.h",h08v04_infiles[i])!=0)){
672
        day_114_h08v04[i]<- h08v04_infiles[i]
673
    } else if (length(grep("\\.4.24.h",h08v04_infiles[i])!=0)){
674
        day_115_h08v04[i]<- h08v04_infiles[i]
675
    } else if (length(grep("\\.4.25.h",h08v04_infiles[i])!=0)){
676
        day_116_h08v04[i]<- h08v04_infiles[i]
677
    } else if (length(grep("\\.4.26.h",h08v04_infiles[i])!=0)){
678
        day_117_h08v04[i]<- h08v04_infiles[i]
679
    } else if (length(grep("\\.4.27.h",h08v04_infiles[i])!=0)){
680
        day_118_h08v04[i]<- h08v04_infiles[i]
681
    } else if (length(grep("\\.4.28.h",h08v04_infiles[i])!=0)){
682
        day_119_h08v04[i]<- h08v04_infiles[i]
683
    } else if (length(grep("\\.4.29.h",h08v04_infiles[i])!=0)){
684
        day_120_h08v04[i]<- h08v04_infiles[i]
685
    } else if (length(grep("\\.4.30.h",h08v04_infiles[i])!=0)){
686
        day_121_h08v04[i]<- h08v04_infiles[i]
687
    } else if(length(grep("\\.5.1.h",h08v04_infiles[i])!=0)){
688
        day_122_h08v04[i]<- h08v04_infiles[i]         
689
    } else if (length(grep("\\.5.2.h",h08v04_infiles[i])!=0)){
690
        day_123_h08v04[i]<- h08v04_infiles[i]
691
    } else if (length(grep("\\.5.3.h",h08v04_infiles[i])!=0)){
692
        day_124_h08v04[i]<- h08v04_infiles[i]
693
    } else if (length(grep("\\.5.4.h",h08v04_infiles[i])!=0)){
694
        day_125_h08v04[i]<- h08v04_infiles[i]
695
    } else if (length(grep("\\.5.5.h",h08v04_infiles[i])!=0)){
696
        day_126_h08v04[i]<- h08v04_infiles[i]
697
    } else if (length(grep("\\.5.6.h",h08v04_infiles[i])!=0)){
698
        day_127_h08v04[i]<- h08v04_infiles[i]
699
    } else if (length(grep("\\.5.7.h",h08v04_infiles[i])!=0)){
700
        day_128_h08v04[i]<- h08v04_infiles[i]
701
    } else if (length(grep("\\.5.8.h",h08v04_infiles[i])!=0)){
702
        day_129_h08v04[i]<- h08v04_infiles[i]
703
    } else if (length(grep("\\.5.9.h",h08v04_infiles[i])!=0)){
704
        day_130_h08v04[i]<- h08v04_infiles[i]
705
    } else if (length(grep("\\.5.10.h",h08v04_infiles[i])!=0)){
706
        day_131_h08v04[i]<- h08v04_infiles[i]
707
    } else if(length(grep("\\.5.11.h",h08v04_infiles[i])!=0)){
708
        day_132_h08v04[i]<- h08v04_infiles[i]         
709
    } else if (length(grep("\\.5.12.h",h08v04_infiles[i])!=0)){
710
        day_133_h08v04[i]<- h08v04_infiles[i]
711
    } else if (length(grep("\\.5.13.h",h08v04_infiles[i])!=0)){
712
        day_134_h08v04[i]<- h08v04_infiles[i]
713
    } else if (length(grep("\\.5.14.h",h08v04_infiles[i])!=0)){
714
        day_135_h08v04[i]<- h08v04_infiles[i]
715
    } else if (length(grep("\\.5.15.h",h08v04_infiles[i])!=0)){
716
        day_136_h08v04[i]<- h08v04_infiles[i]
717
    } else if (length(grep("\\.5.16.h",h08v04_infiles[i])!=0)){
718
        day_137_h08v04[i]<- h08v04_infiles[i]
719
    } else if (length(grep("\\.5.17.h",h08v04_infiles[i])!=0)){
720
        day_138_h08v04[i]<- h08v04_infiles[i]
721
    } else if (length(grep("\\.5.18.h",h08v04_infiles[i])!=0)){
722
        day_139_h08v04[i]<- h08v04_infiles[i]
723
    } else if (length(grep("\\.5.19.h",h08v04_infiles[i])!=0)){
724
        day_140_h08v04[i]<- h08v04_infiles[i]
725
    } else if (length(grep("\\.5.20.h",h08v04_infiles[i])!=0)){
726
        day_141_h08v04[i]<- h08v04_infiles[i]
727
    } else if(length(grep("\\.5.21.h",h08v04_infiles[i])!=0)){
728
        day_142_h08v04[i]<- h08v04_infiles[i]         
729
    } else if (length(grep("\\.5.22.h",h08v04_infiles[i])!=0)){
730
        day_143_h08v04[i]<- h08v04_infiles[i]
731
    } else if (length(grep("\\.5.23.h",h08v04_infiles[i])!=0)){
732
        day_144_h08v04[i]<- h08v04_infiles[i]
733
    } else if (length(grep("\\.5.24.h",h08v04_infiles[i])!=0)){
734
        day_145_h08v04[i]<- h08v04_infiles[i]
735
    } else if (length(grep("\\.5.25.h",h08v04_infiles[i])!=0)){
736
        day_146_h08v04[i]<- h08v04_infiles[i]
737
    } else if (length(grep("\\.5.26.h",h08v04_infiles[i])!=0)){
738
        day_147_h08v04[i]<- h08v04_infiles[i]
739
    } else if (length(grep("\\.5.27.h",h08v04_infiles[i])!=0)){
740
        day_148_h08v04[i]<- h08v04_infiles[i]
741
    } else if (length(grep("\\.5.28.h",h08v04_infiles[i])!=0)){
742
        day_149_h08v04[i]<- h08v04_infiles[i]
743
    } else if (length(grep("\\.5.29.h",h08v04_infiles[i])!=0)){
744
        day_150_h08v04[i]<- h08v04_infiles[i]
745
    } else if (length(grep("\\.5.30.h",h08v04_infiles[i])!=0)){
746
        day_151_h08v04[i]<- h08v04_infiles[i]
747
    } else if (length(grep("\\.5.31.h",h08v04_infiles[i])!=0)){
748
        day_152_h08v04[i]<- h08v04_infiles[i]
749
    } else if(length(grep("\\.6.1.h",h08v04_infiles[i])!=0)){
750
        day_153_h08v04[i]<- h08v04_infiles[i]         
751
    } else if (length(grep("\\.6.2.h",h08v04_infiles[i])!=0)){
752
        day_154_h08v04[i]<- h08v04_infiles[i]
753
    } else if (length(grep("\\.6.3.h",h08v04_infiles[i])!=0)){
754
        day_155_h08v04[i]<- h08v04_infiles[i]
755
    } else if (length(grep("\\.6.4.h",h08v04_infiles[i])!=0)){
756
        day_156_h08v04[i]<- h08v04_infiles[i]
757
    } else if (length(grep("\\.6.5.h",h08v04_infiles[i])!=0)){
758
        day_157_h08v04[i]<- h08v04_infiles[i]
759
    } else if (length(grep("\\.6.6.h",h08v04_infiles[i])!=0)){
760
        day_158_h08v04[i]<- h08v04_infiles[i]
761
    } else if (length(grep("\\.6.7.h",h08v04_infiles[i])!=0)){
762
        day_159_h08v04[i]<- h08v04_infiles[i]
763
    } else if (length(grep("\\.6.8.h",h08v04_infiles[i])!=0)){
764
        day_160_h08v04[i]<- h08v04_infiles[i]
765
    } else if (length(grep("\\.6.9.h",h08v04_infiles[i])!=0)){
766
        day_161_h08v04[i]<- h08v04_infiles[i]
767
    } else if (length(grep("\\.6.10.h",h08v04_infiles[i])!=0)){
768
        day_162_h08v04[i]<- h08v04_infiles[i]
769
    } else if(length(grep("\\.6.11.h",h08v04_infiles[i])!=0)){
770
        day_163_h08v04[i]<- h08v04_infiles[i]         
771
    } else if (length(grep("\\.6.12.h",h08v04_infiles[i])!=0)){
772
        day_164_h08v04[i]<- h08v04_infiles[i]
773
    } else if (length(grep("\\.6.13.h",h08v04_infiles[i])!=0)){
774
        day_165_h08v04[i]<- h08v04_infiles[i]
775
    } else if (length(grep("\\.6.14.h",h08v04_infiles[i])!=0)){
776
        day_166_h08v04[i]<- h08v04_infiles[i]
777
    } else if (length(grep("\\.6.15.h",h08v04_infiles[i])!=0)){
778
        day_167_h08v04[i]<- h08v04_infiles[i]
779
    } else if (length(grep("\\.6.16.h",h08v04_infiles[i])!=0)){
780
        day_168_h08v04[i]<- h08v04_infiles[i]
781
    } else if (length(grep("\\.6.17.h",h08v04_infiles[i])!=0)){
782
        day_169_h08v04[i]<- h08v04_infiles[i]
783
    } else if (length(grep("\\.6.18.h",h08v04_infiles[i])!=0)){
784
        day_170_h08v04[i]<- h08v04_infiles[i]
785
    } else if (length(grep("\\.6.19.h",h08v04_infiles[i])!=0)){
786
        day_171_h08v04[i]<- h08v04_infiles[i]
787
    } else if (length(grep("\\.6.20.h",h08v04_infiles[i])!=0)){
788
        day_172_h08v04[i]<- h08v04_infiles[i]
789
    } else if(length(grep("\\.6.21.h",h08v04_infiles[i])!=0)){
790
        day_173_h08v04[i]<- h08v04_infiles[i]         
791
    } else if (length(grep("\\.6.22.h",h08v04_infiles[i])!=0)){
792
        day_174_h08v04[i]<- h08v04_infiles[i]
793
    } else if (length(grep("\\.6.23.h",h08v04_infiles[i])!=0)){
794
        day_175_h08v04[i]<- h08v04_infiles[i]
795
    } else if (length(grep("\\.6.24.h",h08v04_infiles[i])!=0)){
796
        day_176_h08v04[i]<- h08v04_infiles[i]
797
    } else if (length(grep("\\.6.25.h",h08v04_infiles[i])!=0)){
798
        day_177_h08v04[i]<- h08v04_infiles[i]
799
    } else if (length(grep("\\.6.26.h",h08v04_infiles[i])!=0)){
800
        day_178_h08v04[i]<- h08v04_infiles[i]
801
    } else if (length(grep("\\.6.27.h",h08v04_infiles[i])!=0)){
802
        day_179_h08v04[i]<- h08v04_infiles[i]
803
    } else if (length(grep("\\.6.28.h",h08v04_infiles[i])!=0)){
804
        day_180_h08v04[i]<- h08v04_infiles[i]
805
    } else if (length(grep("\\.6.29.h",h08v04_infiles[i])!=0)){
806
        day_181_h08v04[i]<- h08v04_infiles[i]
807
    } else if (length(grep("\\.6.30.h",h08v04_infiles[i])!=0)){
808
        day_182_h08v04[i]<- h08v04_infiles[i]
809
    } else if(length(grep("\\.7.1.h",h08v04_infiles[i])!=0)){
810
        day_183_h08v04[i]<- h08v04_infiles[i]         
811
    } else if (length(grep("\\.7.2.h",h08v04_infiles[i])!=0)){
812
        day_184_h08v04[i]<- h08v04_infiles[i]
813
    } else if (length(grep("\\.7.3.h",h08v04_infiles[i])!=0)){
814
        day_185_h08v04[i]<- h08v04_infiles[i]
815
    } else if (length(grep("\\.7.4.h",h08v04_infiles[i])!=0)){
816
        day_186_h08v04[i]<- h08v04_infiles[i]
817
    } else if (length(grep("\\.7.5.h",h08v04_infiles[i])!=0)){
818
        day_187_h08v04[i]<- h08v04_infiles[i]
819
    } else if (length(grep("\\.7.6.h",h08v04_infiles[i])!=0)){
820
        day_188_h08v04[i]<- h08v04_infiles[i]
821
    } else if (length(grep("\\.7.7.h",h08v04_infiles[i])!=0)){
822
        day_189_h08v04[i]<- h08v04_infiles[i]
823
    } else if (length(grep("\\.7.8.h",h08v04_infiles[i])!=0)){
824
        day_190_h08v04[i]<- h08v04_infiles[i]
825
    } else if (length(grep("\\.7.9.h",h08v04_infiles[i])!=0)){
826
        day_191_h08v04[i]<- h08v04_infiles[i]
827
    } else if (length(grep("\\.7.10.h",h08v04_infiles[i])!=0)){
828
        day_192_h08v04[i]<- h08v04_infiles[i]
829
    } else if(length(grep("\\.7.11.h",h08v04_infiles[i])!=0)){
830
        day_193_h08v04[i]<- h08v04_infiles[i]         
831
    } else if (length(grep("\\.7.12.h",h08v04_infiles[i])!=0)){
832
        day_194_h08v04[i]<- h08v04_infiles[i]
833
    } else if (length(grep("\\.7.13.h",h08v04_infiles[i])!=0)){
834
        day_195_h08v04[i]<- h08v04_infiles[i]
835
    } else if (length(grep("\\.7.14.h",h08v04_infiles[i])!=0)){
836
        day_196_h08v04[i]<- h08v04_infiles[i]
837
    } else if (length(grep("\\.7.15.h",h08v04_infiles[i])!=0)){
838
        day_197_h08v04[i]<- h08v04_infiles[i]
839
    } else if (length(grep("\\.7.16.h",h08v04_infiles[i])!=0)){
840
        day_198_h08v04[i]<- h08v04_infiles[i]
841
    } else if (length(grep("\\.7.17.h",h08v04_infiles[i])!=0)){
842
        day_199_h08v04[i]<- h08v04_infiles[i]
843
    } else if (length(grep("\\.7.18.h",h08v04_infiles[i])!=0)){
844
        day_200_h08v04[i]<- h08v04_infiles[i]
845
    } else if (length(grep("\\.7.19.h",h08v04_infiles[i])!=0)){
846
        day_201_h08v04[i]<- h08v04_infiles[i]
847
    } else if (length(grep("\\.7.20.h",h08v04_infiles[i])!=0)){
848
        day_202_h08v04[i]<- h08v04_infiles[i]
849
    } else if(length(grep("\\.7.21.h",h08v04_infiles[i])!=0)){
850
        day_203_h08v04[i]<- h08v04_infiles[i]         
851
    } else if (length(grep("\\.7.22.h",h08v04_infiles[i])!=0)){
852
        day_204_h08v04[i]<- h08v04_infiles[i]
853
    } else if (length(grep("\\.7.23.h",h08v04_infiles[i])!=0)){
854
        day_205_h08v04[i]<- h08v04_infiles[i]
855
    } else if (length(grep("\\.7.24.h",h08v04_infiles[i])!=0)){
856
        day_206_h08v04[i]<- h08v04_infiles[i]
857
    } else if (length(grep("\\.7.25.h",h08v04_infiles[i])!=0)){
858
        day_207_h08v04[i]<- h08v04_infiles[i]
859
    } else if (length(grep("\\.7.26.h",h08v04_infiles[i])!=0)){
860
        day_208_h08v04[i]<- h08v04_infiles[i]
861
    } else if (length(grep("\\.7.27.h",h08v04_infiles[i])!=0)){
862
        day_209_h08v04[i]<- h08v04_infiles[i]
863
    } else if (length(grep("\\.7.28.h",h08v04_infiles[i])!=0)){
864
        day_210_h08v04[i]<- h08v04_infiles[i]
865
    } else if (length(grep("\\.7.29.h",h08v04_infiles[i])!=0)){
866
        day_211_h08v04[i]<- h08v04_infiles[i]
867
    } else if (length(grep("\\.7.30.h",h08v04_infiles[i])!=0)){
868
        day_212_h08v04[i]<- h08v04_infiles[i]
869
    } else if (length(grep("\\.7.31.h",h08v04_infiles[i])!=0)){
870
        day_213_h08v04[i]<- h08v04_infiles[i]
871
    } else if(length(grep("\\.8.1.h",h08v04_infiles[i])!=0)){
872
        day_214_h08v04[i]<- h08v04_infiles[i]         
873
    } else if (length(grep("\\.8.2.h",h08v04_infiles[i])!=0)){
874
        day_215_h08v04[i]<- h08v04_infiles[i]
875
    } else if (length(grep("\\.8.3.h",h08v04_infiles[i])!=0)){
876
        day_216_h08v04[i]<- h08v04_infiles[i]
877
    } else if (length(grep("\\.8.4.h",h08v04_infiles[i])!=0)){
878
        day_217_h08v04[i]<- h08v04_infiles[i]
879
    } else if (length(grep("\\.8.5.h",h08v04_infiles[i])!=0)){
880
        day_218_h08v04[i]<- h08v04_infiles[i]
881
    } else if (length(grep("\\.8.6.h",h08v04_infiles[i])!=0)){
882
        day_219_h08v04[i]<- h08v04_infiles[i]
883
    } else if (length(grep("\\.8.7.h",h08v04_infiles[i])!=0)){
884
        day_220_h08v04[i]<- h08v04_infiles[i]
885
    } else if (length(grep("\\.8.8.h",h08v04_infiles[i])!=0)){
886
        day_221_h08v04[i]<- h08v04_infiles[i]
887
    } else if (length(grep("\\.8.9.h",h08v04_infiles[i])!=0)){
888
        day_222_h08v04[i]<- h08v04_infiles[i]
889
    } else if (length(grep("\\.8.10.h",h08v04_infiles[i])!=0)){
890
        day_223_h08v04[i]<- h08v04_infiles[i]
891
    } else if(length(grep("\\.8.11.h",h08v04_infiles[i])!=0)){
892
        day_224_h08v04[i]<- h08v04_infiles[i]         
893
    } else if (length(grep("\\.8.12.h",h08v04_infiles[i])!=0)){
894
        day_225_h08v04[i]<- h08v04_infiles[i]
895
    } else if (length(grep("\\.8.13.h",h08v04_infiles[i])!=0)){
896
        day_226_h08v04[i]<- h08v04_infiles[i]
897
    } else if (length(grep("\\.8.14.h",h08v04_infiles[i])!=0)){
898
        day_227_h08v04[i]<- h08v04_infiles[i]
899
    } else if (length(grep("\\.8.15.h",h08v04_infiles[i])!=0)){
900
        day_228_h08v04[i]<- h08v04_infiles[i]
901
    } else if (length(grep("\\.8.16.h",h08v04_infiles[i])!=0)){
902
        day_229_h08v04[i]<- h08v04_infiles[i]
903
    } else if (length(grep("\\.8.17.h",h08v04_infiles[i])!=0)){
904
        day_230_h08v04[i]<- h08v04_infiles[i]
905
    } else if (length(grep("\\.8.18.h",h08v04_infiles[i])!=0)){
906
        day_231_h08v04[i]<- h08v04_infiles[i]
907
    } else if (length(grep("\\.8.19.h",h08v04_infiles[i])!=0)){
908
        day_232_h08v04[i]<- h08v04_infiles[i]
909
    } else if (length(grep("\\.8.20.h",h08v04_infiles[i])!=0)){
910
        day_233_h08v04[i]<- h08v04_infiles[i]
911
    } else if(length(grep("\\.8.21.h",h08v04_infiles[i])!=0)){
912
        day_234_h08v04[i]<- h08v04_infiles[i]         
913
    } else if (length(grep("\\.8.22.h",h08v04_infiles[i])!=0)){
914
        day_235_h08v04[i]<- h08v04_infiles[i]
915
    } else if (length(grep("\\.8.23.h",h08v04_infiles[i])!=0)){
916
        day_236_h08v04[i]<- h08v04_infiles[i]
917
    } else if (length(grep("\\.8.24.h",h08v04_infiles[i])!=0)){
918
        day_237_h08v04[i]<- h08v04_infiles[i]
919
    } else if (length(grep("\\.8.25.h",h08v04_infiles[i])!=0)){
920
        day_238_h08v04[i]<- h08v04_infiles[i]
921
    } else if (length(grep("\\.8.26.h",h08v04_infiles[i])!=0)){
922
        day_239_h08v04[i]<- h08v04_infiles[i]
923
    } else if (length(grep("\\.8.27.h",h08v04_infiles[i])!=0)){
924
        day_240_h08v04[i]<- h08v04_infiles[i]
925
    } else if (length(grep("\\.8.28.h",h08v04_infiles[i])!=0)){
926
        day_241_h08v04[i]<- h08v04_infiles[i]
927
    } else if (length(grep("\\.8.29.h",h08v04_infiles[i])!=0)){
928
        day_242_h08v04[i]<- h08v04_infiles[i]
929
    } else if (length(grep("\\.8.30.h",h08v04_infiles[i])!=0)){
930
        day_243_h08v04[i]<- h08v04_infiles[i]
931
    } else if (length(grep("\\.8.31.h",h08v04_infiles[i])!=0)){
932
        day_244_h08v04[i]<- h08v04_infiles[i]
933
    }else if(length(grep("\\.9.1.h",h08v04_infiles[i])!=0)){
934
        day_245_h08v04[i]<- h08v04_infiles[i]         
935
    } else if (length(grep("\\.9.2.h",h08v04_infiles[i])!=0)){
936
        day_246_h08v04[i]<- h08v04_infiles[i]
937
    } else if (length(grep("\\.9.3.h",h08v04_infiles[i])!=0)){
938
        day_247_h08v04[i]<- h08v04_infiles[i]
939
    } else if (length(grep("\\.9.4.h",h08v04_infiles[i])!=0)){
940
        day_248_h08v04[i]<- h08v04_infiles[i]
941
    } else if (length(grep("\\.9.5.h",h08v04_infiles[i])!=0)){
942
        day_249_h08v04[i]<- h08v04_infiles[i]
943
    } else if (length(grep("\\.9.6.h",h08v04_infiles[i])!=0)){
944
        day_250_h08v04[i]<- h08v04_infiles[i]
945
    } else if (length(grep("\\.9.7.h",h08v04_infiles[i])!=0)){
946
        day_251_h08v04[i]<- h08v04_infiles[i]
947
    } else if (length(grep("\\.9.8.h",h08v04_infiles[i])!=0)){
948
        day_252_h08v04[i]<- h08v04_infiles[i]
949
    } else if (length(grep("\\.9.9.h",h08v04_infiles[i])!=0)){
950
        day_253_h08v04[i]<- h08v04_infiles[i]
951
    } else if (length(grep("\\.9.10.h",h08v04_infiles[i])!=0)){
952
        day_254_h08v04[i]<- h08v04_infiles[i]
953
    } else if(length(grep("\\.9.11.h",h08v04_infiles[i])!=0)){
954
        day_255_h08v04[i]<- h08v04_infiles[i]         
955
    } else if (length(grep("\\.9.12.h",h08v04_infiles[i])!=0)){
956
        day_256_h08v04[i]<- h08v04_infiles[i]
957
    } else if (length(grep("\\.9.13.h",h08v04_infiles[i])!=0)){
958
        day_257_h08v04[i]<- h08v04_infiles[i]
959
    } else if (length(grep("\\.9.14.h",h08v04_infiles[i])!=0)){
960
        day_258_h08v04[i]<- h08v04_infiles[i]
961
    } else if (length(grep("\\.9.15.h",h08v04_infiles[i])!=0)){
962
        day_259_h08v04[i]<- h08v04_infiles[i]
963
    } else if (length(grep("\\.9.16.h",h08v04_infiles[i])!=0)){
964
        day_260_h08v04[i]<- h08v04_infiles[i]
965
    } else if (length(grep("\\.9.17.h",h08v04_infiles[i])!=0)){
966
        day_261_h08v04[i]<- h08v04_infiles[i]
967
    } else if (length(grep("\\.9.18.h",h08v04_infiles[i])!=0)){
968
        day_262_h08v04[i]<- h08v04_infiles[i]
969
    } else if (length(grep("\\.9.19.h",h08v04_infiles[i])!=0)){
970
        day_263_h08v04[i]<- h08v04_infiles[i]
971
    } else if (length(grep("\\.9.20.h",h08v04_infiles[i])!=0)){
972
        day_264_h08v04[i]<- h08v04_infiles[i]
973
    } else if(length(grep("\\.9.21.h",h08v04_infiles[i])!=0)){
974
        day_265_h08v04[i]<- h08v04_infiles[i]         
975
    } else if (length(grep("\\.9.22.h",h08v04_infiles[i])!=0)){
976
        day_266_h08v04[i]<- h08v04_infiles[i]
977
    } else if (length(grep("\\.9.23.h",h08v04_infiles[i])!=0)){
978
        day_267_h08v04[i]<- h08v04_infiles[i]
979
    } else if (length(grep("\\.9.24.h",h08v04_infiles[i])!=0)){
980
        day_268_h08v04[i]<- h08v04_infiles[i]
981
    } else if (length(grep("\\.9.25.h",h08v04_infiles[i])!=0)){
982
        day_269_h08v04[i]<- h08v04_infiles[i]
983
    } else if (length(grep("\\.9.26.h",h08v04_infiles[i])!=0)){
984
        day_270_h08v04[i]<- h08v04_infiles[i]
985
    } else if (length(grep("\\.9.27.h",h08v04_infiles[i])!=0)){
986
        day_271_h08v04[i]<- h08v04_infiles[i]
987
    } else if (length(grep("\\.9.28.h",h08v04_infiles[i])!=0)){
988
        day_272_h08v04[i]<- h08v04_infiles[i]
989
    } else if (length(grep("\\.9.29.h",h08v04_infiles[i])!=0)){
990
        day_273_h08v04[i]<- h08v04_infiles[i]
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff