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):
param['dec'] = dec_arr[igals]
param['ra_orig'] = gals['ra'][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]
if self.filt.filter_type == 'NUV':
param['mag_use_normal'] = gals['mag_csst_nuv'][igals]
......@@ -275,29 +279,31 @@ class Catalog(CatalogBase):
param['av'] = 0.0
param['redden'] = 0
# TEMP
self.ids += 1
param['id'] = '%06d'%(int(pix_id)) + '%06d'%(cat_id) + '%08d'%(igals)
# Is this an Quasar?
param['qsoindex'] = gals['qsoindex'][igals]
if param['qsoindex'] == -1:
param['star'] = 0 # Galaxy
param['agnsed_file'] = ""
obj = Galaxy(param, logger=self.logger)
else:
param['star'] = 2 # Quasar
param['agnsed_file'] = agnsed_file
# 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:
# First add QSO model
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.,
param['bulgemass'], param['diskmass'], param['detA'],
param['e1'], param['e2'], param['kappa'], param['g1'], param['g2'], param['size'],
......
......@@ -72,7 +72,7 @@ class Pointing(object):
# Load the configuration file for this particular pointing
# [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:
try:
self.obs_param = yaml.safe_load(stream)
......
......@@ -10,9 +10,9 @@
# Base diretories and naming setup
# can add some of the command-line arguments here as well;
# ok to pass either way or both, as long as they are consistent
work_dir: "/share/home/fangyuedong/20231211/workplace/"
data_dir: "/share/simudata/CSSOSDataProductsSims/data/"
run_name: "test_new_config"
work_dir: "/public/home/fangyuedong/project/workplace/"
data_dir: "/public/share/yangxuliu/CSSOSDataProductsSims/data_50sqDeg/"
run_name: "QSO_50sqdeg_test"
# Project cycle and run counter are used to name the outputs
project_cycle: 6
......@@ -37,22 +37,23 @@ run_option:
# in the corresponding (user defined) 'Catalog' class
catalog_options:
input_path:
cat_dir: "Catalog_C6_20221212"
star_cat: "C6_MMW_GGC_Astrometry_healpix.hdf5"
galaxy_cat: "cat2CSSTSim_bundle/"
AGN_cat: "AGN_C6_ross13_rand_pos_rmax-1.3.fits"
# cat_dir: "Catalog_C6_20221212"
cat_dir: ""
star_cat: "starcat/"
galaxy_cat: "qsocat/cat2CSSTSim_bundle-50sqDeg/"
# AGN_cat: "AGN_C6_ross13_rand_pos_rmax-1.3.fits"
SED_templates_path:
star_SED: "Catalog_20210126/SpecLib.hdf5"
galaxy_SED: "Catalog_C6_20221212/sedlibs/"
AGN_SED: "quickspeclib_ross13.fits"
AGN_SED_WAVE: "wave_ross13.npy"
star_SED: "SpecLib.hdf5"
galaxy_SED: "sedlibs/"
AGN_SED: "qsocat/qsosed/"
# AGN_SED_WAVE: "wave_ross13.npy"
# Only simulate stars?
star_only: NO
# Only simulate galaxies?
galaxy_only: NO
galaxy_only: YES
# rotate galaxy ellipticity
rotateEll: 0. # [degree]
......@@ -67,8 +68,8 @@ obs_setting:
# if you just want to run default pointing:
# - pointing_dir: null
# - pointing_file: null
pointing_dir: "/share/simudata/CSSOSDataProductsSims/data/"
pointing_file: "pointing_radec_246.5_40.dat"
pointing_dir: "/public/share/yangxuliu/CSSOSDataProductsSims/data_50sqDeg"
pointing_file: "pointing_50_combined.dat"
# Run specific pointing(s):
# - give a list of indexes of pointings: [ip_1, ip_2...]
......@@ -107,7 +108,7 @@ psf_setting:
# path to PSF data
# NOTE: only valid for "Interp" PSF
# 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_sls_dir: "/share/simudata/CSSOSDataProductsSims/data/SLS_PSF_PCA_fp/"
......
......@@ -12,7 +12,8 @@
obs_type: "SCIE"
# 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
call_sequence:
......
......@@ -2,10 +2,10 @@
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 \
--catalog C6_Catalog \
-c /share/home/fangyuedong/20231211/csst-simulation/config
--catalog C6_50sqdeg \
-c /public/home/fangyuedong/project/csst-simulation/config
# python3 /share/home/fangyuedong/20231211/csst-simulation/run_sim.py \
# --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