Sylt viscosity

## ============================================================================
## Isosurfaces of viscosity at a selected time point in a tidal flat area 
## data Sylt3D is part of package OceanView
## it contains variables in sigma coordinates that have to be transformed 
## first - an example of the help file of Sylt3D
## implemented by Karline Soetaert
## ============================================================================
 it <- 1
 sigma  <- Sylt3D$sigma[,,,it]
 visc   <- Sylt3D$visc [,,,it]  
 (D <- dim(sigma))     # x, y, z
 depth <- seq(max(sigma[,,D[3]], na.rm = TRUE), 
              max(sigma[,,1   ], na.rm = TRUE), length.out = 30)

# viscosity in sigma coordinates
 visc_sig <- mapsigma(visc, sigma, depth = depth, 
   x = Sylt3D$x, y = Sylt3D$y, resfac = 3)

# create and plot the isosurfaces - plot at the end
 isosurf3D(visc_sig$x, visc_sig$y, -visc_sig$depth, colvar = visc_sig$var, 
   level = c(0.005, 0.01, 0.015), col = c("red", "blue", "green"), 
   scale = FALSE, expand = 0.1, ticktype = "detailed", 
   main = "viscosity", clab = "m2/s", alpha = 0.5,
   plot = FALSE, colkey = list(side = 1))
 persp3D(x = Sylt3D$x, y = Sylt3D$y, z = -Sylt3D$depth, 
   border = "black", col = "white", add = TRUE, plot = FALSE)

 plotdev(phi = 30)

# try:
# plotrgl(lighting  = TRUE)
# cutrgl()  # use mouse to select a region..

Go back