Commit 7e5ae118 authored by Wei Chengliang's avatar Wei Chengliang
Browse files

grid galaxy for wcs_test

parent f5cf292a
...@@ -138,11 +138,11 @@ class Galaxy(MockObject): ...@@ -138,11 +138,11 @@ class Galaxy(MockObject):
real_wcs_local = self.real_wcs.local(self.real_pos) real_wcs_local = self.real_wcs.local(self.real_pos)
disk = galsim.Sersic(n=self.disk_sersic_idx, half_light_radius=self.hlr_disk, flux=1.0, gsparams=gsp) disk = galsim.Sersic(n=self.disk_sersic_idx, half_light_radius=self.hlr_disk, flux=1.0, gsparams=gsp)
disk_shape = galsim.Shear(g1=self.e1_disk, g2=self.e2_disk) ###disk_shape = galsim.Shear(g1=self.e1_disk, g2=self.e2_disk)
disk = disk.shear(disk_shape) ###disk = disk.shear(disk_shape)
bulge = galsim.Sersic(n=self.bulge_sersic_idx, half_light_radius=self.hlr_bulge, flux=1.0, gsparams=gsp) bulge = galsim.Sersic(n=self.bulge_sersic_idx, half_light_radius=self.hlr_bulge, flux=1.0, gsparams=gsp)
bulge_shape = galsim.Shear(g1=self.e1_bulge, g2=self.e2_bulge) ###bulge_shape = galsim.Shear(g1=self.e1_bulge, g2=self.e2_bulge)
bulge = bulge.shear(bulge_shape) ###bulge = bulge.shear(bulge_shape)
for i in range(len(bandpass_list)): for i in range(len(bandpass_list)):
bandpass = bandpass_list[i] bandpass = bandpass_list[i]
......
...@@ -116,7 +116,7 @@ class Observation(object): ...@@ -116,7 +116,7 @@ class Observation(object):
chip_output.Log_info(filt.sky_background) chip_output.Log_info(filt.sky_background)
# [TODO] [TEST] # [TODO] [TEST]
return #return
if chip.survey_type == "photometric": if chip.survey_type == "photometric":
sky_map = None sky_map = None
...@@ -195,11 +195,16 @@ class Observation(object): ...@@ -195,11 +195,16 @@ class Observation(object):
chip_wcs = galsim.FitsWCS(header=h_ext) chip_wcs = galsim.FitsWCS(header=h_ext)
nnn = 30
NNObj = nnn*nnn #484 ###
tt = 0
for j in range(self.nobj): for j in range(self.nobj):
# (DEBUG) # (DEBUG)
# if j >= 10: # if j >= 10:
# break # break
if NNObj == 0:
continue
obj = self.cat.objs[j] obj = self.cat.objs[j]
...@@ -258,6 +263,20 @@ class Observation(object): ...@@ -258,6 +263,20 @@ class Observation(object):
# Get position of object on the focal plane # Get position of object on the focal plane
pos_img, offset, local_wcs, real_wcs, fd_shear = obj.getPosImg_Offset_WCS(img=chip.img, fdmodel=self.fd_model, chip=chip, verbose=False, chip_wcs=chip_wcs, img_header=h_ext) pos_img, offset, local_wcs, real_wcs, fd_shear = obj.getPosImg_Offset_WCS(img=chip.img, fdmodel=self.fd_model, chip=chip, verbose=False, chip_wcs=chip_wcs, img_header=h_ext)
### set pos_img
if True:
ngal_x = nnn #22 #sampling ngal_x*ngal_y position on current CCD-chip
ngal_y = nnn #22
xmin = chip.bound.xmin +256
ymin = chip.bound.ymin +256
jj = NNObj-1 ###np.random.randint(int(ngal_x*ngal_y)) #set position for galaxy-jj
iy = int(jj / ngal_x)
ix = int(jj - iy*ngal_x)
px = xmin + ix*int((chip.npix_x - 512)/ngal_x)
py = ymin + iy*int((chip.npix_y - 512)/ngal_y)
pos_img.x = px
pos_img.y = py
# [TODO] For now, only consider objects which their centers (after field distortion) are projected within the focal plane # [TODO] For now, only consider objects which their centers (after field distortion) are projected within the focal plane
# Otherwise they will be considered missed objects # Otherwise they will be considered missed objects
# if pos_img.x == -1 or pos_img.y == -1 or (not chip.isContainObj(x_image=pos_img.x, y_image=pos_img.y, margin=0.)): # if pos_img.x == -1 or pos_img.y == -1 or (not chip.isContainObj(x_image=pos_img.x, y_image=pos_img.y, margin=0.)):
...@@ -304,6 +323,7 @@ class Observation(object): ...@@ -304,6 +323,7 @@ class Observation(object):
if isUpdated == 1: if isUpdated == 1:
# TODO: add up stats # TODO: add up stats
chip_output.cat_add_obj(obj, pos_img, pos_shear) chip_output.cat_add_obj(obj, pos_img, pos_shear)
NNObj = NNObj-1 ###
pass pass
elif isUpdated == 0: elif isUpdated == 0:
missed_obj += 1 missed_obj += 1
......
...@@ -9,10 +9,9 @@ ...@@ -9,10 +9,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/csst-simulation/workplace/" work_dir: "/share/simudata/CSSOSDataProductsSims/data/CSSTSimImage_C6/"
data_dir: "/share/simudata/CSSOSDataProductsSims/data/" data_dir: "/share/simudata/CSSOSDataProductsSims/data/"
run_name: "C6_test" run_name: "C6_wcs_test1"
run_name: "C6_test"
# Whether to use MPI # Whether to use MPI
run_option: run_option:
...@@ -48,7 +47,7 @@ catalog_options: ...@@ -48,7 +47,7 @@ catalog_options:
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]
...@@ -95,20 +94,21 @@ obs_setting: ...@@ -95,20 +94,21 @@ 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: [0,1,2,3,4] run_pointings: [0,1,2,3,4,5,6,7,8,9]
#run_pointings: [0,1,2,3,4,5]
# 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...]
# - run all chips: null # - run all chips: null
# Note: for all pointings # Note: for all pointings
run_chips: null run_chips: [8, 23]
run_chips: null #run_chips: null
# Whether to enable astrometric modeling # Whether to enable astrometric modeling
enable_astrometric_model: True enable_astrometric_model: False
# Whether to enable straylight model # Whether to enable straylight model
enable_straylight_model: True enable_straylight_model: False
# Cut by saturation magnitude in which band? # Cut by saturation magnitude in which band?
cut_in_band: "z" cut_in_band: "z"
...@@ -127,7 +127,7 @@ psf_setting: ...@@ -127,7 +127,7 @@ psf_setting:
# Which PSF model to use: # Which PSF model to use:
# "Gauss": simple gaussian profile # "Gauss": simple gaussian profile
# "Interp": Interpolated PSF from sampled ray-tracing data # "Interp": Interpolated PSF from sampled ray-tracing data
psf_model: "Interp" psf_model: "Gauss"
# PSF size [arcseconds] # PSF size [arcseconds]
# radius of 80% energy encircled # radius of 80% energy encircled
...@@ -149,8 +149,8 @@ shear_setting: ...@@ -149,8 +149,8 @@ shear_setting:
shear_type: "catalog" shear_type: "catalog"
# For constant shear filed # For constant shear filed
reduced_g1: 0. reduced_g1: -0.02
reduced_g2: 0. reduced_g2: -0.04
############################################### ###############################################
# Instrumental effects setting # Instrumental effects setting
...@@ -159,25 +159,25 @@ ins_effects: ...@@ -159,25 +159,25 @@ ins_effects:
# switches # switches
# Note: bias_16channel, gain_16channel, and shutter_effect # Note: bias_16channel, gain_16channel, and shutter_effect
# is currently not applicable to "FGS" observations # is currently not applicable to "FGS" observations
field_dist: YES # Whether to add field distortions field_dist: NO # Whether to add field distortions
add_back: YES # Whether to add sky background add_back: NO # Whether to add sky background
add_dark: YES # Whether to add dark noise add_dark: NO # Whether to add dark noise
add_readout: YES # Whether to add read-out (Gaussian) noise add_readout: NO # Whether to add read-out (Gaussian) noise
add_bias: YES # Whether to add bias-level to images add_bias: NO # Whether to add bias-level to images
bias_16channel: YES # Whether to add different biases for 16 channels bias_16channel: NO # Whether to add different biases for 16 channels
gain_16channel: YES # Whether to make different gains for 16 channels gain_16channel: NO # Whether to make different gains for 16 channels
shutter_effect: YES # Whether to add shutter effect shutter_effect: NO # Whether to add shutter effect
flat_fielding: YES # Whether to add flat-fielding effect flat_fielding: NO # Whether to add flat-fielding effect
prnu_effect: YES # Whether to add PRNU effect prnu_effect: NO # Whether to add PRNU effect
non_linear: YES # Whether to add non-linearity non_linear: NO # Whether to add non-linearity
cosmic_ray: YES # Whether to add cosmic-ray cosmic_ray: NO # Whether to add cosmic-ray
cray_differ: YES # Whether to generate different cosmic ray maps CAL and MS output cray_differ: NO # Whether to generate different cosmic ray maps CAL and MS output
cte_trail: YES # Whether to simulate CTE trails cte_trail: NO # Whether to simulate CTE trails
saturbloom: YES # Whether to simulate Saturation & Blooming saturbloom: NO # Whether to simulate Saturation & Blooming
add_badcolumns: YES # Whether to add bad columns add_badcolumns: NO # Whether to add bad columns
add_hotpixels: YES # Whether to add hot pixels add_hotpixels: NO # Whether to add hot pixels
add_deadpixels: YES # Whether to add dead(dark) pixels add_deadpixels: NO # Whether to add dead(dark) pixels
bright_fatter: YES # Whether to simulate Brighter-Fatter (also diffusion) effect bright_fatter: NO # Whether to simulate Brighter-Fatter (also diffusion) effect
# Values: # Values:
# default values have been defined individually for each chip in: # default values have been defined individually for each chip in:
...@@ -219,4 +219,4 @@ random_seeds: ...@@ -219,4 +219,4 @@ random_seeds:
seed_badcolumns: 20240309 # Seed for bad columns seed_badcolumns: 20240309 # Seed for bad columns
seed_defective: 20210304 # Seed for defective (bad) pixels seed_defective: 20210304 # Seed for defective (bad) pixels
seed_readout: 20210601 # Seed for read-out gaussian noise seed_readout: 20210601 # Seed for read-out gaussian noise
... ...
\ No newline at end of file
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