Skip to content

Commit

Permalink
AdjSD fix
Browse files Browse the repository at this point in the history
- Equation was using z= cXY+dx+ey+f instead of z = dX+eY+f
  • Loading branch information
ailich committed Oct 5, 2021
1 parent 8855223 commit 6b24ac2
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: MultiscaleDEM
Title: Calculates multi-scale geomorphometric terrain attributes from regularly gridded DEM/bathymetry rasters
Version: 0.0.1
Version: 0.0.2
Authors@R:
c(
person(given = "Alexander",
Expand Down
2 changes: 1 addition & 1 deletion R/AdjSD.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ AdjSD<- function(r, w=c(3,3), na.rm=FALSE, pad=FALSE, include_scale=FALSE){
y<- as.vector(y_mat)

#Explanatory Variable matrix X for linear fit
X<- X<- cbind(1, x*y, x, y)
X<- cbind(1, x, y)

if(pad==TRUE){
if(na.rm==FALSE){
Expand Down
Binary file modified README_files/figure-gfm/unnamed-chunk-14-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/cpp_code.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ NumericVector C_multiscale1(NumericMatrix r, IntegerVector w, NumericMatrix X, b
NumericVector out = NumericVector(n_elem); //SD Residuals
out.fill(NA_REAL);

//NEED AT LEAST 4 POINTS TO CALCULATE BECAUSE NEED AS MANY POINTS AS PARAMETERS
int thresh = 4;
//NEED AT LEAST 3 POINTS TO CALCULATE BECAUSE NEED AS MANY POINTS AS PARAMETERS
int thresh = 3;
for(int i = min_row; i< max_row; ++i) {
for(int j = min_col; j < max_col; ++j){
IntegerVector idx = IntegerVector(2);
Expand Down

0 comments on commit 6b24ac2

Please sign in to comment.