Skip to content

Commit

Permalink
Add plots
Browse files Browse the repository at this point in the history
  • Loading branch information
danshapero committed Jan 20, 2024
1 parent 06b6883 commit 2b40052
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,15 @@ jobs:
pip install git+https://github.com/icepack/icepack.git
- name: Check out git repository
uses: actions/checkout@v3
- name: run tests
- name: Run tests
env:
EARTHDATA_USERNAME: ${{ secrets.EARTHDATA_USERNAME }}
EARTHDATA_PASSWORD: ${{ secrets.EARTHDATA_PASSWORD }}
run: python initialize.py
run: |
python initialize.py
python make_plot.py
- name: Upload result
uses: actions/upload-artifact@v3
with:
name: kangerdlugssuaq
path: kangerdlugssuaq.png
13 changes: 13 additions & 0 deletions make_plot.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import maptlotlib.pyplot as plt
import firedrake

filename = "kangerdlugssuaq-initial.h5"
with firedrake.CheckpointFile(filename, "r") as chk:
mesh = chk.load_mesh()
q = chk.load_function(mesh, name="log_friction")

fig, axes = plt.subplots()
axes.set_aspect("equal")
colors = firedrake.tripcolor(q, vmin=-8, vmax=+8, cmap="RdBu", axes=axes)
fig.colorbar(colors)
fig.savefig("kangerdlugssuaq.png", bbox_inches="tight")

0 comments on commit 2b40052

Please sign in to comment.