Closed jimoreira closed 2 years ago
Mind sharing a (small) reprex?
library(stars)
dir<-getwd()
setwd(paste0(dir,"\\testingPolsarPro\\automated\\outputs"))
diro<-getwd()
print(diro)
procesado<-list.files(diro,pattern = ".data$", full.names = TRUE)
print(procesado)
fecha<-lapply(procesado, function(x){
fecha1 = unlist(strsplit(x,"_"))[7]
fecha2 = as.Date(fecha1,"%Y%m%d")
return(fecha2)
})
fecha <- do.call("c",fecha)
for (i in procesado){
lista_img_interna<-list.files(i,pattern = ".img$", full.names = TRUE)
veamos<-read_stars(lista_img_interna, along ="bands", proxy = TRUE) %>% st_set_dimensions(3, values = c("Alpha","Anisotropy","Entropy"))
name<-gsub(pattern = "\\.data$", "", basename(i))
write_stars(veamos,paste0(i,"/",name,".tiff"))
}
listado_para_collection<-list.files(procesado,pattern = ".tiff$", full.names = TRUE)
veamos_2<-read_stars(listado_para_collection, along = list(time=fecha))
files https://1drv.ms/u/s!AsKUvf59Z2PFsctQUqWULH7eEWXSdw?e=DQtOo9
I reduced the items in the list. Still keep S1A and S1B, because they have different extensions, and I figured that might be one problem. Still, already have tried only with S1A, and the same Error shows.
Thanks!
These images have a different origin, so you can't read them as a single cube. Maybe read one by one, then mosaic them?
l = listado_para_collection
ll = lapply(l, read_stars)
plot(st_mosaic(ll[[1]], ll[[2]], ll[[3]], ll[[4]]))
If I use st_crop on a bounding box would work?
Not sure; maybe st_warp
?
neither of both..thanks..I realized where is the problem..need to go back to SNAP processing to produce coregistered time series.
hi, been trying to read a list of .tiff output files from snap process. They are 3 band files (anisotropy, entropy, alpha), from different dates. what I did
i have tried to use proxy bat it gives the following error:
..: for proxy objects, along argument as list is not implemented
then, the error without proxy:
Error in c.stars_proxy(list(S1A_IW_SLC__1SDV_20200107T090637_20200107T090707_030692_0384A4_CA7F.tiff = "D:\\OneDrive\\Agtech_2\\validacion\\ramiroRostan\\testingPolsarPro\\automated\\outputs\\S1A_IW_SLC__1SDV_20200107T090637_20200107T090707_030692_0384A4_CA7F.data\\S1A_IW_SLC__1SDV_20200107T090637_20200107T090707_030692_0384A4_CA7F.tiff"), : don't know how to merge arrays: please specify parameter along
the list of dates looks like this:
i also have tried along = 3:
and the result was this :
merge all the bands and times together
Does anybody solve the same problem? thanks a lot!