Commit 7c2ce85a authored by Shuai Feng's avatar Shuai Feng
Browse files

fix PEP8 bugs

parent 1128112c
Pipeline #7131 failed with stage
in 0 seconds
...@@ -28,7 +28,6 @@ class config(): ...@@ -28,7 +28,6 @@ class config():
self.dlam = dlam self.dlam = dlam
self.wave = np.arange(wave_min, wave_max, dlam) self.wave = np.arange(wave_min, wave_max, dlam)
self.wave_min = wave_min self.wave_min = wave_min
self.inst_fwhm = inst_fwhm self.inst_fwhm = inst_fwhm
self.nx = nx self.nx = nx
self.ny = ny self.ny = ny
......
...@@ -9,27 +9,21 @@ class Cube3D(): ...@@ -9,27 +9,21 @@ class Cube3D():
Class of 3-dimentional spectral cube Class of 3-dimentional spectral cube
""" """
def __init__(self, config, stellar_map=None, gas_map=None): def __init__(self, config, stellar_map=None, gas_map=None):
self.config = config self.config = config
self.nx = config.nx self.nx = config.nx
self.ny = config.ny self.ny = config.ny
self.dpix = config.dpix self.dpix = config.dpix
self.fov_x = config.fov_x self.fov_x = config.fov_x
self.fov_y = config.fov_y self.fov_y = config.fov_y
self.wave = config.wave self.wave = config.wave
self.nz = len(self.wave) self.nz = len(self.wave)
self.wave0 = np.min(self.wave) self.wave0 = np.min(self.wave)
self.inst_fwhm = config.inst_fwhm self.inst_fwhm = config.inst_fwhm
self.flux = np.zeros((self.nx, self.ny, self.nz)) self.flux = np.zeros((self.nx, self.ny, self.nz))
self.stellar_map = stellar_map self.stellar_map = stellar_map
self.gas_map = gas_map self.gas_map = gas_map
def make_cube(self, stellar_tem=None, hii_tem=None): def make_cube(self, stellar_tem=None, hii_tem=None):
for i in range(self.nx): for i in range(self.nx):
for j in range(self.ny): for j in range(self.ny):
if self.stellar_map is not None: if self.stellar_map is not None:
...@@ -72,9 +66,7 @@ class Cube3D(): ...@@ -72,9 +66,7 @@ class Cube3D():
self.flux[x0 + dx, y0 + dy, :] = self.flux[x0 + dx, y0 + dy, :] + spec.flux self.flux[x0 + dx, y0 + dy, :] = self.flux[x0 + dx, y0 + dy, :] + spec.flux
def savefits(self, filename, path='./'): def savefits(self, filename, path='./'):
hdr = fits.Header() hdr = fits.Header()
hdr['FILETYPE'] = 'SCICUBE' hdr['FILETYPE'] = 'SCICUBE'
hdr['CODE'] = 'CSST-IFS-GEHONG' hdr['CODE'] = 'CSST-IFS-GEHONG'
hdr['VERSION'] = '0.0.1' hdr['VERSION'] = '0.0.1'
......
...@@ -220,8 +220,7 @@ def Calzetti_Law(wave, Rv=4.05): ...@@ -220,8 +220,7 @@ def Calzetti_Law(wave, Rv=4.05):
reddening_curve = np.zeros(len(wave)) reddening_curve = np.zeros(len(wave))
idx = (wave >= 1200) & (wave < 6300) idx = (wave >= 1200) & (wave < 6300)
reddening_curve[idx] = 2.659 * (-2.156 + 1.509 * wave_number[idx] - 0.198 * reddening_curve[idx] = 2.659 * (-2.156 + 1.509 * wave_number[idx] - 0.198 * (wave_number[idx] ** 2)) + 0.011 * (wave_number[idx] ** 3) + Rv
(wave_number[idx] ** 2)) + 0.011 * (wave_number[idx] ** 3) + Rv
idx = (wave >= 6300) & (wave <= 22000) idx = (wave >= 6300) & (wave <= 22000)
reddening_curve[idx] = 2.659 * (-1.857 + 1.040 * wave_number[idx]) + Rv reddening_curve[idx] = 2.659 * (-1.857 + 1.040 * wave_number[idx]) + Rv
......
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