From 857111d8e85104455e210e8dc7bd69d628025f75 Mon Sep 17 00:00:00 2001 From: Feng Shuai Date: Mon, 15 Apr 2024 10:46:39 +0000 Subject: [PATCH] Update csst_ifs_gehong/config.py, tests/test_map2d.py, tests/test_spec1d.py, csst_ifs_gehong/spec1d.py --- csst_ifs_gehong/config.py | 2 +- csst_ifs_gehong/spec1d.py | 2 +- tests/test_map2d.py | 48 +++++++++++++++++++-------------------- tests/test_spec1d.py | 8 +++---- 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/csst_ifs_gehong/config.py b/csst_ifs_gehong/config.py index a0ab871..bedef18 100644 --- a/csst_ifs_gehong/config.py +++ b/csst_ifs_gehong/config.py @@ -33,4 +33,4 @@ class config(): self.ny = ny self.dpix = dpix self.fov_x = nx * dpix - self.fov_y = ny * dpix \ No newline at end of file + self.fov_y = ny * dpix diff --git a/csst_ifs_gehong/spec1d.py b/csst_ifs_gehong/spec1d.py index a50bf99..c91ae5b 100644 --- a/csst_ifs_gehong/spec1d.py +++ b/csst_ifs_gehong/spec1d.py @@ -8,7 +8,7 @@ from astropy.io import fits from scipy.stats import norm from scipy.interpolate import interp1d -data_path = '.' +data_path = os.getcwd() def readcol(filename, **kwargs): """ diff --git a/tests/test_map2d.py b/tests/test_map2d.py index 2581686..6e19be3 100644 --- a/tests/test_map2d.py +++ b/tests/test_map2d.py @@ -52,14 +52,14 @@ class test_map2d(unittest.TestCase): if np.sum(sbmap1.map) != np.sum(sbmap0.map): print("No Problem!") - plt.figure(figsize=(6,5)) - plt.imshow(sbmap0.map, origin='lower', cmap='gray_r') - plt.xticks([]) - plt.yticks([]) - plt.title('Surface Brightness Modelling') - plt.colorbar(label='mag') - plt.tight_layout() - plt.savefig('./image/test_map2d_SBmap.png') + #plt.figure(figsize=(6,5)) + #plt.imshow(sbmap0.map, origin='lower', cmap='gray_r') + #plt.xticks([]) + #plt.yticks([]) + #plt.title('Surface Brightness Modelling') + #plt.colorbar(label='mag') + #plt.tight_layout() + #plt.savefig('./image/test_map2d_SBmap.png') def test_velmap(self): @@ -93,14 +93,14 @@ class test_map2d(unittest.TestCase): if np.sum(velmap1.map) != np.sum(velmap0.map): print("No Problem!") - plt.figure(figsize=(6,5)) - plt.imshow(velmap0.map, origin='lower', cmap='RdBu_r') - plt.xticks([]) - plt.yticks([]) - plt.title('Velocity Map Modelling') - plt.colorbar(label='km/s') - plt.tight_layout() - plt.savefig('./image/test_map2d_velmap.png') + #plt.figure(figsize=(6,5)) + #plt.imshow(velmap0.map, origin='lower', cmap='RdBu_r') + #plt.xticks([]) + #plt.yticks([]) + #plt.title('Velocity Map Modelling') + #plt.colorbar(label='km/s') + #plt.tight_layout() + #plt.savefig('./image/test_map2d_velmap.png') def test_gremap(self): @@ -140,14 +140,14 @@ class test_map2d(unittest.TestCase): if np.sum(velmap1.map) != np.sum(velmap0.map): print("No Problem!") - plt.figure(figsize=(6,5)) - plt.imshow(velmap0.map, origin='lower', cmap='RdBu_r') - plt.xticks([]) - plt.yticks([]) - plt.title('Gredient Map Modelling') - plt.colorbar(label='') - plt.tight_layout() - plt.savefig('./image/test_map2d_gredmap.png') + #plt.figure(figsize=(6,5)) + #plt.imshow(velmap0.map, origin='lower', cmap='RdBu_r') + #plt.xticks([]) + #plt.yticks([]) + #plt.title('Gredient Map Modelling') + #plt.colorbar(label='') + #plt.tight_layout() + #plt.savefig('./image/test_map2d_gredmap.png') def test_input_image(self): diff --git a/tests/test_spec1d.py b/tests/test_spec1d.py index 08bdb67..75def91 100644 --- a/tests/test_spec1d.py +++ b/tests/test_spec1d.py @@ -108,7 +108,7 @@ class test_spec1d(unittest.TestCase): plt.xlim(3900, 6200) plt.tight_layout() - plt.savefig('./image/test_spec1d_stellarpopulation.png') + #plt.savefig('./image/test_spec1d_stellarpopulation.png') def test_Star(self): @@ -177,7 +177,7 @@ class test_spec1d(unittest.TestCase): plt.xlim(3900, 6200) plt.tight_layout() - plt.savefig('./image/test_spec1d_singlestar.png') + #plt.savefig('./image/test_spec1d_singlestar.png') print("-----------------------------------------------------------------") print(">>> Unit test for **Single Stellar** Modelling has been passed!") @@ -267,7 +267,7 @@ class test_spec1d(unittest.TestCase): plt.xlim(3900, 6200) plt.tight_layout() - plt.savefig('./image/test_spec1d_ionizedgas.png') + #plt.savefig('./image/test_spec1d_ionizedgas.png') print("-----------------------------------------------------------------") print(">>> Unit test for **Ionized Gas** Modelling has been passed!") @@ -359,7 +359,7 @@ class test_spec1d(unittest.TestCase): plt.xlim(3900, 6200) plt.tight_layout() - plt.savefig('./image/test_spec1d_agn.png') + #plt.savefig('./image/test_spec1d_agn.png') print("-----------------------------------------------------------------") print(">>> Unit test for **AGN** Modelling has been passed!") -- GitLab