r-spatial / dtwSat

Time-Weighted Dynamic Time Warping for satellite image time series analysis
https://www.victor-maus.com/dtwSat/
GNU General Public License v3.0
131 stars 39 forks source link

error in twdtwApplyParallel "subscript out of bounds" the same as the unsolved issue #39

Closed Panbh closed 2 years ago

Panbh commented 5 years ago

Dear Victor,

I am trying to run your code for a TWDTW in a sample study area. I'm using Sentinel-1 data, for 29 images throughout 2018.

All works fine until I use the function "twdtwApplyParallel". It throws an error:

Error in [<-(tmp, rows, , value = d$value$value[[l]]) : subscript out of bounds

When running with the "twdtwApply" function, again, it fails with the error:

Error in [<-(tmp, rows, , value = B[[l]]) : subscript out of bounds

I have read the issue "error in twdtwApplyParallel "subscript out of bounds" #35" opened by n-verde. After adding the filepath variable to the twdtwApplyParallel and twdtwApply functions removes the error, but the code fails at the same functions (twdtwApply and twdtwApplyParallel) with the new error:(The same as n-verde)

Error in rng[1, ] : incorrect number of dimensions.

I have examined my data ('changsha_SAR_stackBYmatlab.tif' & 'changsha_doy_stackBYmatlab.tif') and there is no N/A in them. So I can't remove the N/A in my data to run the function just like n-verde.

Here is my code&data: https://drive.google.com/open?id=1tj-kj2wjVHR4bCFe2-IO4MlqoDV2wQ8k

Any idea what might be wrong?

Thank you very much,

Panbh

vwmaus commented 2 years ago

Please install the new version from GitHub and see the example in: https://github.com/vwmaus/dtwSat/blob/89d5db9ff27999ef259258dc6502c1d63da4a1e8/examples/fast_twdtw.R#L53