Skip to content

Commit

Permalink
ensure that the gs_objects added to gs_object_arr are unique (using u…
Browse files Browse the repository at this point in the history
…niqueId)
  • Loading branch information
jchiang87 committed Oct 11, 2018
1 parent 5515011 commit 75cb598
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion python/desc/imsim/imSim.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ def sources_from_list(object_lines, obs_md, phot_params, file_name,

logger.debug('constructing GalSimCelestialObjects for %s objects; %s GB',
num_objects, uss_mem())
gs_object_ids = set()
gs_object_arr = []
out_obj_dict = defaultdict(list)
for chip_name, on_chip in on_chip_dict.items():
Expand Down Expand Up @@ -409,7 +410,9 @@ def sources_from_list(object_lines, obs_md, phot_params, file_name,
gamma2=gamma2[i_obj],
kappa=kappa[i_obj],
uniqueId=unique_id[i_obj])
gs_object_arr.append(gs_object)
if gs_object.uniqueId not in gs_object_ids:
gs_object_ids.add(gs_object.uniqueId)
gs_object_arr.append(gs_object)
out_obj_dict[chip_name].append(gs_object)
gs_object_arr = np.array(gs_object_arr)
if target_chip is not None:
Expand Down

0 comments on commit 75cb598

Please sign in to comment.