In the second exercise you need to plot ocean depth against ocean age. You have the topography / bathymetry data and the age data. You should do this for the "deep oceans" to avoid including the continental shelves and, for that matter, the continents. The age dataset is only valid where there are magnetic stripes. Other places in the grid are flagged as "Not a Number" or NaN and will not plot. You might have to strip out these points for plotting / curve fitting though.
In [2]:
%pylab inline
from osgeo import gdal
import cartopy.crs as ccrs
import matplotlib.pyplot as plt
In [11]:
from scipy.misc import imresize
etopoH = gdal.Open("../../Data/Resources/ETOPO1_Ice_c_geotiff.tif")
etopoH_img = etopoH.ReadAsArray()[::4,::4]
del(etopoH)
ages = np.load("../../Data/Resources/global_age_data.3.6.z.npz")["ageData"]
etopoH_1 = imresize(etopoH_img, ages.shape, interp='bilinear', mode="F")
etopoH_1[ np.isnan(ages) ] = np.nan
print etopoH_img.shape
print etopoH_1.shape
print ages.shape
In [ ]:
## Code here
In [ ]:
## Code here
In [ ]:
## Code here
Now try interpolating the bathymetry to a smoothed / downsampled version of the ages.
ages_reduced = ages[::8,::8] # This is arbitrary, you should try some different ones
# OR
ages_reduced2 = imresize(ages, (226,451), interp='bilinear', mode="F")
# OR
ages_reduced2 = imresize(ages, (226,451), interp='bicubic', mode="F")
# OR
ages_reduced2 = imresize(ages, (226,451), interp='lanczos', mode="F")
Comment on which of these is the more effective.
In [34]:
ages_reduced = ages[::8,::8] # This is arbitrary, you should try some different ones
plt.imshow(ages_reduced)
plt.show()
ages_reduced2 = imresize(ages, (226,451), interp='bicubic', mode="F")
plt.imshow(ages_reduced2)
plt.show()
In [ ]:
### Your code here
In [ ]:
### Your code here
Obviously there are problems with the data - looking at every pixel in the image does not account for regions where there are sea mounts or other features on the ocean floor that we might consider anomalous. Actually, the other reason this doesn't work very well is that it fails to account for sediment accumulation and loading.