From 6d2bcc38748b370e0ac43a1837124c38870dd357 Mon Sep 17 00:00:00 2001 From: Cail Daley Date: Sat, 10 Oct 2026 17:10:49 +0200 Subject: [PATCH] Image sims: epoch-membership CCD bounds of the trimmed 2048x4612 CCDs The sims inherited the MegaCam DATASEC bounds (33,2080) of untrimmed 2112-px CCDs. On the 2048-px sim CCDs, objects at 2048 --- astra.yaml | 10 ++++++++-- example/cfis_image_sims/config_tile_Sx.ini | 5 +++-- workflow/config.yaml | 6 ++++++ workflow/config/cfis/config_tile_Sx.ini | 7 +++++-- workflow/rules/tile.smk | 14 ++++++++++---- 5 files changed, 32 insertions(+), 10 deletions(-) diff --git a/astra.yaml b/astra.yaml index e95afea59..4c6a89a65 100644 --- a/astra.yaml +++ b/astra.yaml @@ -733,9 +733,15 @@ analyses: admits its upper endpoint, column 2080. [HARDCODED] The comparisons are strict in make_post_process; CCD_SIZE sets only the bounds. A WCS inversion failure skips that CCD, lowering N_EPOCH, which caps - how many exposures enter each galaxy's multi-epoch fit. + how many exposures enter each galaxy's multi-epoch fit. Image + simulations' CCDs are trimmed to 2048x4612 with no overscan, so + their bounds are 0 < x < 2047, 0 < y < 4611 (input_types.image_sims + ccd_size, exported as SP_CCD_SIZE): under the data bounds an object + at 2048 < x < 2080 gains an epoch on pixels that do not exist, and + one at x < 33 loses a real one. Values: - SEXTRACTOR_RUNNER.CCD_SIZE = 33,2080,1,4612; + SEXTRACTOR_RUNNER.CCD_SIZE = ${SP_CCD_SIZE:-33,2080,1,4612}; + input_types.image_sims.ccd_size = 0,2047,0,4611; SEXTRACTOR_RUNNER.MAKE_POST_PROCESS = True. default: trimmed_bounds_33_2080 options: diff --git a/example/cfis_image_sims/config_tile_Sx.ini b/example/cfis_image_sims/config_tile_Sx.ini index 78bcfb646..b84cca656 100644 --- a/example/cfis_image_sims/config_tile_Sx.ini +++ b/example/cfis_image_sims/config_tile_Sx.ini @@ -115,5 +115,6 @@ MAKE_POST_PROCESS = True # World coordinate keywords, SExtractor output. Format: KEY_X,KEY_Y WORLD_POSITION = XWIN_WORLD,YWIN_WORLD -# Number of pixels in x,y of a CCD. Format: Nx,Ny -CCD_SIZE = 33,2080,1,4612 +# Accepted CCD pixel bounds xmin,xmax,ymin,ymax (0-based, strict) of the +# simulated 2048x4612 CCDs, which carry no overscan +CCD_SIZE = 0,2047,0,4611 diff --git a/workflow/config.yaml b/workflow/config.yaml index 99f96daf9..617b7b19e 100644 --- a/workflow/config.yaml +++ b/workflow/config.yaml @@ -37,6 +37,12 @@ input_types: tile_detection: sextractor # @sc [decision:star_selection_psf.psf_modelling_software] psf_model: fake + # Epoch-membership CCD bounds (config_tile_Sx.ini CCD_SIZE, 0-based, + # strict): the simulated CCDs are 2048x4612 with no overscan, so a stamp + # centre rounds onto the image only for 0 < x < 2047, 0 < y < 4611. Data + # keeps the ini's MegaCam DATASEC default. + # @sc [decision:detection.epoch_membership_ccd_bounds] + ccd_size: 0,2047,0,4611 # Entries per machine (SP_PROFILE, default nibi; implemented: nibi, candide) # and input_type. A run config may instead state `machine:`, which must diff --git a/workflow/config/cfis/config_tile_Sx.ini b/workflow/config/cfis/config_tile_Sx.ini index 43a59c493..4bfdf6a24 100644 --- a/workflow/config/cfis/config_tile_Sx.ini +++ b/workflow/config/cfis/config_tile_Sx.ini @@ -153,6 +153,9 @@ MAKE_POST_PROCESS = True # @sc [decision:preparation.object_position_columns] WORLD_POSITION = XWIN_WORLD,YWIN_WORLD -# Accepted CCD pixel bounds xmin,xmax,ymin,ymax (0-based, strict) +# Accepted CCD pixel bounds xmin,xmax,ymin,ymax (0-based, strict). The default +# is the MegaCam DATASEC of an untrimmed 2112x4644 CCD; image simulations, +# whose CCDs are trimmed to 2048x4612, set SP_CCD_SIZE (workflow config.yaml +# input_types.image_sims.ccd_size). # @sc [decision:detection.epoch_membership_ccd_bounds] -CCD_SIZE = 33,2080,1,4612 +CCD_SIZE = ${SP_CCD_SIZE:-33,2080,1,4612} diff --git a/workflow/rules/tile.smk b/workflow/rules/tile.smk index 15a7bd3cc..0978af368 100644 --- a/workflow/rules/tile.smk +++ b/workflow/rules/tile.smk @@ -528,13 +528,19 @@ if TILE_DETECTION == "unions_catalogue": def detect_env(tile): - """tile_detect's prologue exports: the catalogue to join, if any. + """tile_detect's prologue exports: the catalogue to join, if any, and for + image simulations the epoch-membership CCD bounds. - Empty under tile_detection: sextractor (image simulations), so that no - value left exported in the submitting shell reaches the job. + SP_MATCH_CATALOGUE is empty under tile_detection: sextractor (image + simulations), so that no value left exported in the submitting shell + reaches the job. SP_CCD_SIZE is exported only for image simulations (their + trimmed CCDs); data runs take config_tile_Sx.ini's default. """ if TILE_DETECTION != "unions_catalogue": - return {"SP_MATCH_CATALOGUE": ""} + env = {"SP_MATCH_CATALOGUE": ""} + if INPUT_TYPE == "image_sims": + env["SP_CCD_SIZE"] = config["ccd_size"] + return env gic = f"{tile_dir(tile)}/output/run_sp_tile_Gic/get_images_runner/output" return {"SP_MATCH_CATALOGUE": f"{gic}/CFIS_cat{unit_num(tile)}.cat"}