Commit dc74ba7f authored by Zhang Xin's avatar Zhang Xin
Browse files

pep8

parent 2166c80e
Pipeline #7119 failed with stage
in 0 seconds
...@@ -12,8 +12,8 @@ def checkInputList(input_list, n): ...@@ -12,8 +12,8 @@ def checkInputList(input_list, n):
if not isinstance(input_list, list): if not isinstance(input_list, list):
raise TypeError("Input type is not list!", input_list) raise TypeError("Input type is not list!", input_list)
for i in input_list: for i in input_list:
if type(i) != type(1.1): if type(i) is not type(1.1):
if type(i) != type(1): if type(i) is not type(1):
raise TypeError( raise TypeError(
"Input list's element is not float or int!", input_list) "Input list's element is not float or int!", input_list)
if len(input_list) != n: if len(input_list) != n:
......
...@@ -33,7 +33,7 @@ class Galaxy(MockObject): ...@@ -33,7 +33,7 @@ class Galaxy(MockObject):
raise ValueError( raise ValueError(
"!!!The number of PSF profiles and the number of bandpasses must be equal.") "!!!The number of PSF profiles and the number of bandpasses must be equal.")
objs = [] objs = []
if nphotons_tot == None: if nphotons_tot is None:
nphotons_tot = self.getElectronFluxFilt(filt, tel, exptime) nphotons_tot = self.getElectronFluxFilt(filt, tel, exptime)
# print("nphotons_tot = ", nphotons_tot) # print("nphotons_tot = ", nphotons_tot)
...@@ -92,7 +92,7 @@ class Galaxy(MockObject): ...@@ -92,7 +92,7 @@ class Galaxy(MockObject):
return final return final
def drawObj_multiband(self, tel, pos_img, psf_model, bandpass_list, filt, chip, nphotons_tot=None, g1=0, g2=0, exptime=150., fd_shear=None): def drawObj_multiband(self, tel, pos_img, psf_model, bandpass_list, filt, chip, nphotons_tot=None, g1=0, g2=0, exptime=150., fd_shear=None):
if nphotons_tot == None: if nphotons_tot is None:
nphotons_tot = self.getElectronFluxFilt(filt, tel, exptime) nphotons_tot = self.getElectronFluxFilt(filt, tel, exptime)
# print("nphotons_tot = ", nphotons_tot) # print("nphotons_tot = ", nphotons_tot)
...@@ -471,7 +471,7 @@ class Galaxy(MockObject): ...@@ -471,7 +471,7 @@ class Galaxy(MockObject):
return 1, pos_shear return 1, pos_shear
def getGSObj(self, psf, g1=0, g2=0, flux=None, filt=None, tel=None, exptime=150.): def getGSObj(self, psf, g1=0, g2=0, flux=None, filt=None, tel=None, exptime=150.):
if flux == None: if flux is None:
flux = self.getElectronFluxFilt(filt, tel, exptime) flux = self.getElectronFluxFilt(filt, tel, exptime)
disk = galsim.Sersic(n=self.disk_sersic_idx, disk = galsim.Sersic(n=self.disk_sersic_idx,
half_light_radius=self.hlr_disk, flux=1.0) half_light_radius=self.hlr_disk, flux=1.0)
......
...@@ -108,7 +108,7 @@ class MockObject(object): ...@@ -108,7 +108,7 @@ class MockObject(object):
def drawObj_multiband(self, tel, pos_img, psf_model, bandpass_list, filt, chip, nphotons_tot=None, g1=0, g2=0, def drawObj_multiband(self, tel, pos_img, psf_model, bandpass_list, filt, chip, nphotons_tot=None, g1=0, g2=0,
exptime=150., fd_shear=None): exptime=150., fd_shear=None):
if nphotons_tot == None: if nphotons_tot is None:
nphotons_tot = self.getElectronFluxFilt(filt, tel, exptime) nphotons_tot = self.getElectronFluxFilt(filt, tel, exptime)
# print("nphotons_tot = ", nphotons_tot) # print("nphotons_tot = ", nphotons_tot)
...@@ -581,7 +581,7 @@ class MockObject(object): ...@@ -581,7 +581,7 @@ class MockObject(object):
def drawObj_PSF(self, tel, pos_img, psf_model, bandpass_list, filt, chip, nphotons_tot=None, g1=0, g2=0, def drawObj_PSF(self, tel, pos_img, psf_model, bandpass_list, filt, chip, nphotons_tot=None, g1=0, g2=0,
exptime=150., fd_shear=None, chip_output=None): exptime=150., fd_shear=None, chip_output=None):
if nphotons_tot == None: if nphotons_tot is None:
nphotons_tot = self.getElectronFluxFilt(filt, tel, exptime) nphotons_tot = self.getElectronFluxFilt(filt, tel, exptime)
# print("nphotons_tot = ", nphotons_tot) # print("nphotons_tot = ", nphotons_tot)
...@@ -650,7 +650,7 @@ class MockObject(object): ...@@ -650,7 +650,7 @@ class MockObject(object):
os.makedirs(fn, exist_ok=True) os.makedirs(fn, exist_ok=True)
fn = fn + "/ccd_{:}".format(chip.chipID) + \ fn = fn + "/ccd_{:}".format(chip.chipID) + \
"_psf_"+str(self.param['id'])+".fits" "_psf_"+str(self.param['id'])+".fits"
if fn != None: if fn is not None:
if os.path.exists(fn): if os.path.exists(fn):
os.remove(fn) os.remove(fn)
hdu = fitsio.PrimaryHDU() hdu = fitsio.PrimaryHDU()
......
...@@ -63,7 +63,7 @@ class Chip(object): ...@@ -63,7 +63,7 @@ class Chip(object):
if (xcen is None) or (ycen is None): if (xcen is None) or (ycen is None):
xcen = self.cen_pix_x xcen = self.cen_pix_x
ycen = self.cen_pix_y ycen = self.cen_pix_y
if pix_scale == None: if pix_scale is None:
pix_scale = self.pix_scale pix_scale = self.pix_scale
# dudx = -np.cos(img_rot.rad) * pix_scale # dudx = -np.cos(img_rot.rad) * pix_scale
# dudy = -np.sin(img_rot.rad) * pix_scale # dudy = -np.sin(img_rot.rad) * pix_scale
......
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