|
4 | 4 | import emsarray |
5 | 5 | from emsarray import plot, transect |
6 | 6 |
|
7 | | -dataset_url = 'https://thredds.nci.org.au/thredds/dodsC/fx3/model_data/gbr4_bgc_GBR4_H2p0_B2p0_Chyd_Dcrt.ncml' |
| 7 | +dataset_url = 'https://thredds.nci.org.au/thredds/dodsC/fx3/gbr4_H4p0_ABARRAr2_OBRAN2020_FG2Gv3_Dhnd/gbr4_simple_2022-10-31.nc' |
8 | 8 | dataset = emsarray.open_dataset(dataset_url).isel(time=-1) |
9 | 9 | dataset = dataset.ems.select_variables(['botz', 'temp']) |
10 | 10 |
|
|
34 | 34 | dataset, line, dataset['temp'], |
35 | 35 | figsize=(7.9, 3), |
36 | 36 | bathymetry=dataset['botz'], |
37 | | - landmarks=landmarks) |
| 37 | + landmarks=landmarks, |
| 38 | + title="Temperature", |
| 39 | + cmap='Oranges_r') |
38 | 40 | figure.savefig('kgari-transect.png') |
39 | 41 |
|
40 | 42 | # Plot the path of the transect |
|
43 | 45 | axes.set_aspect(aspect='equal', adjustable='datalim') |
44 | 46 | axes.set_title('Transect path') |
45 | 47 | axes.add_collection(dataset.ems.make_poly_collection( |
46 | | - dataset['botz'], cmap='Blues_r', edgecolor='face', |
| 48 | + dataset['botz'], cmap='Blues', clim=(0, 2000), edgecolor='face', |
47 | 49 | linewidth=0.5, zorder=0)) |
| 50 | +axes = figure.axes[0] |
| 51 | +axes.set_extent(plot.bounds_to_extent(line.envelope.buffer(0.2).bounds)) |
| 52 | +axes.plot(*line.coords.xy, zorder=2, c='orange', linewidth=4) |
| 53 | + |
48 | 54 | plot.add_coast(axes, zorder=1) |
49 | 55 | plot.add_gridlines(axes) |
50 | 56 | plot.add_landmarks(axes, landmarks) |
51 | | -axes = figure.axes[0] |
52 | | -axes.set_extent(plot.bounds_to_extent(line.envelope.buffer(0.2).bounds)) |
53 | | -axes.plot(*line.coords.xy, zorder=2) |
54 | 57 | figure.savefig('kgari-path.png') |
55 | 58 |
|
56 | 59 | pyplot.show(block=True) |
0 commit comments