Loading Catalog/C3Catalog.py +14 −11 Original line number Diff line number Diff line Loading @@ -30,13 +30,13 @@ class C3Catalog(CatalogBase): self.chip = chip self.pointing = pointing if "star_cat" in config["input_path"] and config["input_path"]["star_cat"]: if "star_cat" in config["input_path"] and config["input_path"]["star_cat"] and not config["galaxy_only"]: star_file = config["input_path"]["star_cat"] star_SED_file = config["SED_templates_path"]["star_SED"] self.star_path = os.path.join(self.cat_dir, star_file) self.star_SED_path = os.path.join(config["data_dir"], star_SED_file) self._load_SED_lib_star() if "galaxy_cat" in config["input_path"] and config["input_path"]["galaxy_cat"]: if "galaxy_cat" in config["input_path"] and config["input_path"]["galaxy_cat"] and not config["star_only"]: galaxy_file = config["input_path"]["galaxy_cat"] self.galaxy_path = os.path.join(self.cat_dir, galaxy_file) self.galaxy_SED_path = os.path.join(config["data_dir"], config["SED_templates_path"]["galaxy_SED"]) Loading Loading @@ -190,17 +190,20 @@ class C3Catalog(CatalogBase): def _load(self, **kwargs): self.nav = 15005 self.avGal = extAv(self.nav, seed=self.seed_Av) gals_cat = h5.File(self.galaxy_path, 'r')['galaxies'] star_cat = h5.File(self.star_path, 'r')['catalog'] self.objs = [] self.ids = 0 if "star_cat" in self.config["input_path"] and self.config["input_path"]["star_cat"] and not self.config["galaxy_only"]: star_cat = h5.File(self.star_path, 'r')['catalog'] for pix in self.pix_list: gals = gals_cat[str(pix)] stars = star_cat[str(pix)] self._load_gals(gals, pix_id=pix) self._load_stars(stars, pix_id=pix) del gals del stars if "galaxy_cat" in self.config["input_path"] and self.config["input_path"]["galaxy_cat"] and not self.config["star_only"]: gals_cat = h5.File(self.galaxy_path, 'r')['galaxies'] for pix in self.pix_list: gals = gals_cat[str(pix)] self._load_gals(gals, pix_id=pix) del gals print("number of objects in catalog: ", len(self.objs)) del self.avGal Loading Loading
Catalog/C3Catalog.py +14 −11 Original line number Diff line number Diff line Loading @@ -30,13 +30,13 @@ class C3Catalog(CatalogBase): self.chip = chip self.pointing = pointing if "star_cat" in config["input_path"] and config["input_path"]["star_cat"]: if "star_cat" in config["input_path"] and config["input_path"]["star_cat"] and not config["galaxy_only"]: star_file = config["input_path"]["star_cat"] star_SED_file = config["SED_templates_path"]["star_SED"] self.star_path = os.path.join(self.cat_dir, star_file) self.star_SED_path = os.path.join(config["data_dir"], star_SED_file) self._load_SED_lib_star() if "galaxy_cat" in config["input_path"] and config["input_path"]["galaxy_cat"]: if "galaxy_cat" in config["input_path"] and config["input_path"]["galaxy_cat"] and not config["star_only"]: galaxy_file = config["input_path"]["galaxy_cat"] self.galaxy_path = os.path.join(self.cat_dir, galaxy_file) self.galaxy_SED_path = os.path.join(config["data_dir"], config["SED_templates_path"]["galaxy_SED"]) Loading Loading @@ -190,17 +190,20 @@ class C3Catalog(CatalogBase): def _load(self, **kwargs): self.nav = 15005 self.avGal = extAv(self.nav, seed=self.seed_Av) gals_cat = h5.File(self.galaxy_path, 'r')['galaxies'] star_cat = h5.File(self.star_path, 'r')['catalog'] self.objs = [] self.ids = 0 if "star_cat" in self.config["input_path"] and self.config["input_path"]["star_cat"] and not self.config["galaxy_only"]: star_cat = h5.File(self.star_path, 'r')['catalog'] for pix in self.pix_list: gals = gals_cat[str(pix)] stars = star_cat[str(pix)] self._load_gals(gals, pix_id=pix) self._load_stars(stars, pix_id=pix) del gals del stars if "galaxy_cat" in self.config["input_path"] and self.config["input_path"]["galaxy_cat"] and not self.config["star_only"]: gals_cat = h5.File(self.galaxy_path, 'r')['galaxies'] for pix in self.pix_list: gals = gals_cat[str(pix)] self._load_gals(gals, pix_id=pix) del gals print("number of objects in catalog: ", len(self.objs)) del self.avGal Loading