Loading catalog/C9_Catalog.py +4 −0 Original line number Diff line number Diff line Loading @@ -469,6 +469,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 Loading observation_sim/instruments/chip/effects.py +9 −1 Original line number Diff line number Diff line Loading @@ -84,7 +84,7 @@ def BadColumns(GSImage, seed=20240309, chipid=1, logger=None): rgdn = Generator(PCG64(int(seed*1.3))) nbadsecA, nbadsecD = rgn.integers(low=1, high=5, size=2) collen = rgcollen.integers(low=int(ysize*0.1), high=int(ysize*0.7), size=(nbadsecA+nbadsecD)) collen = rgcollen.integers(low=int(ysize*0.1), high=int(ysize*0.5), size=(nbadsecA+nbadsecD)) xposit = rgxpos.integers(low=int(xsize*0.05), high=int(xsize*0.95), size=(nbadsecA+nbadsecD)) if logger is not None: logger.info(xposit+1) Loading Loading @@ -350,8 +350,12 @@ def MakeTrail(imgarr, satuyxtuple, charge, fullwell=9e4, direction='up', trailcu imgarr[yi, xi] = fullwell if direction == 'up': yi -= 1 if yi == (imgarr.shape[0]//2 - 1): break elif direction == 'down': yi += 1 if yi == (imgarr.shape[0]//2): break yy += 1 else: if trail_frac < trailcutfrac: Loading @@ -363,8 +367,12 @@ def MakeTrail(imgarr, satuyxtuple, charge, fullwell=9e4, direction='up', trailcu if direction == 'up': yi -= 1 if yi == (imgarr.shape[0]//2 - 1): break elif direction == 'down': yi += 1 if yi == (imgarr.shape[0]//2): break yy += 1 return imgarr Loading observation_sim/mock_objects/CatalogBase.py +3 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,9 @@ class CatalogBase(metaclass=ABCMeta): def __init__(self): pass def free_mem(self, **kward): pass @abstractmethod def load_sed(self, obj, **kward): pass Loading observation_sim/sim_steps/add_objects.py +3 −3 Original line number Diff line number Diff line Loading @@ -102,6 +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): Loading Loading @@ -133,7 +134,6 @@ def add_objects(self, chip, filt, tel, pointing, catalog, obs_param): continue # [TODO] Testing # print(obj.param["mag_%s" % filt.filter_type.lower()], obj.param["mag_%s" % cut_filter.filter_type.lower()]) # self.chip_output.Log_info("mag_%s = %.3f"%(filt.filter_type.lower(), obj.param["mag_%s"%filt.filter_type.lower()])) # Exclude very bright/dim objects (for now) Loading Loading @@ -242,8 +242,8 @@ def add_objects(self, chip, filt, tel, pointing, catalog, obs_param): obj.unload_SED() del obj # gc.collect() cat.starDDL.freeGlobeData() del cat.starDDL cat.free_mem del cat if chip.survey_type == "spectroscopic" and not self.overall_config["run_option"]["out_cat_only"] and chip.slsPSFOptim: # from observation_sim.instruments.chip import chip_utils as chip_utils Loading Loading
catalog/C9_Catalog.py +4 −0 Original line number Diff line number Diff line Loading @@ -469,6 +469,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 Loading
observation_sim/instruments/chip/effects.py +9 −1 Original line number Diff line number Diff line Loading @@ -84,7 +84,7 @@ def BadColumns(GSImage, seed=20240309, chipid=1, logger=None): rgdn = Generator(PCG64(int(seed*1.3))) nbadsecA, nbadsecD = rgn.integers(low=1, high=5, size=2) collen = rgcollen.integers(low=int(ysize*0.1), high=int(ysize*0.7), size=(nbadsecA+nbadsecD)) collen = rgcollen.integers(low=int(ysize*0.1), high=int(ysize*0.5), size=(nbadsecA+nbadsecD)) xposit = rgxpos.integers(low=int(xsize*0.05), high=int(xsize*0.95), size=(nbadsecA+nbadsecD)) if logger is not None: logger.info(xposit+1) Loading Loading @@ -350,8 +350,12 @@ def MakeTrail(imgarr, satuyxtuple, charge, fullwell=9e4, direction='up', trailcu imgarr[yi, xi] = fullwell if direction == 'up': yi -= 1 if yi == (imgarr.shape[0]//2 - 1): break elif direction == 'down': yi += 1 if yi == (imgarr.shape[0]//2): break yy += 1 else: if trail_frac < trailcutfrac: Loading @@ -363,8 +367,12 @@ def MakeTrail(imgarr, satuyxtuple, charge, fullwell=9e4, direction='up', trailcu if direction == 'up': yi -= 1 if yi == (imgarr.shape[0]//2 - 1): break elif direction == 'down': yi += 1 if yi == (imgarr.shape[0]//2): break yy += 1 return imgarr Loading
observation_sim/mock_objects/CatalogBase.py +3 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,9 @@ class CatalogBase(metaclass=ABCMeta): def __init__(self): pass def free_mem(self, **kward): pass @abstractmethod def load_sed(self, obj, **kward): pass Loading
observation_sim/sim_steps/add_objects.py +3 −3 Original line number Diff line number Diff line Loading @@ -102,6 +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): Loading Loading @@ -133,7 +134,6 @@ def add_objects(self, chip, filt, tel, pointing, catalog, obs_param): continue # [TODO] Testing # print(obj.param["mag_%s" % filt.filter_type.lower()], obj.param["mag_%s" % cut_filter.filter_type.lower()]) # self.chip_output.Log_info("mag_%s = %.3f"%(filt.filter_type.lower(), obj.param["mag_%s"%filt.filter_type.lower()])) # Exclude very bright/dim objects (for now) Loading Loading @@ -242,8 +242,8 @@ def add_objects(self, chip, filt, tel, pointing, catalog, obs_param): obj.unload_SED() del obj # gc.collect() cat.starDDL.freeGlobeData() del cat.starDDL cat.free_mem del cat if chip.survey_type == "spectroscopic" and not self.overall_config["run_option"]["out_cat_only"] and chip.slsPSFOptim: # from observation_sim.instruments.chip import chip_utils as chip_utils Loading