Skip to content

Commit

Permalink
config
Browse files Browse the repository at this point in the history
  • Loading branch information
sidneymau committed Mar 25, 2024
1 parent ae7ae3e commit 3b07b0d
Showing 1 changed file with 257 additions and 0 deletions.
257 changes: 257 additions & 0 deletions configs/fiducial-debug-gsparams-test-v2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,257 @@
modules:
- galsim.des
- galsim_extra
- montara
- numpy

pipeline:
steps:
- galsim_montara
# - coadd_nwgint
# - swarp
# - src_extractor
# - desdm_meds
- pizza_cutter
- metadetect
# - fitvd
- delete_images
- delete_sources

fitvd:
conda_prefix: "/global/common/software/des/mambaforge/envs/des-y6-fitvd"
n_jobs: 128
det_band: "r"
bands: ["g", "r", "i", "z"]

galsim_montara: {}

delete_images:
delete_coadd: True
delete_se: True
delete_se_nwgint: True
delete_seg: True
save_tilenames: [DES0131-2458]

delete_sources:
save_tilenames: [DES0131-2458]

swarp:
coadd_bands: ["r", "i", "z"]

src_extractor: {}

coadd_nwgint:
n_jobs: 128
run_on_inputs: False

desdm_meds:
n_jobs: 128
use_nwgint: False

pizza_cutter:
n_jobs: 32 # more jobs leads to OOM errors
use_nwgint: False

metadetect:
n_jobs: 128 # don't hyperthread

eval_variables:
sstar_mag_col: &star_mag_col
type: FormattedStr
format: "%smag"
items:
- "$band"
sgal_mag_col: &gal_mag_col
type: FormattedStr
format: "mag_%s_dered"
items:
- "$band"
sz_col: &z_col "photoz"
ftruth_g:
type: List
items:
- 0.
- '$float((@gal.ellip).g)'
index: '@current_obj_type_index'
ftruth_beta:
type: List
items:
- 0.
- '$float((@gal.ellip).beta.rad)'
index: '@current_obj_type_index'
ftruth_rotate:
type: List
items:
- 0.
- '$float((@gal.rotate).rad)'
index: '@current_obj_type_index'

input:
# Use analytic galaxies with size and flux parameters that match the distribution seen
# in the COSMOS galaxies.
catalog_sampler:
file_name: /dvs_ro/cfs/cdirs/des/y3-image-sims/input_cosmos_v4.fits
cuts:
mag_i: [15., 25.] # use only 15<mag_i<25. for now.
isgal: [1,] # select galaxies only since we're simulating stars separately.
mask_flags: [0,] # apply mask flags
bdf_hlr: [0., 5.]
desstar:
file_name:
type: FormattedStr
format: /dvs_ro/cfs/projectdirs/des/atong/y6kp-shear/starsim/catalogs/merged_y6/%s.fits
items:
- "@output.tilename"
mag_i_max: 25.
mag_i_col: imag
des_piff:
file_name: "$piff_path"

image:
type: WideScattered
border: 15

# The number of objects across the full focal plane.
nobjects:
type: MixedNObjects
ngalaxies:
type: RandomPoisson
mean: "$170000 * (((@coadd_wcs).toWorld(galsim.PositionD(9750, 0)).ra.deg - (@coadd_wcs).toWorld(galsim.PositionD(250, 0)).ra.deg) * (math.cos((@coadd_wcs).toWorld(galsim.PositionD(0, 250)).dec.rad) - math.cos((@coadd_wcs).toWorld(galsim.PositionD(0, 9750)).dec.rad))) / ((ra_max_deg - ra_min_deg) * (math.cos(math.radians(dec_max_deg)) - math.cos(math.radians(dec_min_deg))))"
use_all_stars: True

#could read this from the image headers, but let's set them explicitly for now
xsize: 2048
ysize: 4096

