From 87388df495fbf10cd921fa408bc281340c0f379e Mon Sep 17 00:00:00 2001 From: Feng Shuai Date: Mon, 15 Apr 2024 12:05:26 +0000 Subject: [PATCH] Update tests/test_cube3d.py --- tests/test_cube3d.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/test_cube3d.py b/tests/test_cube3d.py index 6551572..4d56a59 100644 --- a/tests/test_cube3d.py +++ b/tests/test_cube3d.py @@ -65,12 +65,15 @@ class test_cube3d(unittest.TestCase): u.savefits('result.fits') - plt.figure(figsize=(16,4)) - plt.plot(u.wave,np.log10(u.flux[50,50,:]),color='blue',label=r'$v=%4.2f$'%(velmap.map[50,50])) - plt.plot(u.wave,np.log10(u.flux[5,95,:]),color='red',label=r'$v=%4.2f$'%(velmap.map[5,95])) - plt.xlim(3500,9500) - plt.legend(frameon=False) - plt.savefig('./image/test_cube3d_spec.png') + if np.sum(u.flux[50,50,:]) != np.sum(u.flux[5,95,:]): + print("No Problem!") + + #plt.figure(figsize=(16,4)) + #plt.plot(u.wave,np.log10(u.flux[50,50,:]),color='blue',label=r'$v=%4.2f$'%(velmap.map[50,50])) + #plt.plot(u.wave,np.log10(u.flux[5,95,:]),color='red',label=r'$v=%4.2f$'%(velmap.map[5,95])) + #plt.xlim(3500,9500) + #plt.legend(frameon=False) + #plt.savefig('./image/test_cube3d_spec.png') print("-----------------------------------------------------------------") print(">>> Unit test for **Spec Cube** Modelling has been passed!") -- GitLab