Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/shapepipe/modules/ngmix_package/ngmix.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ def get_last_id(self, cat_path):
if id_last != cat._cat_data[hdu_no].data["id"][-1]:
raise ValueError(
"Last ID {cat._cat_data[hdu_no].data['id'][-1]} in HDU"
+ f" #{hdu_no} inconsistent with {id_las}"
+ f" #{hdu_no} inconsistent with {id_last}"
)

return id_last
Expand Down Expand Up @@ -1026,16 +1026,18 @@ def do_ngmix_metacal(
# Gal guess
try:
gal_guess_tmp = get_guess(
gals[n_e], pixel_scale, guess_size_type="sigma"
gals[n_e],
pixel_scale,
guess_centroid_unit="img",
)
except Exception:
gal_guess_flag = False
gal_guess_tmp = np.array([0.0, 0.0, 0.0, 0.0, 1, 100])

# Recenter jacobian if necessary
gal_jacob = ngmix.Jacobian(
row=(gals[0].shape[0] - 1) / 2 + gal_guess_tmp[0],
col=(gals[0].shape[1] - 1) / 2 + gal_guess_tmp[1],
row=(gals[n_e].shape[0] - 1) / 2 + gal_guess_tmp[1],
col=(gals[n_e].shape[1] - 1) / 2 + gal_guess_tmp[0],
wcs=jacob_list[n_e],
)

Expand Down