# NOT RUN {
{
# u is NetCDF and lat and lon characters
input <- system.file("extdata",
"uwnd.mon.mean_200hPa_2014JFM.nc",
package = "raytracing")
b <- betaks(u = input, plots = TRUE)
b$ksm[] <- ifelse(b$ksm[] >= 16 |
b$ksm[] <= 0, NA, b$ksm[])
cores <- c("#ff0000","#ff5a00","#ff9a00","#ffce00","#f0ff00")
graphics::filled.contour(b$ksm[, -c(1:5, 69:73)] ,
col = rev(colorRampPalette(cores, bias = 0.5)(20)),
main = "Ks")
# u, lat and lon as numeric
input <- system.file("extdata",
"uwnd.mon.mean_200hPa_2014JFM.bin",
package = "raytracing")
u <- readBin(input,
what = numeric(),
size = 4,
n = 144*73*4)
lat <- seq(-90, 90, 2.5)
lon <- seq(-180, 180 - 1, 2.5)
u <- matrix(u,
nrow = length(lon),
ncol = length(lat))
graphics::filled.contour(u, main = "Zonal Wind Speed [m/s]")
b <- betaks(u, lat, lon)
b$ksm[] <- ifelse(b$ksm[] >= 16 |
b$ksm[] <= 0, NA, b$ksm[])
cores <- c("#ff0000","#ff5a00","#ff9a00","#ffce00","#f0ff00")
graphics::filled.contour(b$ksm[, -c(1:5, 69:73)] ,
col = rev(colorRampPalette(cores, bias = 0.5)(20)),
main = "Ks")
}
# }
Run the code above in your browser using DataLab