Commit 8fd9723d authored by Wei Chengliang's avatar Wei Chengliang
Browse files

update codestyle-PEP8

parent 9a4dead8
Pipeline #7110 failed with stage
in 0 seconds
...@@ -25,7 +25,7 @@ class FilterParam(object): ...@@ -25,7 +25,7 @@ class FilterParam(object):
# 6) sky background: e/pix/s # 6) sky background: e/pix/s
# 7) saturation magnitude # 7) saturation magnitude
# 8) dim end magnitude # 8) dim end magnitude
if filter_param == None: if filter_param is None:
filtP = { filtP = {
"NUV": [2867.7, 705.4, 2470.0, 3270.0, 0.1404, 0.004, 15.7, 25.4], "NUV": [2867.7, 705.4, 2470.0, 3270.0, 0.1404, 0.004, 15.7, 25.4],
"u": [3601.1, 852.1, 3120.0, 4090.0, 0.2176, 0.021, 16.1, 25.4], "u": [3601.1, 852.1, 3120.0, 4090.0, 0.2176, 0.021, 16.1, 25.4],
......
...@@ -9,7 +9,7 @@ class FocalPlane(object): ...@@ -9,7 +9,7 @@ class FocalPlane(object):
self.nchips = 42 self.nchips = 42
self.ignore_chips = [] self.ignore_chips = []
if bad_chips == None: if bad_chips is None:
self.bad_chips = [] self.bad_chips = []
else: else:
self.bad_chips = bad_chips self.bad_chips = bad_chips
...@@ -80,7 +80,7 @@ class FocalPlane(object): ...@@ -80,7 +80,7 @@ class FocalPlane(object):
if logger is not None: if logger is not None:
logger.info( logger.info(
" Construct the wcs of the entire image mosaic using Gnomonic/TAN projection") " Construct the wcs of the entire image mosaic using Gnomonic/TAN projection")
if (xcen == None) or (ycen == 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
......
...@@ -46,7 +46,7 @@ def photonEnergy(lambd): ...@@ -46,7 +46,7 @@ def photonEnergy(lambd):
def calculateLimitMag(aperture=2.0, psf_fwhm=0.1969, pixelSize=0.074, pmRation=0.8, throughputFn='i_throughput.txt', readout=5.0, skyFn='sky_emiss_hubble_50_50_A.dat', darknoise=0.02, exTime=150, exNum=1, fw=90000): def calculateLimitMag(aperture=2.0, psf_fwhm=0.1969, pixelSize=0.074, pmRation=0.8, throughputFn='i_throughput.txt', readout=5.0, skyFn='sky_emiss_hubble_50_50_A.dat', darknoise=0.02, exTime=150, exNum=1, fw=90000):
''' '''
description: description:
param {*} aperture: unit m, default 2 m param {*} aperture: unit m, default 2 m
param {*} psf_fwhm: psf fwhm, default 0.1969" param {*} psf_fwhm: psf fwhm, default 0.1969"
param {*} pixelSize: pixel size, default 0.074" param {*} pixelSize: pixel size, default 0.074"
......
...@@ -191,7 +191,7 @@ class Chip(FocalPlane): ...@@ -191,7 +191,7 @@ class Chip(FocalPlane):
"""Return the filter index and type for a given chip #(chipID) """Return the filter index and type for a given chip #(chipID)
""" """
filter_type_list = _util.ALL_FILTERS filter_type_list = _util.ALL_FILTERS
if chipID == None: if chipID is None:
chipID = self.chipID chipID = self.chipID
# updated configurations # updated configurations
......
...@@ -206,7 +206,7 @@ def get_poisson(seed=0, sky_level=0.): ...@@ -206,7 +206,7 @@ def get_poisson(seed=0, sky_level=0.):
def get_base_img(img, chip, read_noise, readout_time, dark_noise, exptime=150., InputDark=None): def get_base_img(img, chip, read_noise, readout_time, dark_noise, exptime=150., InputDark=None):
if InputDark == None: if InputDark is None:
# base_level = read_noise**2 + dark_noise*(exptime+0.5*readout_time) # base_level = read_noise**2 + dark_noise*(exptime+0.5*readout_time)
# base_level = dark_noise*(exptime+0.5*readout_time) # base_level = dark_noise*(exptime+0.5*readout_time)
base_level = dark_noise*(exptime) base_level = dark_noise*(exptime)
...@@ -237,7 +237,7 @@ def add_poisson(img, chip, exptime=150., seed=0, sky_level=0., poisson_noise=Non ...@@ -237,7 +237,7 @@ def add_poisson(img, chip, exptime=150., seed=0, sky_level=0., poisson_noise=Non
img.addNoise(poisson_noise) img.addNoise(poisson_noise)
# img -= read_noise**2 # img -= read_noise**2
if InputDark != None: if InputDark is not None:
# "Instrument/data/dark/dark_1000s_example_0.fits" # "Instrument/data/dark/dark_1000s_example_0.fits"
hdu = fits.open(InputDark) hdu = fits.open(InputDark)
img += hdu[0].data/hdu[0].header['exptime']*exptime img += hdu[0].data/hdu[0].header['exptime']*exptime
......
...@@ -80,6 +80,6 @@ def add_bias(self, chip, filt, tel, pointing, catalog, obs_param): ...@@ -80,6 +80,6 @@ def add_bias(self, chip, filt, tel, pointing, catalog, obs_param):
nsecy=chip.nsecy, nsecy=chip.nsecy,
nsecx=chip.nsecx, nsecx=chip.nsecx,
seed=self.overall_config["random_seeds"]["seed_biasNonUniform"]+chip.chipID) seed=self.overall_config["random_seeds"]["seed_biasNonUniform"]+chip.chipID)
elif obs_param["bias_16channel"] == False: elif obs_param["bias_16channel"] is False:
chip.img += chip.bias_level chip.img += chip.bias_level
return chip, filt, tel, pointing return chip, filt, tel, pointing
...@@ -18,7 +18,7 @@ def run_sim(): ...@@ -18,7 +18,7 @@ def run_sim():
Parameters Parameters
---------- ----------
Catalog : Class Catalog : Class
a catalog class which is inherited from observation_sim.mock_objects.CatalogBase a catalog class which is inherited from observation_sim.mock_objects.CatalogBase
Returns Returns
---------- ----------
......
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