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

fix PEP8 bugs

parent 1128112c
Loading
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -28,7 +28,6 @@ class config():
        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
+30 −38
Original line number Diff line number Diff line
@@ -9,27 +9,21 @@ class Cube3D():
    Class of 3-dimentional spectral cube
    """
    def __init__(self, config, stellar_map=None, gas_map=None):
        
        self.config = config
        
        self.nx = config.nx
        self.ny = config.ny
        self.dpix = config.dpix
        self.fov_x = config.fov_x
        self.fov_y = config.fov_y
        
        self.wave = config.wave
        self.nz = len(self.wave)
        self.wave0 = np.min(self.wave)
        self.inst_fwhm = config.inst_fwhm
        
        self.flux = np.zeros((self.nx, self.ny, self.nz))
        
        self.stellar_map = stellar_map
        self.gas_map = gas_map

    def make_cube(self, stellar_tem=None, hii_tem=None):
        
        for i in range(self.nx):
            for j in range(self.ny):
                if self.stellar_map is not None:
@@ -72,9 +66,7 @@ class Cube3D():
        self.flux[x0 + dx, y0 + dy, :] = self.flux[x0 + dx, y0 + dy, :] + spec.flux

    def savefits(self, filename, path='./'):
        
        hdr = fits.Header()
        
        hdr['FILETYPE'] = 'SCICUBE'
        hdr['CODE'] = 'CSST-IFS-GEHONG'
        hdr['VERSION'] = '0.0.1'
+119 −120
Original line number Diff line number Diff line
@@ -220,8 +220,7 @@ def Calzetti_Law(wave, Rv=4.05):
    reddening_curve = np.zeros(len(wave))

    idx = (wave >= 1200) & (wave < 6300)
    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
    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

    idx = (wave >= 6300) & (wave <= 22000)
    reddening_curve[idx] = 2.659 * (-1.857 + 1.040 * wave_number[idx]) + Rv
+36 −36

File changed.

Contains only whitespace changes.