Skip to content

Commit

Permalink
Merge pull request #387 from LSSTDESC/u/cwalter/parse-options
Browse files Browse the repository at this point in the history
Parse LSSTSiliconBuilder Options in stamp.py
  • Loading branch information
cwwalter authored Jul 23, 2023
2 parents b8ed176 + 2ff0f96 commit 9a4c70d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion imsim/stamp.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from dataclasses import dataclass, fields, MISSING
import numpy as np
import galsim
from galsim.config import StampBuilder, RegisterStampType, GetAllParams, GetInputObj
from galsim.config import StampBuilder, RegisterStampType, CheckAllParams, GetAllParams, GetInputObj
from lsst.obs.lsst.translators.lsst import SIMONYI_LOCATION as RUBIN_LOC

from .diffraction_fft import apply_diffraction_psf
Expand Down Expand Up @@ -84,6 +84,15 @@ def setup(self, config, base, xsize, ysize, ignore, logger):
Returns:
xsize, ysize, image_pos, world_pos
"""

# First do a parsing check to make sure that all the options passed to
# the config are valid, and no required options are missing.

req = {'diffraction_psf': dict}
opt = {}
ignore = ['fft_sb_thresh', 'band', 'airmass', 'rawSeeing', 'max_flux_simple'] + ignore
galsim.config.CheckAllParams(config, req, opt, ignore=ignore)

gal = galsim.config.BuildGSObject(base, 'gal', logger=logger)[0]
if gal is None:
raise galsim.config.SkipThisObject('gal is None (invalid parameters)')
Expand Down

0 comments on commit 9a4c70d

Please sign in to comment.