# Bathymetry data

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

# Part 1

Here is a nice colorful bathymetry (and elevation) plot of the Sea of Okhotsk provided by Ian.

A slightly older attempt at doing something similar using the NOAA "Design-a-Grid" tool line is posted here: http://students.washington.edu/itaylor/R/#Maps .

Copy and paste the code from here and you get the plot above. The maps and mapdata packages are used to get the aspect ratio right and then add the coastline. Bath_map2.r

```#grid data in ASCII raster format with no headers from  http://www.ngdc.noaa.gov/mgg/gdas/gd_designagrid.html
# note: path changed, file Bath_map2.r likely needs to have the same correction as in the two lines below
lonvec = seq(130,180,1/15) #4-minute grid
latvec = seq(30,70,1/15)
d2 = d[nrow(d):1,] #why it needs to be flipped over, who knows?

# new and fancier, extending to full range of topo.colors separately for land and water
dmin=min(d2)
dmax=max(d2)
NwaterColors = round(abs(dmin))
NlandColors = round(abs(dmax))

#taking first 1/3 of topo.colors of length NwaterColors for water
waterColorVec = topo.colors(NwaterColors*3)[1:NwaterColors]
#taking second 2/3 of topo.colors of length NlandColors for land
landColorVec = topo.colors(NlandColors*3/2)[round(NlandColors/2+1):round(1.5*NlandColors)]
#combining
allColorVec = c(waterColorVec,landColorVec)

#plot in R
library(maps)
library(mapdata)
map('worldHires',xlim=c(140,173),ylim=c(43,63), xaxs='i',yaxs='i')
box()
axis(1, seq(140,180,5),paste(seq(140,180,5),'°E', sep=''))
axis(2, seq(30,70,5),paste(seq(30,70,5),'°N', sep=''))
```

# Part II

Minor revisions to the code, using the same data, yield a three dimensional perspective that gives a good idea of how much deeper the ocean is than the mountains are high, and how shallow the Sea of Okhotsk really is. The code is here.

# Even Better Data Sources

For very, very detailed bathymetry (and elevation), there are 30 arc-second grid data at http://www.bodc.ac.uk/data/online_delivery/gebco/. These data are, I think, among the highest quality available publicly on a global scale. That data is in NetCDF (Network Common Data Form) format, which is some sort of standard for geographical or otherwise array oriented data developed by UCAR. In R, it requires the use of the RNetCDF package.

Using that data I made 3-D plots like the one at right of roughly a 20x20 nautical mile grid around each of six Steller sea lion rookeries in Russia. The transluscent floating purple circle represents the 10 km likely foraging radius of the sea lions. If there is interest in seeing the code for using the RNetCSF package, I can try to dig it up and post it. Eli 04:36, 14 April 2009 (PDT)