world_pos:
type: RADec
ra:
type: Degrees
theta:
type: Eval
str: "ra_star if object_type_list[@obj_num-start_obj_num]=='star' else ra_gal"
# fra_gal: { type: Random, min: "$ra_min_deg", max: "$ra_max_deg" }
fra_gal:
type: Random
min: "$(@coadd_wcs).toWorld(galsim.PositionD(250, 0)).ra.deg"
max: "$(@coadd_wcs).toWorld(galsim.PositionD(9750, 0)).ra.deg"
fra_star: { type: DESStarValue, col: "ra" }
dec:
type: Degrees
theta:
type: Eval
str: "dec_star if object_type_list[@obj_num-start_obj_num]=='star' else math.degrees(dec_gal_radians)"
fdec_gal_radians:
type: RandomDistribution
function: "math.cos(x)" # Uniform on the sky means P(delta) ~ cos(delta)
# x_min: "$math.radians(dec_min_deg)"
# x_max: "$math.radians(dec_max_deg)"
x_min: "$(@coadd_wcs).toWorld(galsim.PositionD(0, 250)).dec.rad"
x_max: "$(@coadd_wcs).toWorld(galsim.PositionD(0, 9750)).dec.rad"
fdec_star: { type: DESStarValue, col: "dec" }

psf:
type: Gaussian
fwhm: 0.9

#No knots
gal:
type: Sum
items:
- type: Exponential
half_light_radius: { type: catalog_sampler_value, col: bdf_hlr }
flux: { type: Eval, str: "1-fracdev", ffracdev: { type: catalog_sampler_value, col: bdf_fracdev } }

- type: DeVaucouleurs
half_light_radius: '@gal.items.0.half_light_radius'
flux: "[email protected]"

ellip:
type: GBeta
g: { type: Eval, str: "np.sqrt(g1**2 + g2**2)", fg1: { type: catalog_sampler_value, col: bdf_g1 }, fg2: { type: catalog_sampler_value, col: bdf_g2 } }
beta: { type: Random }

rotate: {type: Random}

flux:
type: Eval
str: "10**(0.4*(mag_zp-mag))"
fmag: { type: catalog_sampler_value, col: *gal_mag_col }

gsparams:
folding_threshold: 1.0e-4
kvalue_accuracy: 1.0e-8
maxk_threshold: 1.0e-5

star:
type: Gaussian # Basically a delta function.
sigma: 1.e-6
flux:
type: Eval
str: "10**( 0.4 * (mag_zp - mag))"
fmag: { type: DESStarValue, col: *star_mag_col }

stamp:
type: CoaddMixedScene
objects:
# obj_type is specified, so these numbers aren't used
star: 1
gal: 1
obj_type: {type: Eval,
str: "object_type_list[i]",
ii: "$obj_num-start_obj_num"
}
draw_method: auto
shear_scene: {type: Eval,
str: "False if object_type_list[@obj_num-start_obj_num]=='star' else True"
}
shear:
type: G1G2
g1: 0.00
g2: -0.02
gsparams:
maximum_fft_size: 32768 # 4 x default=8192

output:
type: DESTile
tilename: DES0433-2332
bands: ["g", "r", "i", "z"]
desrun: "des-pizza-slices-y6"
imsim_data: "$os.environ['IMSIM_DATA']"
noise_mode: from_weight
add_bkg: False
grid_objects: False
nproc: 128

#Save weight and badpix extensions too
badpixfromfits:
hdu: 1
mask_hdu: 2
mask_file: "$orig_image_path"
weight:
hdu: 2

truth:
columns:
num: obj_num
half_light_radius:
type: Eval
str: "0.0 if @current_obj_type=='star' else hlr"
fhlr: "@gal.items.0.half_light_radius"
g1: "$(@stamp.shear).g1"
g2: "$(@stamp.shear).g2"
g: "$truth_g"
beta: "$truth_beta"
rotate: "$truth_rotate"
obj_type: "@current_obj_type"
obj_type_index: "@current_obj_type_index"
band: "band"
mag_zp: "$mag_zp"
laigle_number:
type: Eval
str: "-1 if @current_obj_type=='star' else int(laigle_number)"
flaigle_number: { type: catalog_sampler_value, col: laigle_number }
z:
type: Eval
str: "-1. if @current_obj_type=='star' else z_gal"
fz_gal: { type: catalog_sampler_value, col: "$z_col" }

0 comments on commit 3b07b0d

Please sign in to comment.