-
Notifications
You must be signed in to change notification settings - Fork 19
Allow independent handling of noshear in metacal #251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
There may need to be some additional handling in case the requested types include |
| _newpsf_image, _newpsf_obj = self.get_target_psf(sh, 'gal_shear') | ||
| _unsheared_image = self.get_target_image(_newpsf_obj, shear=None) | ||
| obs = self._make_obs(_unsheared_image, _newpsf_image) | ||
| obs.psf.galsim_obj = _newpsf_obj |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code here reproduces some of the internals of get_obs_galshear but extracting the noshear branch. Maybe the function can be broken up so we things stay consistent with any future changes?
|
My bad, didn't catch the existing test. Updated accordingly |
|
Hi Sid. I appreciate the PR. However, this is a breaking change. What's your motivation for this change? |
|
There are a few motivations:
So the motivations are mostly efficiency with some aesthetic edit: I also first thought I had a bug in my code because I was getting a different set of shear types in my output than I requested in my config, so I had to spend some time debugging before I realized that this was default (but undocumented, as far as I can tell) behavior |
|
The alternative I was coming up with was to reconstruct the |
|
You can call |
|
I guess if you are using The reason this exists is that noshear/1p can share some calculations, and this improves the speed when you are planning to get more than just noshear. If anyone relied on that it will break. |
|
In this case I am running code from Part of my thinking was that noshear can share those calculations with any other shear type, so you can have the calculations be shared between noshear and the first other shear type requested (not just |
|
I do appreciate that it is bad to break standing behavior -- but if the decision is to keep this as-is I do think it would be good to at least document it throughout (none of the docstrings in any of the functions mention this behavior but they will all fall back to it) |
|
It is breaking. I'd be ok supporting a "noshear-only" version that really is only "noshear". |
Proposed solution for #250. Rather than forcing the processing of
1pifnoshearis specified, this updates the code to checknoshearis requested, then process that independentlynoshearand other types are requested, ifnoshearhas not yet been run, process that alongside another typeThe code produces the desired behavior but there are no tests yet. I'm happy to implement one (probably something that quickly runs metacal with a few different types requests and checks that the output dict has the same types as requested)