Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

whittaker.raster returns 0 and 1 only #4

Closed
fdetsch opened this issue Oct 2, 2015 · 1 comment
Closed

whittaker.raster returns 0 and 1 only #4

fdetsch opened this issue Oct 2, 2015 · 1 comment
Labels

Comments

@fdetsch
Copy link
Owner

fdetsch commented Oct 2, 2015

I'm trying to re-run a script I wrote a couple of months ago. Back then, I performed whittaker.raster (MODIS package version 0.10-18) on a 'RasterStack' consisting of GIMMS3g data (2000-2010; download from here) and everything worked just fine.

## load data into R
load("~/gimms_sample_data.RData")

## apply whittaker smoother
rst_wht <- 
  whittaker.raster(rst_trm, timeInfo = org_gimms, lambda = 6000, nIter = 3, 
                   removeOutlier = TRUE, threshold = 0.2, 
                   outDirPath = "data/rst/GIMMS3g/whittaker", overwrite = TRUE)

Unfortunately, my code (remained the same except for 'outlierThreshold') doesn't seem to work properly with 0.10-33. The operation finishes without raising an error, but the resulting raster layers consist of values 0 and 1 only.

## apply whittaker smoother
rst_wht <- 
  whittaker.raster(rst_trm, timeInfo = org_gimms, lambda = 6000, nIter = 3, 
                   removeOutlier = TRUE, outlierThreshold = 0.2, 
                   outDirPath = "data/rst/GIMMS3g/whittaker", overwrite = TRUE)
@fdetsch fdetsch added the bug label Oct 2, 2015
@fdetsch
Copy link
Owner Author

fdetsch commented Aug 24, 2016

Fixed rounding issue with commit 4c7b88d. The reason for the observed behavior was that the former raster::dataType "FLT" is no longer available, but has been replaced e.g. with "FLT4S". See ?dataType for further information.

In order to solve this issue, the whittaker.raster function now tries to grep the "FLT" pattern in the corresponding data type of the provided 'vi' layers rather than checking for a fixed string, thus deactivating rounding when dealing with float data.

@fdetsch fdetsch closed this as completed Aug 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant