Commit 524d234b authored by Fang Yuedong's avatar Fang Yuedong
Browse files

fix missing host galaxy problem for QSOs in C6_50sqdeg catalog

parent a1f3a951
...@@ -204,6 +204,10 @@ class Catalog(CatalogBase): ...@@ -204,6 +204,10 @@ class Catalog(CatalogBase):
param['dec'] = dec_arr[igals] param['dec'] = dec_arr[igals]
param['ra_orig'] = gals['ra'][igals] param['ra_orig'] = gals['ra'][igals]
param['dec_orig'] = gals['dec'][igals] param['dec_orig'] = gals['dec'][igals]
if not self.chip.isContainObj(ra_obj=param['ra'], dec_obj=param['dec'], margin=200):
continue
# param['mag_use_normal'] = gals['mag_csst_%s'%(self.filt.filter_type)][igals] # param['mag_use_normal'] = gals['mag_csst_%s'%(self.filt.filter_type)][igals]
if self.filt.filter_type == 'NUV': if self.filt.filter_type == 'NUV':
param['mag_use_normal'] = gals['mag_csst_nuv'][igals] param['mag_use_normal'] = gals['mag_csst_nuv'][igals]
...@@ -275,29 +279,31 @@ class Catalog(CatalogBase): ...@@ -275,29 +279,31 @@ class Catalog(CatalogBase):
param['av'] = 0.0 param['av'] = 0.0
param['redden'] = 0 param['redden'] = 0
# TEMP
self.ids += 1
param['id'] = '%06d'%(int(pix_id)) + '%06d'%(cat_id) + '%08d'%(igals)
# Is this an Quasar? # Is this an Quasar?
param['qsoindex'] = gals['qsoindex'][igals] param['qsoindex'] = gals['qsoindex'][igals]
if param['qsoindex'] == -1: if param['qsoindex'] == -1:
param['star'] = 0 # Galaxy param['star'] = 0 # Galaxy
param['agnsed_file'] = "" param['agnsed_file'] = ""
obj = Galaxy(param, logger=self.logger)
else: else:
param['star'] = 2 # Quasar param['star'] = 2 # Quasar
param['agnsed_file'] = agnsed_file param['agnsed_file'] = agnsed_file
# First add QSO model
# NOTE: this cut cannot be put before the SED type has been assigned
if not self.chip.isContainObj(ra_obj=param['ra'], dec_obj=param['dec'], margin=200):
continue
# TEMP
self.ids += 1
param['id'] = '%06d'%(int(pix_id)) + '%06d'%(cat_id) + '%08d'%(igals)
if param['star'] == 0:
obj = Galaxy(param, logger=self.logger)
elif param['star'] == 2:
obj = Quasar(param, logger=self.logger) obj = Quasar(param, logger=self.logger)
# Need to deal with additional output columns
obj.additional_output_str = self.add_fmt%("n", 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0, 0.)
self.objs.append(obj)
# Then add host galaxy model
param['star'] = 0 # Galaxy
param['agnsed_file'] = ""
obj = Galaxy(param, logger=self.logger)
# Need to deal with additional output columns # Need to deal with additional output columns for (host) galaxy
obj.additional_output_str = self.add_fmt%("n", 0., 0., 0., obj.additional_output_str = self.add_fmt%("n", 0., 0., 0.,
param['bulgemass'], param['diskmass'], param['detA'], param['bulgemass'], param['diskmass'], param['detA'],
param['e1'], param['e2'], param['kappa'], param['g1'], param['g2'], param['size'], param['e1'], param['e2'], param['kappa'], param['g1'], param['g2'], param['size'],
......
...@@ -72,7 +72,7 @@ class Pointing(object): ...@@ -72,7 +72,7 @@ class Pointing(object):
# Load the configuration file for this particular pointing # Load the configuration file for this particular pointing
# [TODO] # [TODO]
self.obs_config_file = "/share/home/fangyuedong/20231211/csst-simulation/config/obs_config_SCI_WIDE_phot.yaml" self.obs_config_file = "/public/home/fangyuedong/project/csst-simulation/config/obs_config_SCI_WIDE_phot.yaml"
with open(self.obs_config_file, "r") as stream: with open(self.obs_config_file, "r") as stream:
try: try:
self.obs_param = yaml.safe_load(stream) self.obs_param = yaml.safe_load(stream)
......
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
# Base diretories and naming setup # Base diretories and naming setup
# can add some of the command-line arguments here as well; # can add some of the command-line arguments here as well;
# ok to pass either way or both, as long as they are consistent # ok to pass either way or both, as long as they are consistent
work_dir: "/share/home/fangyuedong/20231211/workplace/" work_dir: "/public/home/fangyuedong/project/workplace/"
data_dir: "/share/simudata/CSSOSDataProductsSims/data/" data_dir: "/public/share/yangxuliu/CSSOSDataProductsSims/data_50sqDeg/"
run_name: "test_new_config" run_name: "QSO_50sqdeg_test"
# Project cycle and run counter are used to name the outputs # Project cycle and run counter are used to name the outputs
project_cycle: 6 project_cycle: 6
...@@ -37,22 +37,23 @@ run_option: ...@@ -37,22 +37,23 @@ run_option:
# in the corresponding (user defined) 'Catalog' class # in the corresponding (user defined) 'Catalog' class
catalog_options: catalog_options:
input_path: input_path:
cat_dir: "Catalog_C6_20221212" # cat_dir: "Catalog_C6_20221212"
star_cat: "C6_MMW_GGC_Astrometry_healpix.hdf5" cat_dir: ""
galaxy_cat: "cat2CSSTSim_bundle/" star_cat: "starcat/"
AGN_cat: "AGN_C6_ross13_rand_pos_rmax-1.3.fits" galaxy_cat: "qsocat/cat2CSSTSim_bundle-50sqDeg/"
# AGN_cat: "AGN_C6_ross13_rand_pos_rmax-1.3.fits"
SED_templates_path: SED_templates_path:
star_SED: "Catalog_20210126/SpecLib.hdf5" star_SED: "SpecLib.hdf5"
galaxy_SED: "Catalog_C6_20221212/sedlibs/" galaxy_SED: "sedlibs/"
AGN_SED: "quickspeclib_ross13.fits" AGN_SED: "qsocat/qsosed/"
AGN_SED_WAVE: "wave_ross13.npy" # AGN_SED_WAVE: "wave_ross13.npy"
# Only simulate stars? # Only simulate stars?
star_only: NO star_only: NO
# Only simulate galaxies? # Only simulate galaxies?
galaxy_only: NO galaxy_only: YES
# rotate galaxy ellipticity # rotate galaxy ellipticity
rotateEll: 0. # [degree] rotateEll: 0. # [degree]
...@@ -67,8 +68,8 @@ obs_setting: ...@@ -67,8 +68,8 @@ obs_setting:
# 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: "/share/simudata/CSSOSDataProductsSims/data/" pointing_dir: "/public/share/yangxuliu/CSSOSDataProductsSims/data_50sqDeg"
pointing_file: "pointing_radec_246.5_40.dat" pointing_file: "pointing_50_combined.dat"
# Run specific pointing(s): # Run specific pointing(s):
# - give a list of indexes of pointings: [ip_1, ip_2...] # - give a list of indexes of pointings: [ip_1, ip_2...]
...@@ -107,7 +108,7 @@ psf_setting: ...@@ -107,7 +108,7 @@ psf_setting:
# path to PSF data # path to PSF data
# NOTE: only valid for "Interp" PSF # NOTE: only valid for "Interp" PSF
# PSF models for photometry survey simulation # PSF models for photometry survey simulation
psf_pho_dir: "/share/simudata/CSSOSDataProductsSims/data/psfCube1" psf_pho_dir: "/public/share/yangxuliu/CSSOSDataProductsSims/dataC6/psfCube1"
# PSF models for slitless spectrum survey simulation # PSF models for slitless spectrum survey simulation
psf_sls_dir: "/share/simudata/CSSOSDataProductsSims/data/SLS_PSF_PCA_fp/" psf_sls_dir: "/share/simudata/CSSOSDataProductsSims/data/SLS_PSF_PCA_fp/"
......
...@@ -12,7 +12,8 @@ ...@@ -12,7 +12,8 @@
obs_type: "SCIE" obs_type: "SCIE"
# Define list of chips # Define list of chips
run_chips: [6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 23, 24, 25] # run_chips: [6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 23, 24, 25]
run_chips: [6]
# Define observation sequence # Define observation sequence
call_sequence: call_sequence:
......
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
date date
python3 /share/home/fangyuedong/20231211/csst-simulation/run_sim.py \ python3 /public/home/fangyuedong/project/csst-simulation/run_sim.py \
--config_file config_overall.yaml \ --config_file config_overall.yaml \
--catalog C6_Catalog \ --catalog C6_50sqdeg \
-c /share/home/fangyuedong/20231211/csst-simulation/config -c /public/home/fangyuedong/project/csst-simulation/config
# python3 /share/home/fangyuedong/20231211/csst-simulation/run_sim.py \ # python3 /share/home/fangyuedong/20231211/csst-simulation/run_sim.py \
# --config_file config_C6_dev.yaml \ # --config_file config_C6_dev.yaml \
......
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