22# ##StaMPS-Visualizer global script###
33# ####################################
44
5- # ##Loading and preparing PS data from StaMPS export
6- # library package
5+ # ###################
6+ # ##Visualizer Map###
7+ # ###################
8+
9+ # Loading and preparing PS data from StaMPS export
10+ # library package
711library(lubridate )
812
9- # looking for study site data in stusi folder
10- dat.path <- list.files(" . /stusi/" )
13+ # looking for study site data in stusi folder
14+ dat.path <- list.files(" input /stusi/" )
1115
12- # prepare objects to read data
16+ # prepare objects to read data
1317ps.loc <- list ()
1418dates.days <- list ()
1519dates.date <- list ()
1620ref.points <- list ()
1721
18- # read data into R
22+ # read data into R
1923for (i in 1 : length(dat.path )){
20- dat <- read.csv(paste(" . /stusi/" , dat.path [i ], sep = " " ))
24+ dat <- read.csv(paste(" input /stusi/" , dat.path [i ], sep = " " ))
2125 dates.days [[i ]] <- as.vector(t(dat [1 , 4 : ncol(dat )]))
2226 dates.date [[i ]] <- as_date(dates.days [[i ]], origin = " 0000-01-01" )
2327 ref.points [[i ]] <- as.vector(t(dat [1 , 1 : 2 ]))
@@ -28,52 +32,26 @@ for(i in 1:length(dat.path)){
2832 dat [, 4 : ncol(dat )])
2933}
3034
31- # prepare study site name
35+ # prepare study site name
3236str.rev <- function (x ){sapply(lapply(strsplit(x , NULL ), rev ), paste , collapse = " " )}
3337stusi <- str.rev(dat.path )
3438stusi <- substr(stusi , 5 , 50 )
3539stusi <- str.rev(stusi )
3640
37- # tidy up
38- rm(dat )
39-
40- # ##Loading and preparing custom event marker for showing
41- # ##information as points with pop-up-dialog on map
42-
43- # looking for event marker data in event_marker folder
44- event.path <- list.files(" ./event_marker/" )
45-
46- # prepare objects to read data
47- event.loc <- list ()
48- event.info <- list ()
49-
50- # read data into R
51- for (i in 1 : length(event.path )){
52- dat <- read.csv(paste(" ./event_marker/" , event.path [i ], sep = " " ), stringsAsFactors = FALSE )
53- event.info [[i ]] <- dat [ , 3 ]
54- event.loc [[i ]] <- data.frame (lon = dat [, 1 ], lat = dat [, 2 ])
55- }
56-
57- # prepare study site name
58- event <- str.rev(event.path )
59- event <- substr(event , 5 , 50 )
60- event <- str.rev(event )
61- event <- c(" ---" , event )
62-
63- # tidy up
41+ # tidy up
6442rm(dat )
6543
66- # #########################
44+ # #############################
6745
6846# ################
6947# #Baseline Plot##
7048# ################
7149
72- # #in Linux use this to prepare the SNAP export
73- # sed 's/?/0/g' stack_all_baselines.csv | sed 's/ //g'
50+ # # in Linux use this to prepare the SNAP export
51+ # sed 's/?/0/g' stack_all_baselines.csv | sed 's/ //g'
7452
75- # looking for baseline info csv files
76- dat.path <- list.files(" baseline_info/" , pattern = " .csv" )
53+ # looking for baseline info csv files
54+ dat.path <- list.files(" input/ baseline_info/" , pattern = " .csv" )
7755
7856str.rev <- function (x ){sapply(lapply(strsplit(x , NULL ), rev ), paste , collapse = " " )}
7957bl.info <- str.rev(dat.path )
0 commit comments