Skip to content

Commit

Permalink
test_radialI: save diag fig
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffjennings committed Nov 1, 2023
1 parent eecfef4 commit c61f864
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/onedim_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
from mpol.onedim import radialI, radialV
from mpol.plot import plot_image

def test_radialI(mock_1d_image_model):
def test_radialI(mock_1d_image_model, tmp_path):
# obtain a 1d radial brightness profile I(r) from an image

r, i, i2d, _, _, geom, coords = mock_1d_image_model

rtest, itest = radialI(i2d, coords, geom, bins=None)

_, ax = plt.subplots(ncols=2)
fig, ax = plt.subplots(ncols=2)

plot_image(i2d, extent=coords.img_ext, ax=ax[0], clab='Jy sr$^{-2}$')

Expand All @@ -20,6 +20,9 @@ def test_radialI(mock_1d_image_model):
ax[1].plot(r, i, 'k', label='truth')
ax[1].plot(rtest, itest, 'r.-', label='result')

fig.savefig(tmp_path / "test_radialI.png", dpi=300)
plt.close("all")

expected = [
5.79780326e+10, 2.47990375e+10, 4.19794053e+09, 1.63165616e+10,
2.56197452e+10, 1.86014523e+10, 1.39800643e+10, 1.14935415e+10,
Expand Down

0 comments on commit c61f864

Please sign in to comment.