|
80 | 80 | "ids = np.tile([0,1], 20) \n", |
81 | 81 | "\n", |
82 | 82 | "# Anticline\n", |
83 | | - "lith = LithoLayers(mg, z0s, ids, x0=6000, y0=6000, function = lambda x, y : ((0.002*x)**2+(0.001*y)**2), attrs=attrs)\n", |
| 83 | + "lith = LithoLayers(mg, z0s, ids, x0=6000, y0=10000, function = lambda x, y : ((0.002*x)**2+(0.001*y)**2), attrs=attrs)\n", |
84 | 84 | "\n", |
85 | 85 | "# Shallow dips\n", |
86 | 86 | "#lith = LithoLayers(mg, z0s, ids, function = lambda x, y : ((0.001*x)+(0.003*y)), attrs=attrs)\n", |
|
138 | 138 | "out_fields = ['topographic__elevation',\n", |
139 | 139 | " 'rock_type__id']\n", |
140 | 140 | "\n", |
141 | | - "ds = xr.Dataset(data_vars={'topographic__elevation' : (('t', 'y', 'x'), \n", |
| 141 | + "ds = xr.Dataset(data_vars={'topographic__elevation' : (('time', 'y', 'x'), \n", |
142 | 142 | " np.empty((nts, mg.shape[0], mg.shape[1])),\n", |
143 | 143 | " {'units' : 'meters',\n", |
144 | 144 | " 'long_name': 'Topographic Elevation'}),\n", |
145 | | - " 'rock_type__id': (('t', 'y', 'x'), \n", |
| 145 | + " 'rock_type__id': (('time', 'y', 'x'), \n", |
146 | 146 | " np.empty((nts, mg.shape[0], mg.shape[1])),\n", |
147 | 147 | " {'units' : '-',\n", |
148 | 148 | " 'long_name' : 'Rock Type ID Code'})\n", |
|
153 | 153 | " 'y': (('y'), \n", |
154 | 154 | " mg.y_of_node.reshape(mg.shape)[:, 1],\n", |
155 | 155 | " {'units' : 'meters'}),\n", |
156 | | - " 'time': (('t'), \n", |
| 156 | + " 'time': (('time'), \n", |
157 | 157 | " dt*np.arange(nts)/1e6,\n", |
158 | | - " {'units': 'millions of years since model start'})\n", |
| 158 | + " {'units': 'millions of years since model start',\n", |
| 159 | + " 'standard_name' : 'time'})\n", |
159 | 160 | " }\n", |
160 | 161 | " )\n" |
161 | 162 | ] |
|
174 | 175 | { |
175 | 176 | "cell_type": "code", |
176 | 177 | "execution_count": null, |
177 | | - "metadata": {}, |
| 178 | + "metadata": { |
| 179 | + "collapsed": true |
| 180 | + }, |
178 | 181 | "outputs": [], |
179 | 182 | "source": [ |
180 | 183 | "for i in range(nts):\n", |
|
272 | 275 | { |
273 | 276 | "cell_type": "code", |
274 | 277 | "execution_count": null, |
275 | | - "metadata": {}, |
| 278 | + "metadata": { |
| 279 | + "collapsed": true |
| 280 | + }, |
276 | 281 | "outputs": [], |
277 | 282 | "source": [ |
278 | 283 | "mg2 = RasterModelGrid((100, 60), 200)\n", |
|
310 | 315 | "dt = 1000\n", |
311 | 316 | "\n", |
312 | 317 | "\n", |
313 | | - "ds2 = xr.Dataset(data_vars={'topographic__elevation' : (('t', 'y', 'x'), \n", |
| 318 | + "ds2 = xr.Dataset(data_vars={'topographic__elevation' : (('time', 'y', 'x'), \n", |
314 | 319 | " np.empty((nts, mg2.shape[0], mg2.shape[1])),\n", |
315 | 320 | " {'units' : 'meters',\n", |
316 | 321 | " 'long_name': 'Topographic Elevation'}),\n", |
317 | | - " 'rock_type__id': (('t', 'y', 'x'), \n", |
| 322 | + " 'rock_type__id': (('time', 'y', 'x'), \n", |
318 | 323 | " np.empty((nts, mg2.shape[0], mg2.shape[1])),\n", |
319 | 324 | " {'units' : '-',\n", |
320 | 325 | " 'long_name' : 'Rock Type ID Code'})\n", |
|
325 | 330 | " 'y': (('y'), \n", |
326 | 331 | " mg2.y_of_node.reshape(mg2.shape)[:, 1],\n", |
327 | 332 | " {'units' : 'meters'}),\n", |
328 | | - " 'time': (('t'), \n", |
| 333 | + " 'time': (('time'), \n", |
329 | 334 | " dt*np.arange(nts)/1e6,\n", |
330 | | - " {'units': 'millions of years since model start'})\n", |
| 335 | + " {'units': 'millions of years since model start',\n", |
| 336 | + " 'standard_name' : 'time'})\n", |
331 | 337 | " }\n", |
332 | 338 | " )\n", |
333 | 339 | "\n", |
|
429 | 435 | { |
430 | 436 | "cell_type": "code", |
431 | 437 | "execution_count": null, |
432 | | - "metadata": {}, |
| 438 | + "metadata": { |
| 439 | + "scrolled": true |
| 440 | + }, |
433 | 441 | "outputs": [], |
434 | 442 | "source": [ |
435 | 443 | "imshow_grid(mg2, 'topographic__elevation', cmap='viridis')" |
|
0 commit comments