Commit c0c380ab authored by Wei Chengliang's avatar Wei Chengliang
Browse files

update codestyle-PEP8

parent 6281c265
Pipeline #7400 passed with stage
in 0 seconds
......@@ -457,6 +457,10 @@ class Catalog(CatalogBase):
self.objs.append(obj)
def free_mem(self, **kward):
self.starDDL.freeGlobeData()
del self.starDLL
def _load(self, **kwargs):
self.objs = []
self.ids = 0
......@@ -499,10 +503,6 @@ class Catalog(CatalogBase):
else:
print("number of objects in catalog: ", len(self.objs))
def free_mem(self, **kward):
self.starDDL.freeGlobeData()
del self.starDLL
def load_sed(self, obj, **kwargs):
if obj.type == 'star':
# _, wave, flux = tag_sed(
......
......@@ -468,7 +468,7 @@ class Catalog(CatalogBase):
0., 0., 0., 0., 0., 0., 0., 0., 0., -1, 0.)
self.objs.append(obj)
def free_mem(self, **kward):
self.starDDL.freeGlobeData()
del self.starDLL
......
......@@ -159,10 +159,9 @@ class Filter(object):
self.mag_limiting, self.mag_saturation = _util.calculateLimitMag(
psf_fwhm=psf_fwhm, pixelSize=pix_scale, throughputFn=throughput_file, readout=5.0, skyFn=skyFn, darknoise=dark_noise, exTime=exptime, fw=full_well)
if full_depth_exptime is not None:
self.mag_limiting, _ = _util.calculateLimitMag(
psf_fwhm=psf_fwhm, pixelSize=pix_scale, throughputFn=throughput_file, readout=5.0, skyFn=skyFn, darknoise=dark_noise, exTime=full_depth_exptime, fw=full_well)
self.mag_limiting, _ = _util.calculateLimitMag(psf_fwhm=psf_fwhm, pixelSize=pix_scale, throughputFn=throughput_file, readout=5.0, skyFn=skyFn, darknoise=dark_noise, exTime=full_depth_exptime, fw=full_well)
print("for filter %s: mag_limiting: %.3f, mag_saturation: %.3f" %
(self.filter_type, self.mag_limiting, self.mag_saturation))
......@@ -339,7 +339,7 @@ def MakeTrail(imgarr, satuyxtuple, charge, fullwell=9e4, direction='up', trailcu
charge = imgarr[yi+1, xi]-fullwell
yi += 1
# if yi > imgarr.shape[0]:
if yi > imgarr.shape[0] or yi == (imgarr.shape[0]//2):
if yi > imgarr.shape[0] or yi == (imgarr.shape[0]//2):
break
else:
# calculate bleeding trail:
......
......@@ -95,9 +95,7 @@ class CatalogBase(metaclass=ABCMeta):
if norm_filt is not None:
if hasattr(norm_filt, 'bandpass_full'):
norm_filt = Table(
np.array(np.array([norm_filt.bandpass_full.wave_list*10.0, norm_filt.bandpass_full.func(
norm_filt.bandpass_full.wave_list)])).T, names=(['WAVELENGTH', 'SENSITIVITY']))
norm_filt = Table(np.array(np.array([norm_filt.bandpass_full.wave_list*10.0, norm_filt.bandpass_full.func(norm_filt.bandpass_full.wave_list)])).T, names=(['WAVELENGTH', 'SENSITIVITY']))
norm_thr_rang_ids = norm_filt['SENSITIVITY'] > 0.001
else:
norm_filt = Table(
......
......@@ -75,8 +75,8 @@ def add_objects(self, chip, filt, tel, pointing, catalog, obs_param):
for ifilt in range(len(self.all_filters)):
temp_filter = self.all_filters[ifilt]
temp_filter.update_limit_saturation_mags(
exptime=pointing.exp_time,
full_depth_exptime=pointing.get_full_depth_exptime(temp_filter.filter_type),
exptime=pointing.exp_time,
full_depth_exptime=pointing.get_full_depth_exptime(temp_filter.filter_type),
chip=chip)
if temp_filter.filter_type.lower() == self.overall_config["obs_setting"]["cut_in_band"].lower():
cut_filter = temp_filter
......@@ -102,7 +102,7 @@ def add_objects(self, chip, filt, tel, pointing, catalog, obs_param):
# # [DEBUG] [TODO]
# if j >= 10:
# break
obj = cat.objs[j]
if not self._is_obj_valid(obj):
......@@ -112,7 +112,7 @@ def add_objects(self, chip, filt, tel, pointing, catalog, obs_param):
try:
sed_data = cat.load_sed(obj)
norm_filt = cat.load_norm_filt(obj)
obj.sed, obj.param["mag_%s" % filt.filter_type.lower()], obj.param["flux_%s" % filt.filter_type.lower()] = cat.convert_sed(
mag=obj.param["mag_use_normal"],
sed=sed_data,
......
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