-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.Rhistory
512 lines (512 loc) · 17.9 KB
/
.Rhistory
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
help(TCHazaRds)
version(TCHazaRds)
version(TCHazaRds)
paramsTable = read.csv(system.file("extdata/tuningParams/defult_params.csv",package = "TCHazaRds"))
paramsTable
remove.packages("TCHazaRds")
install.packages("TCHazaRds")
paramsTable = read.csv(system.file("extdata/tuningParams/defult_params.csv",package = "TCHazaRds"))
paramsTable
require(TCHazaRds)
?TCHazaRdsWindFields
require(TCHazaRds)
require(terra)
dem <- rast(system.file("extdata/DEMs/YASI_dem.tif", package="TCHazaRds"))
land <- dem; land[land > 0] = 0
inland_proximity = distance(land,target = 0)
GEO_land = land_geometry(dem,inland_proximity)
TCi = vect(cbind(c(154,154),c(-26.1,-26)),"lines",crs="epsg:4283") #track line segment
TCi$PRES = 950
TCi$RMAX = 40
TCi$VMAX = 60
TCi$B = 1.4
TCi$ISO_TIME = "2022-10-04 20:00:00"
TCi$LON = geom(TCi)[1,3]
TCi$LAT = geom(TCi)[1,4]
TCi$STORM_SPD = perim(TCi)/(3*3600) #m/s
TCi$thetaFm = 90-returnBearing(TCi)
#OR
TC <- vect(system.file("extdata/YASI/YASI.shp", package="TCHazaRds"))
TC$PRES <- TC$BOM_PRES
plot(dem);lines(TC,lwd = 4,col=2)
paramsTable = read.csv(system.file("extdata/tuningParams/defult_params.csv",package = "TCHazaRds"))
#calculate the wind hazard
outdate = seq(strptime(TC$ISO_TIME[44],"%Y-%m-%d %H:%M:%S",tz="UTC"),
strptime(TC$ISO_TIME[46],"%Y-%m-%d %H:%M:%S",tz="UTC"),
3600*3)
HAZi = TCHazaRdsWindFields(outdate=outdate,GEO_land=GEO_land,TC=TC,paramsTable=paramsTable,returnWaves = TRUE)
plot(max(HAZi$Hs))
HAZi$Hs
HAZi
plot(max(HAZi$Hs0))
outdate = seq(strptime(TC$ISO_TIME[42],"%Y-%m-%d %H:%M:%S",tz="UTC"),
strptime(TC$ISO_TIME[46],"%Y-%m-%d %H:%M:%S",tz="UTC"),
3600*3)
HAZi = TCHazaRdsWindFields(outdate=outdate,GEO_land=GEO_land,TC=TC,paramsTable=paramsTable,returnWaves = TRUE)
plot(max(HAZi$Hs0))
outdate = seq(strptime(TC$ISO_TIME[41],"%Y-%m-%d %H:%M:%S",tz="UTC"),
strptime(TC$ISO_TIME[46],"%Y-%m-%d %H:%M:%S",tz="UTC"),
3600*1)
HAZi = TCHazaRdsWindFields(outdate=outdate,GEO_land=GEO_land,TC=TC,paramsTable=paramsTable,returnWaves = TRUE)
plot(max(HAZi$Hs0))
plot(max(HAZi$Hs0),col = rainbow(16))
boundary_raster <- boundaries(dem, type="inner")
boundaries(dem)
as.points(boundaries(dem))
plot(as.points(boundaries(dem)))
?boundaries
boundaries(dem,type='inner')
boundaries(dem)
plot(boundaries(dem))
plot(boundaries(dem), type='inner')
plot(boundaries(dem, type='inner'))
boundaries(dem, type='inner')
boundaries(x = dem, type='inner')
dem
boundary_raster <- as.points(as.polygons((dem, dissolve = FALSE))
boundary_raster <- as.points(as.polygons(dem, dissolve = FALSE))
plot(boundary_raster)
terra::points
terra::click(6)
?terra::click
terra::click(n=6)
vect(rbind(
c(148.0137, -16.50246),
c(148.2246, -16.82972),
c(148.3211, -17.15124),
c(148.4657, -17.54740),
c(148.5381, -17.92059),
c(148.8153, -18.68993)),"lines")
boundary_points = vect(rbind(
c(148.0137, -16.50246),
c(148.2246, -16.82972),
c(148.3211, -17.15124),
c(148.4657, -17.54740),
c(148.5381, -17.92059),
c(148.8153, -18.68993)),"points")
extract(dem,boundary_points)
?extract(dem,boundary_points)
extract(dem,boundary_points,bind=TRUE)
boundary_points$node_id = 0:5
inland_proximity = rep(0,length(dem_v))
dem_v = extract(dem,boundary_points,bind=TRUE)
boundary_points = vect(rbind(
c(148.0137, -16.50246),
c(148.2246, -16.82972),
c(148.3211, -17.15124),
c(148.4657, -17.54740),
c(148.5381, -17.92059),
c(148.8153, -18.68993)),"points")
boundary_points$node_id = 0:5
dem_v = extract(dem,boundary_points,bind=TRUE)
inland_proximity = rep(0,length(dem_v))
dem_v
inland_proximity = rep(0,length(dem_v))
GEO_land = land_geometry(dem,inland_proximity)
GEO_land = land_geometry(dem_v,inland_proximity)
land_geometry
ge = geom(boundary_points)
ge
dem <- rast(system.file("extdata/DEMs/YASI_dem.tif", package="TCHazaRds"))
land <- dem; land[land > 0] = 0
inland_proximity = distance(land,target = 0)
GEO_land = land_geometry(dem,inland_proximity)
GEO_land
GEO_land$inlandD
plot(GEO_land$inlandD)
minmax(GEO_land$inlandD)
is.na(GEO_land$inlandD)
plot(GEO_land$dem)
boundary_points = vect(rbind(
c(148.0137, -16.50246),
c(148.2246, -16.82972),
c(148.3211, -17.15124),
c(148.4657, -17.54740),
c(148.5381, -17.92059),
c(148.8153, -18.68993)),"points")
boundary_points$node_id = 0:5
dem_v = extract(dem,boundary_points,bind=TRUE)
inland_proximity = rep(0,length(dem_v))
GEO_land = boundary_points
GEO_land$dem = NA
ge = geom(boundary_points)
GEO_land$lons = ge[,3]
GEO_land$lats = ge[,4]
GEO_land$slope = NA
GEO_land$aspect = NA
GEO_land$inlandD = NA
wearth <- pi*(1.0 / 24.0) / 1800.0
GEO_land$f = 2*wearth*sin(ge[,4]*pi / 180.0)
GEO_land
HAZi = TCHazaRdsWindFields(outdate=outdate,GEO_land=GEO_land,TC=TC,paramsTable=paramsTable,returnWaves = TRUE)
traceback()
values(GEO_land$lons)
GEO_land$lons
HAZi
extract(HAZi,boundary_points,bind=TRUE)
bound_l = extract(HAZi,boundary_points,bind=TRUE)
plot(bound_l[[1]]m"Hm0")
plot(bound_l[[1]],"Hm0")
plot(bound_l[[6]],"Hm0")
plot(bound_l[[6]])
a = bound_l[[6]]
plot(a)
a
plot(a,"Hs0")
outdate = seq(strptime(TC$ISO_TIME[41],"%Y-%m-%d %H:%M:%S",tz="UTC"),
strptime(TC$ISO_TIME[45],"%Y-%m-%d %H:%M:%S",tz="UTC"),
3600*1)
HAZi = TCHazaRdsWindFields(outdate=outdate,GEO_land=GEO_land,TC=TC,paramsTable=paramsTable,returnWaves = TRUE)
bound_l = extract(HAZi,boundary_points,bind=TRUE)
bound_l
outdate = seq(strptime(TC$ISO_TIME[41],"%Y-%m-%d %H:%M:%S",tz="UTC"),
strptime(TC$ISO_TIME[44],"%Y-%m-%d %H:%M:%S",tz="UTC"),
3600*1)
HAZi = TCHazaRdsWindFields(outdate=outdate,GEO_land=GEO_land,TC=TC,paramsTable=paramsTable,returnWaves = TRUE)
outdate = seq(strptime(TC$ISO_TIME[41],"%Y-%m-%d %H:%M:%S",tz="UTC"),
strptime(TC$ISO_TIME[45],"%Y-%m-%d %H:%M:%S",tz="UTC"),
3600*1)
HAZi = TCHazaRdsWindFields(outdate=outdate,GEO_land=GEO_land,TC=TC,paramsTable=paramsTable,returnWaves = TRUE)
require(TCHazaRds)
require(terra)
dem <- rast(system.file("extdata/DEMs/YASI_dem.tif", package="TCHazaRds"))
land <- dem; land[land > 0] = 0
inland_proximity = distance(land,target = 0)
GEO_land = land_geometry(dem,inland_proximity)
TCi = vect(cbind(c(154,154),c(-26.1,-26)),"lines",crs="epsg:4283") #track line segment
TCi$PRES = 950
TCi$RMAX = 40
TCi$VMAX = 60
TCi$B = 1.4
TCi$ISO_TIME = "2022-10-04 20:00:00"
TCi$LON = geom(TCi)[1,3]
TCi$LAT = geom(TCi)[1,4]
TCi$STORM_SPD = perim(TCi)/(3*3600) #m/s
TCi$thetaFm = 90-returnBearing(TCi)
#OR
TC <- vect(system.file("extdata/YASI/YASI.shp", package="TCHazaRds"))
TC$PRES <- TC$BOM_PRES
plot(dem);lines(TC,lwd = 4,col=2)
paramsTable = read.csv(system.file("extdata/tuningParams/defult_params.csv",package = "TCHazaRds"))
#calculate the wind hazard
outdate = seq(strptime(TC$ISO_TIME[41],"%Y-%m-%d %H:%M:%S",tz="UTC"),
strptime(TC$ISO_TIME[44],"%Y-%m-%d %H:%M:%S",tz="UTC"),
3600*1)
HAZi = TCHazaRdsWindFields(outdate=outdate,GEO_land=GEO_land,TC=TC,paramsTable=paramsTable,returnWaves = TRUE)
plot(max(HAZi$Hs0),col = rainbow(16))
####
boundary_points = vect(rbind(
c(148.0137, -16.50246),
c(148.2246, -16.82972),
c(148.3211, -17.15124),
c(148.4657, -17.54740),
c(148.5381, -17.92059),
c(148.8153, -18.68993)),"points")
boundary_points$node_id = 0:5
bound_l = extract(HAZi,boundary_points,bind=TRUE)
bound_l
outdate
coords <- crds(boundary_points)
coords
HAZi
longnames(HAZi)
units(HAZi)
bound_l[[6]]
values(bound_l[[6]])
pwd()
getwd()
# Define dimensions
require(ncdf4)
node_dim <- ncdim_def(name = "node", units = "-", vals = boundary_points$node_id)
time_dim <- ncdim_def(name = "time", units = "seconds since 1970-01-01 00:00:00",
vals = as.numeric(as.POSIXct(outdate, origin="1970-01-01")))
lon_dim <- ncvar_def(name = "lon", units = "degrees_east", dim = list(node_dim),missval = -999,longname = "Longitude")
lat_dim <- ncvar_def(name = "lat", units = "degrees_north",dim = list(node_dim),missval = -999,longname = "Latitude")
Hs0_var <- ncvar_def(name = "Hs0",units = "m",dim = c(node_dim,time_dim),longname = "Deep_water_significant_wave_height")
Hs0_var <- ncvar_def(name = "Hs0",units = "m",dim = list(node_dim,time_dim),longname = "Deep_water_significant_wave_height")
Tp0_var <- ncvar_def(name = "Tp0",units = "s",dim = list(node_dim,time_dim),longname = "peak_period")
Dp0_var <- ncvar_def(name = "Dp0",units = "deg",dim = list(node_dim,time_dim),longname = "peak_wave_direction")
nc_file <- nc_create("c:/Users/ogr013/Downloads/boundary_output.nc", list(Hs0_var, Tp0_var, Dp0_var))
ncvar_put(nc_file, Hs0_var, values(bound_l[[6]]))
boundary_points$node_id
Hs0_values <- as.matrix(values(bound_l[[6]])[, -1]) # Exclude node_id column
Hs0_values
Hs0_values <- as.matrix(values(bound_l[[6]])[, -1]) # Exclude node_id column
ncvar_put(nc_file, Hs0_var, Hs0_values)
Hs0_values <- as.matrix(values(bound_l[[6]])[, -1]) # Exclude node_id column
Tp0_values <- as.matrix(values(bound_l[[7]])[, -1]) # Exclude node_id column
Dp0_values <- as.matrix(values(bound_l[[8]])[, -1]) # Exclude node_id column
node_dim <- ncdim_def(name = "node", units = "-", vals = boundary_points$node_id)
time_dim <- ncdim_def(name = "time", units = "seconds since 1970-01-01 00:00:00",
vals = as.numeric(as.POSIXct(outdate, origin="1970-01-01")))
lon_dim <- ncvar_def(name = "lon", units = "degrees_east", dim = list(node_dim),missval = -999,longname = "Longitude")
lat_dim <- ncvar_def(name = "lat", units = "degrees_north",dim = list(node_dim),missval = -999,longname = "Latitude")
Hs0_var <- ncvar_def(name = "Hs0",units = "m",dim = list(node_dim,time_dim),longname = "Deep_water_significant_wave_height")
Tp0_var <- ncvar_def(name = "Tp0",units = "s",dim = list(node_dim,time_dim),longname = "peak_period")
Dp0_var <- ncvar_def(name = "Dp0",units = "deg",dim = list(node_dim,time_dim),longname = "peak_wave_direction")
nc_file <- nc_create("c:/Users/ogr013/Downloads/boundary_output.nc", list(Hs0_var, Tp0_var, Dp0_var))
Hs0_values <- as.matrix(values(bound_l[[6]])[, -1]) # Exclude node_id column
Tp0_values <- as.matrix(values(bound_l[[7]])[, -1]) # Exclude node_id column
Dp0_values <- as.matrix(values(bound_l[[8]])[, -1]) # Exclude node_id column
ncvar_put(nc_file, Hs0_var, Hs0_values)
ncvar_put(nc_file, Tp0_var, Tp0_values)
ncvar_put(nc_file, Dp0_var, Dp0_values)
nc_close(nc_file)
####
boundary_points = vect(rbind(
c(148.0137, -16.50246),
c(148.2246, -16.82972),
c(148.3211, -17.15124),
c(148.4657, -17.54740),
c(148.5381, -17.92059),
c(148.8153, -18.68993)),"points")
boundary_points$node_id = 0:5
bound_l = extract(HAZi,boundary_points,bind=TRUE)
coords <- crds(boundary_points)
# Define dimensions
# Load required libraries
require(ncdf4)
require(terra)
# Define dimensions
node_dim <- ncdim_def(name = "node", units = "-", vals = boundary_points$node_id)
time_dim <- ncdim_def(name = "time", units = "seconds since 1970-01-01 00:00:00",
vals = as.numeric(as.POSIXct(outdate, origin="1970-01-01")))
# Define coordinate variables
lon_var <- ncvar_def(name = "lon", units = "degrees_east", dim = list(node_dim),
missval = -999, longname = "Longitude", prec = "double")
lat_var <- ncvar_def(name = "lat", units = "degrees_north", dim = list(node_dim),
missval = -999, longname = "Latitude", prec = "double")
# Define wave variables according to SCHISM-WWM conventions
Hs0_var <- ncvar_def(name = "Hs0", units = "m", dim = list(node_dim, time_dim),
longname = "Deep_water_significant_wave_height", prec = "double")
Tp0_var <- ncvar_def(name = "Tp0", units = "s", dim = list(node_dim, time_dim),
longname = "Peak_wave_period", prec = "double")
Dp0_var <- ncvar_def(name = "Dp0", units = "deg", dim = list(node_dim, time_dim),
longname = "Peak_wave_direction", prec = "double")
# Create the NetCDF file
nc_file <- nc_create("c:/Users/ogr013/Downloads/boundary_output.nc",
list(lon_var, lat_var, Hs0_var, Tp0_var, Dp0_var))
# Add data to the NetCDF file
Hs0_values <- as.matrix(values(bound_l[[6]])[, -1]) # Exclude node_id column
Tp0_values <- as.matrix(values(bound_l[[7]])[, -1]) # Exclude node_id column
Dp0_values <- as.matrix(values(bound_l[[8]])[, -1]) # Exclude node_id column
# Write the coordinate data
ncvar_put(nc_file, lon_var, coords[, 1]) # Longitude
ncvar_put(nc_file, lat_var, coords[, 2]) # Latitude
# Write the wave data
ncvar_put(nc_file, Hs0_var, Hs0_values)
ncvar_put(nc_file, Tp0_var, Tp0_values)
ncvar_put(nc_file, Dp0_var, Dp0_values)
# Add global attributes
ncatt_put(nc_file, 0, "title", "SCHISM-WWM Boundary Wave Input")
ncatt_put(nc_file, 0, "institution", "CSIRO Enviromnet")
ncatt_put(nc_file, 0, "source", "Generated by R using the TCHazaRds and ncdf4 packages")
ncatt_put(nc_file, 0, "history", paste("Created on", Sys.Date()))
nc_close(nc_file)
nc = nc_open("c:/Users/ogr013/Downloads/boundary_output.nc")
nc
plot(Hazi$Hs0)
plot(HAZi$Hs0)
plot(HAZi$Hs0,col = rainbow(16))
?TCHazaRdsWindFields
plot(HAZi$Hs0,col = rainbow(16))
plot(max(HAZi$Hs0),col = rainbow(16))
plot(max(HAZi$Hs0),col = rainbow(16),main = "maximum Hs0 over the simulation")
require(TCHazaRds)
require(terra)
dem <- rast(system.file("extdata/DEMs/YASI_dem.tif", package="TCHazaRds"))
land <- dem; land[land > 0] = 0
inland_proximity = distance(land,target = 0)
GEO_land = land_geometry(dem,inland_proximity)
TCi = vect(cbind(c(154,154),c(-26.1,-26)),"lines",crs="epsg:4283") #track line segment
TCi$PRES = 950
TCi$RMAX = 40
TCi$VMAX = 60
TCi$B = 1.4
TCi$ISO_TIME = "2022-10-04 20:00:00"
TCi$LON = geom(TCi)[1,3]
TCi$LAT = geom(TCi)[1,4]
TCi$STORM_SPD = perim(TCi)/(3*3600) #m/s
TCi$thetaFm = 90-returnBearing(TCi)
#OR
TC <- vect(system.file("extdata/YASI/YASI.shp", package="TCHazaRds"))
TC$PRES <- TC$BOM_PRES
plot(dem);lines(TC,lwd = 4,col=2)
paramsTable = read.csv(system.file("extdata/tuningParams/defult_params.csv",package = "TCHazaRds"))
outdate = seq(strptime(TC$ISO_TIME[41],"%Y-%m-%d %H:%M:%S",tz="UTC"),
strptime(TC$ISO_TIME[44],"%Y-%m-%d %H:%M:%S",tz="UTC"),
3600*1)
HAZi = TCHazaRdsWindFields(outdate=outdate,GEO_land=GEO_land,TC=TC,paramsTable=paramsTable,returnWaves = TRUE)
plot(HAZi$Hs0,col = rainbow(16))
plot(max(HAZi$Hs0),col = rainbow(16),main = "maximum Hs0 over the simulation")
HAZi
####
#define boundary points
boundary_points = vect(rbind(
c(148.0137, -16.50246),
c(148.2246, -16.82972),
c(148.3211, -17.15124),
c(148.4657, -17.54740),
c(148.5381, -17.92059),
c(148.8153, -18.68993)),"points")
boundary_points$node_id = 0:5
#extract boundary points
bound_l = extract(HAZi,boundary_points,bind=TRUE)
bound_l
# write to netcdf
require(ncdf4)
HAZi
plot(HAZi$Dp0)
plot(HAZi$Tp0)
values(GEO_land)
values(GEO_land)$dem
class(values(GEO_land))
source("C:/Users/ogr013/GIT_folders/TCHazard/WWMIII_boundary.R", echo=TRUE)
nc
require(TCHazaRds)
require(terra)
#define the domain
dem <- rast(system.file("extdata/DEMs/YASI_dem.tif", package="TCHazaRds"))
land <- dem; land[land > 0] = 0
inland_proximity = distance(land,target = 0)
GEO_land = land_geometry(dem,inland_proximity)
#define the TC
TC <- vect(system.file("extdata/YASI/YASI.shp", package="TCHazaRds"))
TC$PRES <- TC$BOM_PRES
plot(dem);lines(TC,lwd = 4,col=2)
#define the TC
TC <- vect(system.file("extdata/YASI/YASI.shp", package="TCHazaRds"))
TC$PRES <- TC$BOM_PRES
?update_Track
TCu = update_Track(
indate = strptime(TCi$ISO_TIME,"%Y-%m-%d %H:%M:%S", tz = "UTC"),
TClons = TCi$LON,
TClats = TCi$LAT,
vFms=TCi$STORM_SPD,
thetaFms=TCi$thetaFm,
cPs=TCi$PRES,
rMaxModel=params$rMaxModel,
vMaxModel=params$vMaxModel,
betaModel=params$betaModel,
eP = params$eP,
rho = params$rhoa,
RMAX = TCi$RMAX,
VMAX = TCi$VMAX,
B = TCi$B
)
paramsTable <- read.csv(system.file("extdata/tuningParams/defult_params.csv",package = "TCHazaRds"))
params <- array(paramsTable$value,dim = c(1,length(paramsTable$value)))
colnames(params) <- paramsTable$param
params <- data.frame(params)
TCu = update_Track(
indate = strptime(TCi$ISO_TIME,"%Y-%m-%d %H:%M:%S", tz = "UTC"),
TClons = TCi$LON,
TClats = TCi$LAT,
vFms=TCi$STORM_SPD,
thetaFms=TCi$thetaFm,
cPs=TCi$PRES,
rMaxModel=params$rMaxModel,
vMaxModel=params$vMaxModel,
betaModel=params$betaModel,
eP = params$eP,
rho = params$rhoa,
RMAX = TCi$RMAX,
VMAX = TCi$VMAX,
B = TCi$B
)
TCu = update_Track(
indate = strptime(TC$ISO_TIME,"%Y-%m-%d %H:%M:%S", tz = "UTC"),
TClons = TC$LON,
TClats = TC$LAT,
vFms=TC$STORM_SPD,
thetaFms=TC$thetaFm,
cPs=TC$PRES,
rMaxModel=params$rMaxModel,
vMaxModel=params$vMaxModel,
betaModel=params$betaModel,
eP = params$eP,
rho = params$rhoa,
RMAX = TC$RMAX,
VMAX = TC$VMAX,
B = TC$B
)
TCu
plot(TCu$rMax)
indate = strptime(TC$ISO_TIME,"%Y-%m-%d %H:%M:%S", tz = "UTC")
plot(indate,TCu$rMax)
indate = strptime(TC$ISO_TIME,"%Y-%m-%d %H:%M:%S", tz = "UTC")
TCu = update_Track(
indate = indate,
TClons = TC$LON,
TClats = TC$LAT,
vFms=TC$STORM_SPD,
thetaFms=TC$thetaFm,
cPs=TC$PRES,
rMaxModel=params$rMaxModel,
vMaxModel=params$vMaxModel,
betaModel=params$betaModel,
eP = params$eP,
rho = params$rhoa,
RMAX = TC$RMAX,
VMAX = TC$VMAX,
B = TC$B
)
plot(indate,TCu$rMax)
length(TCu$rMax)
length(indate)
outdate <- seq(min(indate),max(indate),"hour") #array sequence from t1 to t2 stepping by “hour”
outdate
indate = strptime(TC$ISO_TIME,"%Y-%m-%d %H:%M:%S", tz = "UTC")
outdate <- seq(min(indate),max(indate),"hour") #array sequence from t1 to t2 stepping by “hour”
TCu = update_Track(outdate=outdate,
indate = indate,
TClons = TC$LON,
TClats = TC$LAT,
vFms=TC$STORM_SPD,
thetaFms=TC$thetaFm,
cPs=TC$PRES,
rMaxModel=params$rMaxModel,
vMaxModel=params$vMaxModel,
betaModel=params$betaModel,
eP = params$eP,
rho = params$rhoa,
RMAX = TC$RMAX,
VMAX = TC$VMAX,
B = TC$B
)
plot(indate,TCu$rMax)
plot(outdate,TCu$rMax)
outdate
length(outdate)
TCu$odatei
TCu$odatei
plot(TCu$odatei+strptime("1970-01-01 00:00","%Y-%m-%d %H:%M",tz = "UTC"),TCu$rMax)
tm = TCu$odatei+strptime("1970-01-01 00:00","%Y-%m-%d %H:%M",tz = "UTC")
plot(tm,TCu$rMax,type = "l")
lines(indate,TCu$odatei)
lines(indate,TC$BOM_RMW/1.852 )
TC$BOM_RMW/1.852
plot(tm,TCu$rMax,type = "l",xlim = c(0,20))
plot(tm,TCu$rMax,type = "l",ylim = c(0,50))
lines(indate,TC$BOM_RMW/1.852 )
plot(tm,TCu$rMax,type = "l",ylim = c(0,50))
lines(indate,TC$BOM_RMW/1.852,col=4)
lines(indate,TC$USA_RMW/1.852,col=2)
lines(indate,TC$BOM_RMW,col=4)
lines(indate,TC$USA_RMW,col=2)
tm = TCu$odatei+strptime("1970-01-01 00:00","%Y-%m-%d %H:%M",tz = "UTC")
plot(tm,TCu$rMax,type = "l",ylim = c(0,50))
lines(indate,TC$BOM_RMW/1.852,col=4)
lines(indate,TC$USA_RMW/1.852,col=2)
=params$rMaxModel
params$rMaxModel
paramsTable
remove.packages("TCHazaRds")
devtools::check_win_devel()
rhub::check()
rhub::check_for_cran()
rhub::rhub_check()
rhub::rhub_check()
devtools::release()
devtools::release()
remove.packages("TCHazaRds")