StaMPS-Visualizer, SNAP-StaMPS Workflow

@thho Thank you this makes absolute sense.

I’d like to point out that it is quite weird that this the first time anywhere that I’ve seen how time-series stamps analysis, or any other to be frank, are interpreted and explained decently. Not even in the manual…
So thank you @thho for being polite and honest enough to help out.

Aster

1 Like

Thx @asterios_papas :slightly_smiling_face:
During the upcoming holiday I will work on a new StamPS-Visualizer version and thought about putting a similar explanation there :wink: I’ll keep you updated

2 Likes

I use again R 3.6 on ubuntu 18.04.
when I run ui.R script : this error figure

shiny::runApp(‘Téléchargements/stamps_visualizer_01beta’)
Erreur : package ‘htmltools’ was installed by an R version with different internals; it needs to be reinstalled for use with this R version

I return to R and run :
install.packages(“shiny”), but the error still occured.

From this, I estimated that you use 3.4 and I think I was not totally wrong, since your error now reports some conflicts with different R versions installed on your machine:

You have to tidy up your R installations on your machine. In order to purge all R related installations, try to follow this steps:

#in Ubuntu Terminal
R -e '.libPaths()'

This will output you something like this:

R version 3.6.3 (2020-02-29) -- "Holding the Windsock"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> .libPaths()
[1] "/home/thho/R/x86_64-pc-linux-gnu-library/3.6"
[2] "/usr/local/lib/R/site-library"               
[3] "/usr/lib/R/site-library"                     
[4] "/usr/lib/R/library"                          
> 
> 

The entries here at the end are the paths to folders you now have to delete like this:

#in Ubuntu Terminal
rm -rf /home/<user>/R/x86_64-pc-linux-gnu-library/3.6
#do this for ALL paths in the output above, in my case 4

#now delete all R installations:
sudo apt-get remove r-base-core
sudo apt-get remove r-base
sudo apt-get autoremove

#check if there is anything left:
dpkg -l | grep ^ii | awk '$2 ~ /^r-/ { print $2 }'

#if this outputs a r-package do
dpkg -l | grep ^ii | awk '$2 ~ /^r-/ { print $2 }' | sudo xargs apt-get remove --purge -y

This should clear your conflicting R installations, after that, start setup R here:

Reinstall the packages you need within the new R installation and try again.

1 Like

Please tell me how this works for you I just want to use the time series analysis and selecting the stable area among the study location for construction purpose. I already subset it on SNAP

What I want is to export the final result on ggogle earth as well using StaMPS-Visualizer to make a time series like you post here. Thanks a lot for your effort

Please haev a look at these instructions StaMPS - Detailled instructions

Hi @thho,

it works good, thank you very much

@CDE cool have fun :smiley: !

Handling versions in processing environments is always an issue. On the other hand, there are many good tools available to keep environments stable and easy to set up for other people. Hence, in the next version release I will provide a solution with renv to set all up, and a also a Docker solution :slight_smile:

Dear sir I follow your instruction but I cant be success full what is the problem would you tell me please

some comments on your screenshot:

  • you don’t use the current version of the visualizer. to do so use the version from github:
    https://github.com/thho/StaMPS_Visualizer
  • your current plot shows the extend of PS, which you have included in the ps_plot() in matlab.
    • to select a larger extend, after trigger ps_plot(), you are asked to input a radius in which the PS processed by StaMPS are selected, choose a larger radius
    • after that, again perform the export
    • this might lead to a: errors or b: a large file with to mnay PS to be processed by StamPS-Visualizer
      • in case of a:
        • choose a very very large radius during ps_plot() then continue with case b
      • in case of b:
        • when your StaMPS export holds to many points the visualizer might crash due to rendering issues, therefore subset the points with a shape of your choice, a workflow to do this is in the manual tab of the visualizer

First guess: you do not use the up to date Visualizer version, there is a change in the matlab export procedure, you have to use the right export script depending if you work with StamPS 3.x or StaMPS 4.x see in the manual tab of the latest Visualizer version.

when I choose a larger radius (10000) this error is occured:


export_res = [lon2 lat2 disp disp_ts];
Error using horzcat
Dimensions of arrays being concatenated are not consistent.

please search for that error in the forum in this post, it was answered many times and is also documented in the manual tab of the Visualizer

Dear @thho,

I’m facing this error when I try to create a subset with the “troubleshooting script”. In particular on line 16.

immagine

Can you help me? I’m sorry if you have already answered to this issue but i didn’t find a solution in the forum.

Thank you in advance!

hi @Evandro , can you upload the picture again? I can’t read the error, since the resolution is to coarse…when you upload an image in this forum you have to wait until it shows you 100% upload before posting the post (this is my experience)

I’m sorry! Now?

immagine

@Evandro The code looks fine to me, but in your Environment (upper right panel) you can see, that the objects lat und lon are empty. Hence, loc is empty and therefore, line 16 throws an error, which uses loc as input.

But I can not see what is wrong with you read in csv. seems fine to me on the first look,

Can you please provide the output of:

colnames(pnts)

@thho Sure, this is the outpt:

colnames(pnts)
[1] “export_res_.1” “export_res_.2” “export_res_.3” “export_res_.4” “export_res_.5” “export_res_.6” “export_res_.7”
[8] “export_res_.8” “export_res_.9” “export_res_10” “export_res_11”

And here what I see opening “pnts” from the Environment

jep, ok that makes everything clear…

For some reason, your exported colnames differ from what I expected in the script:

your colnames: export_res_.1 etc.
the colnames we need in the script: export_res_1 etc.
you see the dot before the numbers, that breaks the pattern and nothing works.

I think for you it is easier to use a changed the script, use this:

###########################
###subset ts plot export###
###########################
library(sp)
library(rgdal)
library(rgeos)

#read subsetpolygon
roi <- readOGR("/home/user/studysite/roi.kml")
#read exported .csv
pnts <- read.csv("/home/user/ISNAR_master_date/stamps_tsexport.csv")
#create spatial object
lon <- pnts$export_res_.1[2:nrow(pnts)]
lat <- pnts$export_res_.2[2:nrow(pnts)]
loc <- data.frame(lon, lat)
pnts.geo <- SpatialPointsDataFrame(loc, pnts[2:nrow(pnts), ],
            proj4string = CRS("+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"))
#spatial subset
pnts.sub <- pnts.geo[roi, ]
#create table from spatial subset
sub.csv <- rbind(pnts[1, ], pnts.sub@data)
#export csv to StaMPS-Visualizer application
#adapt path to your machine
write.table(sub.csv, file = "/home/user/stamps_visualizer/stusi/stamps_tsexport.csv",
            row.names = F, col.names = T, sep = ",")
1 Like