Commit 82e5a736 authored by Shuai Feng's avatar Shuai Feng
Browse files

fix some bugs

parent 2497d9d1
Pipeline #7600 failed with stage
in 0 seconds
......@@ -22,13 +22,11 @@ class config():
dpix : float, optional
Pixel size in the spatial direction, by default 0.2arcsec
"""
def __init__(self, wave_min=3500.0, wave_max=10000.0,
dlam=2.0, inst_fwhm=0.1,
def __init__(self, wave_min=3500.0, wave_max=10000.0, dlam=2.0,
nx=30, ny=30, dpix=0.2):
self.dlam = dlam
self.wave = np.arange(wave_min, wave_max, dlam)
self.wave_min = wave_min
self.inst_fwhm = inst_fwhm
self.nx = nx
self.ny = ny
self.dpix = dpix
......
......@@ -229,9 +229,9 @@ class Map2d(object):
# Check Input Parameters
if (mag > 26) or (mag < 8):
print("Notice: Your input integral magnitude of Sersic mode (mag) is > 26 mag or < 8 mag.")
if (r_eff <= 0):
# raise Exception("Effective radius (r_eff) should be > 0 arcsec!")
print("Effective radius (r_eff) should be > 0 arcsec!")
if (r_eff < 0):
raise Exception("Effective radius (r_eff) should be > 0 arcsec!")
#print("Effective radius (r_eff) should be > 0 arcsec!")
if (n < 0):
raise Exception("Sersic index (n) should be > 0!")
if (ellip > 1) or (ellip < 0):
......@@ -334,7 +334,7 @@ class Map2d(object):
if np.ndim(image) == 2:
self.map = resize(image, (self.nx, self.ny))
else:
print("Input array should be a 2d-array!")
raise Exception("Input array should be a 2d-array!")
class StellarPopulationMap():
......@@ -456,17 +456,19 @@ class IonizedGasMap():
if (vdisp is None):
print('Input Vdisp Map is empty!')
else:
self.vdisp = vdisp.map
# Fix the spaxels whose vdisp is too small
ind_overrange = (self.vdisp < 10)
if len(self.vdisp[ind_overrange]) > 0:
print("Notice: Spaxel with <10km/s in the input vdisp map will be automatically adjusted to 10km/s.")
self.vdisp[ind_overrange] = 10
else:
self.vdisp = vdisp.map
if (ebv is None):
print('Input EBV Map is empty!')
else:
self.ebv = ebv.map
# Fix the spaxels whose ebv is negtive
ind_overrange = (self.ebv < 0)
if len(self.ebv[ind_overrange]) > 0:
print("Notice: Spaxel with < 0 mag in the input ebv map will be automatically adjusted to 0 mag.")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment