diff --git a/catalog/C10_Catalog.py b/catalog/C10_Catalog.py index 029add6e661829c092c127decaf644769dba9017..4648f9b34257277be458a7ead64417bff2e16bc0 100644 --- a/catalog/C10_Catalog.py +++ b/catalog/C10_Catalog.py @@ -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( diff --git a/catalog/C9_Catalog.py b/catalog/C9_Catalog.py index 8dc629fe6bf4414e3266c861b0a9d619d7a89c3c..1de5392286fb2903b3c96fc83ccad45a601ee82a 100644 --- a/catalog/C9_Catalog.py +++ b/catalog/C9_Catalog.py @@ -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 diff --git a/observation_sim/instruments/Filter.py b/observation_sim/instruments/Filter.py index a030d375f91b8ce88ff9a4f34217234a1795499b..9e5083d8a7ff3ed38dcb0a18a4da6756cbf460c0 100755 --- a/observation_sim/instruments/Filter.py +++ b/observation_sim/instruments/Filter.py @@ -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)) diff --git a/observation_sim/instruments/chip/effects.py b/observation_sim/instruments/chip/effects.py index 0f835d2262e8d7042bc0160c22a860cf92a9b4a9..12f8ae356cec4390c1e83d050893571f2f4747c2 100644 --- a/observation_sim/instruments/chip/effects.py +++ b/observation_sim/instruments/chip/effects.py @@ -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: diff --git a/observation_sim/mock_objects/CatalogBase.py b/observation_sim/mock_objects/CatalogBase.py index ea94b775dcf16dd7368332bd4e2459cb2dd5a8ff..e3896a00f118b944a6fadea81cae969f3689e316 100644 --- a/observation_sim/mock_objects/CatalogBase.py +++ b/observation_sim/mock_objects/CatalogBase.py @@ -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( diff --git a/observation_sim/sim_steps/add_objects.py b/observation_sim/sim_steps/add_objects.py index b35325b28889be3c3c695fbad693aad9229c0586..5b9375f115995ba72c49d6a4dfc70c3696e878b5 100644 --- a/observation_sim/sim_steps/add_objects.py +++ b/observation_sim/sim_steps/add_objects.py @@ -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,