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

add try-except block when reading healpix

parent 7d24b403
...@@ -257,15 +257,23 @@ class NGPCatalog(CatalogBase): ...@@ -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"]: 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'] star_cat = h5.File(self.star_path, 'r')['catalog']
for pix in self.pix_list: for pix in self.pix_list:
try:
stars = star_cat[str(pix)] stars = star_cat[str(pix)]
self._load_stars(stars, pix_id=pix) self._load_stars(stars, pix_id=pix)
del stars 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"]: 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'] gals_cat = h5.File(self.galaxy_path, 'r')['galaxies']
for pix in self.pix_list: for pix in self.pix_list:
try:
gals = gals_cat[str(pix)] gals = gals_cat[str(pix)]
self._load_gals(gals, pix_id=pix) self._load_gals(gals, pix_id=pix)
del gals del gals
except Exception as e:
self.logger.error(str(e))
print(e)
if self.logger is not None: if self.logger is not None:
self.logger.info("number of objects in catalog: %d"%(len(self.objs))) self.logger.info("number of objects in catalog: %d"%(len(self.objs)))
else: else:
......
...@@ -12,14 +12,14 @@ ...@@ -12,14 +12,14 @@
# work_dir: "/public/home/fangyuedong/sim_code_release/CSST/test/" # work_dir: "/public/home/fangyuedong/sim_code_release/CSST/test/"
work_dir: "/public/home/fangyuedong/temp/CSST/workplace/" work_dir: "/public/home/fangyuedong/temp/CSST/workplace/"
data_dir: "/data/simudata/CSSOSDataProductsSims/data/" data_dir: "/data/simudata/CSSOSDataProductsSims/data/"
run_name: "NGP_test" run_name: "NGP_Astrometry-on"
# (Optional) a file of point list # (Optional) a file of point list
# if you just want to run default pointing: # if you just want to run default pointing:
# - pointing_dir: null # - pointing_dir: null
# - pointing_file: null # - pointing_file: null
pointing_dir: "/data/simudata/CSSOSDataProductsSims/data/" 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 # Whether to use MPI
run_option: run_option:
...@@ -34,7 +34,7 @@ run_option: ...@@ -34,7 +34,7 @@ run_option:
out_cat_only: NO out_cat_only: NO
# Only simulate stars? # Only simulate stars?
star_only: YES star_only: NO
# Only simulate galaxies? # Only simulate galaxies?
galaxy_only: NO galaxy_only: NO
...@@ -73,7 +73,7 @@ obs_setting: ...@@ -73,7 +73,7 @@ obs_setting:
# - give a list of indexes of pointings: [ip_1, ip_2...] # - give a list of indexes of pointings: [ip_1, ip_2...]
# - run all pointings: null # - run all pointings: null
# Note: only valid when a pointing list is specified # 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): # Run specific chip(s):
# - give a list of indexes of chips: [ip_1, ip_2...] # - give a list of indexes of chips: [ip_1, ip_2...]
......
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