Commit d15cfcc8 authored by Fang Yuedong's avatar Fang Yuedong
Browse files

add try-except block when reading healpix

parent 7d24b403
Loading
Loading
Loading
Loading
+14 −6
Original line number Diff line number Diff line
@@ -257,15 +257,23 @@ class NGPCatalog(CatalogBase):
        if "star_cat" in self.config["input_path"] and self.config["input_path"]["star_cat"] and not self.config["run_option"]["galaxy_only"]:
            star_cat = h5.File(self.star_path, 'r')['catalog']
            for pix in self.pix_list:
                try:
                    stars = star_cat[str(pix)]
                    self._load_stars(stars, pix_id=pix)
                    del stars
                except Exception as e:
                    self.logger.error(str(e))
                    print(e)
        if "galaxy_cat" in self.config["input_path"] and self.config["input_path"]["galaxy_cat"] and not self.config["run_option"]["star_only"]:
            gals_cat = h5.File(self.galaxy_path, 'r')['galaxies']
            for pix in self.pix_list:
                try:
                    gals = gals_cat[str(pix)]
                    self._load_gals(gals, pix_id=pix)
                    del gals
                except Exception as e:
                    self.logger.error(str(e))
                    print(e)
        if self.logger is not None:
            self.logger.info("number of objects in catalog: %d"%(len(self.objs)))
        else:
+4 −4
Original line number Diff line number Diff line
@@ -12,14 +12,14 @@
# work_dir: "/public/home/fangyuedong/sim_code_release/CSST/test/"
work_dir: "/public/home/fangyuedong/temp/CSST/workplace/"
data_dir: "/data/simudata/CSSOSDataProductsSims/data/"
run_name: "NGP_test"
run_name: "NGP_Astrometry-on"

# (Optional) a file of point list 
# if you just want to run default pointing:
# - pointing_dir: null
# - pointing_file: null
pointing_dir: "/data/simudata/CSSOSDataProductsSims/data/"
pointing_file: "pointing_test_NGP_3.dat"
pointing_file: "pointing_test_NGP_2.17.dat"

# Whether to use MPI
run_option:
@@ -34,7 +34,7 @@ run_option:
  out_cat_only: NO

  # Only simulate stars?
  star_only: YES
  star_only: NO

  # Only simulate galaxies?
  galaxy_only: NO
@@ -73,7 +73,7 @@ obs_setting:
  # - give a list of indexes of pointings: [ip_1, ip_2...]
  # - run all pointings: null
  # Note: only valid when a pointing list is specified
  run_pointings: [1]
  run_pointings: [ 5,  7, 11, 14, 19, 60, 70, 82, 88]
  
  # Run specific chip(s):
  # - give a list of indexes of chips: [ip_1, ip_2...]