1 | #!/usr/bin/env python |
---|
2 | # -*- coding: utf-8 -*- |
---|
3 | import string |
---|
4 | import numpy as np |
---|
5 | import matplotlib.pyplot as plt |
---|
6 | import ffgrid2 |
---|
7 | from pylab import * |
---|
8 | from mpl_toolkits.basemap import Basemap |
---|
9 | from mpl_toolkits.basemap import shiftgrid, cm |
---|
10 | from netCDF4 import Dataset |
---|
11 | |
---|
12 | |
---|
13 | |
---|
14 | def arctic_map_lat50(): |
---|
15 | |
---|
16 | |
---|
17 | ## read z_cote from netcfd file 'z_cote_global_final.nc' ## |
---|
18 | cote_bin = Dataset ('/net/argos/data/parvati/lahlod/ARCTIC/z_cote_global_final_z0_lat50.nc','r', format = 'NETCDF4') |
---|
19 | #cote_bin.variables |
---|
20 | #lon_cote = cote_bin.variables['longitude'][:] |
---|
21 | #lat_cote = cote_bin.variables['latitude'][:] |
---|
22 | lim_cote = cote_bin.variables['cote'][:] |
---|
23 | cote_bin.close() |
---|
24 | |
---|
25 | coast_bin = Dataset('/net/argos/data/parvati/lahlod/ARCTIC/z_cote_global_final_cartes_z0_lat50.nc', 'r', format = 'NETCDF4') |
---|
26 | #coast_bin.variables |
---|
27 | #lon_cote = coast_bin.variables['longitude'][:] |
---|
28 | #lat_cote = coast_bin.variables['latitude'][:] |
---|
29 | x_cote = coast_bin.variables['x'][:] |
---|
30 | y_cote = coast_bin.variables['y'][:] |
---|
31 | coast_bin.close() |
---|
32 | |
---|
33 | X = reshape(x_cote, size(x_cote)) |
---|
34 | Y = reshape(y_cote, size(y_cote)) |
---|
35 | Z_LIM = reshape(lim_cote, size(lim_cote)) |
---|
36 | |
---|
37 | indices = np.where(Z_LIM == 1.)[0] |
---|
38 | x_ind = X[indices] |
---|
39 | y_ind = Y[indices] |
---|
40 | z_ind = Z_LIM[indices] |
---|
41 | |
---|
42 | volume = z_ind/50. |
---|
43 | #fig = plt.figure() |
---|
44 | #fig = plt.scatter(x_ind, y_ind, c = z_ind, s = volume) |
---|
45 | |
---|
46 | return(x_ind, y_ind, z_ind, volume) |
---|