La continuité du service gitlab.irstea.fr sera assurée en 2020. Nous envisageons ensuite une évolution vers une forge nationale INRAE encore à construire. Nous vous tiendrons au courant des évolutions futures.

change folders organisation

parent 57df4757
3
4
5
8
9
11
13
16
17
18
19
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
This diff is collapsed.
......@@ -5,17 +5,20 @@ library(foreach)
library(scales)
library(dplyr)
csv=c("/home/je/Bureau/lab5/plots/niakhar_2017_radar_toggplot.csv","/home/je/Bureau/lab5/plots/niakhar_2017_radar_notree_toggplot.csv",
"/home/je/Bureau/lab5/plots/niakhar_2018_radar_toggplot.csv","/home/je/Bureau/lab5/plots/niakhar_2018_radar_notree_toggplot.csv",
"/home/je/Bureau/lab5/plots/nioro_2018_radar_toggplot.csv","/home/je/Bureau/lab5/plots/nioro_2018_radar_notree_toggplot.csv")
setwd("/home/je/Bureau/lab5/")
dir.create("./plots")
csv=c("./stats/niakhar_2017_radar_toggplot.csv","./stats/niakhar_2017_radar_notree_toggplot.csv",
"./stats/niakhar_2018_radar_toggplot.csv","./stats/niakhar_2018_radar_notree_toggplot.csv",
"./stats/nioro_2018_radar_toggplot.csv","./stats/nioro_2018_radar_notree_toggplot.csv")
foreach(j=1:length(csv)) %do% {
df <- read.csv(csv[j], colClasses = c("Date","character","character","Date","Date","double","double"))
id<- unique(df$Plot)
outName <- unlist(strsplit(csv[j],"/"))[7]
outName <- unlist(strsplit(csv[j],"/"))[3]
outName <- gsub(".csv",".pdf",outName)
pdf(paste("/home/je/Bureau/lab5/plots/",outName,sep=""), width = 8.98, height = 5.86, title = "Plot mean")
pdf(paste("./plots/",outName,sep=""), width = 8.98, height = 5.86, title = "Plot mean")
foreach(i=1:length(id)) %do% {
plot <- df[which(df$Plot==id[i]),]
p <- ggplot(data=plot, aes(x=Date, y=Mean)) +
......@@ -36,21 +39,21 @@ foreach(j=1:length(csv)) %do% {
dev.off()
}
csv=c("/home/je/Bureau/lab5/plots/niakhar_2017_opt_toggplot.csv","/home/je/Bureau/lab5/plots/niakhar_2017_opt_notree_toggplot.csv",
"/home/je/Bureau/lab5/plots/niakhar_2017_opt_gapf_toggplot.csv","/home/je/Bureau/lab5/plots/niakhar_2017_opt_gapf_notree_toggplot.csv",
"/home/je/Bureau/lab5/plots/niakhar_2018_opt_toggplot.csv","/home/je/Bureau/lab5/plots/niakhar_2018_opt_notree_toggplot.csv",
"/home/je/Bureau/lab5/plots/niakhar_2018_opt_gapf_toggplot.csv","/home/je/Bureau/lab5/plots/niakhar_2018_opt_gapf_notree_toggplot.csv",
"/home/je/Bureau/lab5/plots/nioro_2018_opt_toggplot.csv","/home/je/Bureau/lab5/plots/nioro_2018_opt_notree_toggplot.csv",
"/home/je/Bureau/lab5/plots/nioro_2018_opt_gapf_toggplot.csv","/home/je/Bureau/lab5/plots/nioro_2018_opt_gapf_notree_toggplot.csv")
csv=c("./stats/niakhar_2017_opt_toggplot.csv","./stats/niakhar_2017_opt_notree_toggplot.csv",
"./stats/niakhar_2017_opt_gapf_toggplot.csv","./stats/niakhar_2017_opt_gapf_notree_toggplot.csv",
"./stats/niakhar_2018_opt_toggplot.csv","./stats/niakhar_2018_opt_notree_toggplot.csv",
"./stats/niakhar_2018_opt_gapf_toggplot.csv","./stats/niakhar_2018_opt_gapf_notree_toggplot.csv",
"./stats/nioro_2018_opt_toggplot.csv","./stats/nioro_2018_opt_notree_toggplot.csv",
"./stats/nioro_2018_opt_gapf_toggplot.csv","./stats/nioro_2018_opt_gapf_notree_toggplot.csv")
foreach(j=1:length(csv)) %do% {
df <- read.csv(csv[j], colClasses = c("Date","character","character","Date","Date","double","double"))
df <- filter(df, Band %in% c("B2","B3","B4","B8","B5","B6","B7","B8A","B11","B12"))
id<- unique(df$Plot)
outName <- unlist(strsplit(csv[j],"/"))[7]
outName <- unlist(strsplit(csv[j],"/"))[3]
outName <- gsub(".csv","_Bands.pdf",outName)
pdf(paste("/home/je/Bureau/lab5/plots/",outName,sep=""), width = 8.98, height = 5.86, title = "Plot mean")
pdf(paste("./plots/",outName,sep=""), width = 8.98, height = 5.86, title = "Plot mean")
foreach(i=1:length(id)) %do% {
plot <- df[which(df$Plot==id[i]),]
p <- ggplot(data=plot, aes(x=Date, y=Mean)) +
......@@ -75,10 +78,10 @@ foreach(j=1:length(csv)) %do% {
df <- read.csv(csv[j], colClasses = c("Date","character","character","Date","Date","double","double"))
df <- filter(df, Band %in% c("NDVI","NDWI","CIGreen","CIRedEdge","EVI","MSAVI2","GDVI"))
id<- unique(df$Plot)
outName <- unlist(strsplit(csv[j],"/"))[7]
outName <- unlist(strsplit(csv[j],"/"))[3]
outName <- gsub(".csv","_Indices.pdf",outName)
pdf(paste("/home/je/Bureau/lab5/plots/",outName,sep=""), width = 8.98, height = 5.86, title = "Plot mean")
pdf(paste("./plots/",outName,sep=""), width = 8.98, height = 5.86, title = "Plot mean")
foreach(i=1:length(id)) %do% {
plot <- df[which(df$Plot==id[i]),]
p <- ggplot(data=plot, aes(x=Date, y=Mean)) +
......
......@@ -124,18 +124,15 @@ def ZonalStats (plots_file,lstTS,dates_file,outPath,outPattern,tree_mask=None):
vmem_drv = None
dataPath = os.path.join(outPath,"data")
if not os.path.exists(dataPath):
os.makedirs(dataPath)
dataCSV = os.path.join(dataPath,'{}.csv'.format(outPattern))
outPath = os.path.join(outPath,"stats")
if not os.path.exists(outPath):
os.makedirs(outPath)
dataCSV = os.path.join(outPath,'{}.csv'.format(outPattern))
outdf = outdf.drop(columns='feat_index')
outdf.to_csv(dataCSV,index=False)
# To ggplot
plotPath = os.path.join(outPath,"plots")
if not os.path.exists(plotPath):
os.makedirs(plotPath)
plotCSV = os.path.join(plotPath,'{}_toggplot.csv'.format(outPattern))
plotCSV = os.path.join(outPath,'{}_toggplot.csv'.format(outPattern))
ggplot_df = pd.DataFrame.from_dict(ggplot_dic)
ggplot_df = ggplot_df.loc[ggplot_df.Plot.isin(outdf['ID'])]
......@@ -379,4 +376,4 @@ if __name__=="__main__":
ZonalStats(plots_file,lstTS,dates_file,outPath,outPattern)
outPattern = "nioro_2018_opt_gapf_notree"
ZonalStats(plots_file,lstTS,dates_file,outPath,outPattern,tree_mask)
\ No newline at end of file
ZonalStats(plots_file,lstTS,dates_file,outPath,outPattern,tree_mask)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment