From b3cfbaf7abae3980bea48038e992a8a045df9b32 Mon Sep 17 00:00:00 2001 From: Spencer Date: Wed, 2 Jan 2019 14:06:48 -0800 Subject: [PATCH] Added GalSim 2.0+ compatibility for the field `_input_objs` when using proxy catalogs. --- balrog/balrog_injection.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/balrog/balrog_injection.py b/balrog/balrog_injection.py index 48c551d..3addd9a 100644 --- a/balrog/balrog_injection.py +++ b/balrog/balrog_injection.py @@ -475,7 +475,11 @@ def generate_stars(self, config, realization): # Make proxy catalog galsim.config.ProcessInput(gs_config) - cat_proxy = gs_config['input_objs'][input_type][0] + try: + cat_proxy = gs_config['input_objs'][input_type][0] + except KeyError: + # The field name changed in GalSim 2.0+ + cat_proxy = gs_config['_input_objs'][input_type][0] # pudb.set_trace() # If all stars in Sahar's catalogs were guaranteed to be in the