-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add an example for how to connect to output file, slice data
- Loading branch information
Andrew Moodie
committed
Aug 9, 2021
1 parent
7ccdd38
commit 0cd8095
Showing
4 changed files
with
97 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import warnings | ||
|
||
import matplotlib | ||
import matplotlib.pyplot as plt | ||
import numpy as np | ||
|
||
import pyDeltaRCM | ||
|
||
|
||
# filter out the warning raised about no netcdf being found | ||
warnings.filterwarnings("ignore", category=UserWarning) | ||
|
||
|
||
n = 20 | ||
cm = matplotlib.cm.get_cmap('tab10') | ||
|
||
|
||
# init delta model | ||
with pyDeltaRCM.shared_tools._docs_temp_directory() as output_dir: | ||
|
||
delta = pyDeltaRCM.DeltaModel( | ||
out_dir=output_dir, | ||
resume_checkpoint='../../_resources/checkpoint') | ||
|
||
|
||
_shp = delta.eta.shape | ||
|
||
# set up axis | ||
fig, ax = plt.subplots(1, 2, figsize=(6, 3)) | ||
vmin, vmax = delta.eta.min(), delta.eta.max() | ||
|
||
# fill in axis | ||
ax[0].imshow( | ||
delta.eta, vmin=vmin, vmax=vmax, cmap='cividis') | ||
ax[0].set_xticks([]) | ||
ax[0].set_yticks([]) | ||
ax[0].set_title('bed elevation') | ||
|
||
ax[1].imshow( | ||
delta.uw, cmap='plasma') | ||
ax[1].set_xticks([]) | ||
ax[1].set_yticks([]) | ||
ax[0].set_title('velocity') | ||
|
||
plt.tight_layout() | ||
plt.show() |