Skip to content

Commit ba58de8

Browse files
committed
minor: update doc
1 parent 188a7b7 commit ba58de8

File tree

7 files changed

+19
-18
lines changed

7 files changed

+19
-18
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Suggests:
3030
License: GPL-3
3131
Encoding: UTF-8
3232
LazyData: true
33-
RoxygenNote: 7.2.3
33+
RoxygenNote: 7.3.2
3434
Config/testthat/edition: 3
3535
Roxygen: list(markdown = TRUE)
3636
VignetteBuilder: knitr

NAMESPACE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,10 @@ importFrom(fields,image.plot)
6464
importFrom(fields,predictSurface)
6565
importFrom(glue,glue)
6666
importFrom(hydroGOF,KGE)
67+
importFrom(magrittr,"%$%")
6768
importFrom(magrittr,"%<>%")
6869
importFrom(magrittr,"%>%")
70+
importFrom(magrittr,set_names)
6971
importFrom(matrixStats,rowMeans2)
7072
importFrom(plyr,llply)
7173
importFrom(plyr,round_any)

R/spInterp_Tps.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ spInterp_Tps <- function(points, dat, range, res = 1,
1919
if (nrow(points) != nrow(dat)) stop("Length of points and dat should be equal!")
2020

2121
if (is.null(Z)) ZGrid = NULL
22-
22+
2323
grid <- query_gridInfo(range, res)
2424
m = Tps(points, dat, Z = Z, ...)
2525
pred = predictSurface(m, grid, extrap = TRUE, ZGrid = ZGrid)

R/spInterp_adw.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ spInterp <- function(points, dat, range, res = 1,
5454
.[, .(value = weighted.mean(x, w, na.rm = TRUE)), .(lon, lat)] %>%
5555
{ merge(grid, ., all.x = TRUE)$value }
5656
}, .parallel = .parallel, .progress = "text") %>% do.call(cbind, .)
57-
5857
list(weight = weight, coord = grid, predicted = pred) %>% set_class("spInterp")
5958
}
6059

man/spInterp-package.Rd

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/anusplin.Rmd

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,11 @@ dat <- dat_RH[, .(lon, lat, alt, RH)]
3232
X <- dat[, .(lon, lat, alt)] %>% as.matrix()
3333
Y <- dat[, .(RH)] %>% as.matrix()
3434
35-
res <- 1
35+
res <- 1
3636
range <- c(70, 140, 15, 55)
3737
r_dem <- get_chinadem(res = res) %>% round(1)
3838
f_dem <- "output/dem.asc"
39-
40-
write_dem(r_dem, f_dem, digits = 1)
39+
# write_dem(r_dem, f_dem, digits = 1)
4140
```
4241

4342
# 1. anusplin

scripts/mete2000_hourly_prcp_HuBei.qmd

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
```{r}
22
library(Ipaper)
33
library(data.table)
4-
54
library(tidymet)
65
library(lubridate)
76
library(terra)
@@ -30,11 +29,11 @@ df_mat2 = df_mat[year(date) >= 1960]
3029
## 1. 数据量过大,每年单独处理
3130

3231
```{r}
33-
cdd = 500
34-
# l = cal_weight(X, range, res=cellsize, cdd = cdd, wFUN = "wFUN_adw")
35-
# weight = do.call(rbind, l) %>% as.data.table()
36-
r <- spInterp_adw(X, Y, range, res = cellsize, cdd = cdd)
37-
print(str(r))
32+
# cdd = 500
33+
# # l = cal_weight(X, range, res=cellsize, cdd = cdd, wFUN = "wFUN_adw")
34+
# # weight = do.call(rbind, l) %>% as.data.table()
35+
# r <- spInterp_adw(X, Y, range, res = cellsize, cdd = cdd)
36+
# print(str(r))
3837
```
3938

4039

@@ -43,14 +42,17 @@ print(str(r))
4342
> 只做目标区域的插值
4443
4544
```{r}
46-
cellsize = 0.01
45+
# bbox(105.62916666665245, 28.827500000006523, 116.74499999997568, 34.548333333334654)
46+
range <- c(105, 117, 28, 35)
47+
# poly <- st_rect(range)
48+
# write_shp(poly, "湖北_shape.shp")
49+
cellsize = 0.05
4750
range = st_range(basin, cellsize)
4851
4952
ra = make_rast(range, cellsize)
5053
values(ra) = 1:size(ra)
51-
52-
plot(ra)
53-
plot(vect(basin), add=TRUE)
54+
# plot(ra)
55+
# plot(vect(basin), add=TRUE)
5456
```
5557

5658

@@ -75,6 +77,7 @@ print(str(r))
7577
## 3. 转为nc文件
7678

7779
```{r}
80+
# 之前只做了官山
7881
res <- r %$% cbind(coord, predicted)
7982
ra <- rast(res, extent = ext(range))
8083
@@ -88,7 +91,6 @@ writeCDF(ra, fout, "prcp", "precipitation", "mm/h",
8891
overwrite = TRUE)
8992
```
9093

91-
9294
### 日降水
9395

9496
```{r}

0 commit comments

Comments
 (0)