Skip to content

Commit

Permalink
Update interpolate_variable.R
Browse files Browse the repository at this point in the history
  • Loading branch information
sean-rohan-NOAA authored Nov 15, 2024
1 parent a8f0630 commit 194f35c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion R/interpolate_variable.R
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,15 @@ interpolate_variable <- function(dat,
xshift <- ((-1625000/cell_resolution) - floor(-1625000/cell_resolution))*cell_resolution
yshift <- ((379500/cell_resolution) - floor(379500/cell_resolution))*cell_resolution
bbox <- bbox + c(xshift,yshift,xshift,yshift)

interp_raster <- terra::rast(xmin = bbox["xmin"],
xmax = bbox["xmax"],
ymin = bbox["ymin"],
ymax = bbox["ymax"],
nrows = floor((bbox["ymax"]-bbox["ymin"])/cell.resolution),
ncols = floor((bbox["xmax"]-bbox["xmin"])/cell.resolution),
crs = interpolation.crs)

}
} else { # User-customized interpolation bounds

Expand Down Expand Up @@ -273,4 +282,4 @@ interpolate_variable <- function(dat,



}
}

0 comments on commit 194f35c

Please sign in to comment.