Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add modelSize to piff config #23
Add modelSize to piff config #23
Changes from all commits
e051711
7fe21e9
6d16110
cb3fe08
5529420
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Given that in the default processing we don't use sky coordinates, I'm inclined to keep this as 25 in the default here. For your testing purposes, you should be able to override this value.
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.
@rmjarvis Is there any disadvantage to having
modelSize == stampSize
?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.
Yes. You definitely don't want stampSize == modelSize. It should be larger for 3 reasons.
And honestly, there is barely any down side to using a larger than needed stamp size. Piff will just ignore any pixels that are not being used to constrain the model. So I'd recommend the default being much larger in fact. Use 80x80 or something.
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 default I put in was 35 which was designed to account for your part 3. in the list, since the default
modelSize
was set to 25. It seems like 1. and 2. imply we should go even largerThere 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.
Mike, could you confirm that this is needed even if the modeling is happening in pixel coordinates as opposed to sky coordinates?
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.
"Needed"? No. Not technically. But it will produce inaccurate PSF models near the edges if you don't.
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.
Also, I remember the compute scales as cubic power of the size, but does it as
modelSize**3
orstampSize**3
? I hope the former.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.
modelSize**6 actually.
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.
Why this? I don't think there is any restriction that either of these must be odd. Odd model size is common, but not really necessary. Most PSF profiles have a lot of flux in the central 1 pixel, so odd helps model that better. But there could certainly be cases where even works better. (I did test both odd and even for DES, and the odd sizes in fact worked better in those tests -- I haven't switched to even sizes since then.)
And I usually use even stampSize actually. The default in Piff is 32, which is much larger than our modelSize in DES, even without any rotator.
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.
I agree that there is no reason in principle.
In practice it is nice to have odd for some applications. For example, odd means the model can be centered on that center pixel, and then convolutions with the PSF image will not cause a shift.
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.
Hmm,
stampSize
is enforced to be odd upstream as well, so even if we drop that requirement here, you can be guaranteed thatstampSize
will be odd. Dropping that requirement upstream will have to get discussed within the Science Pipelines team but I can go with whatever is the consensus is onmodelSize
. But based on Mike's comment, may be we should not make it a requirement just yet.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.
We want it for shear
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.
This consideration is orthogonal to the reasons for having the model use an odd size. You can draw it onto an odd-sized image (and center it) regardless of what the underlying model uses.
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.
OK.
I thought that re-gridding the model from a center-near-pixel-boundary to center-at-pixel-center would introduce larger interpolation errors. If that's not the case then I withdraw my assertion
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.
I'll be moving around the code a bit after merging, so I will drop the requirement then.
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.
I still think people should tend to use odd modelSize in most cases for other reasons. Mostly that typical PSFs have a hot spot right at the center, which an odd model size is better at describing. But making it a requirement feels a little heavy handed. E.g. modeling very out of focus stars, which don't have that central peak, might work better with an even model size for some reason.
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.
Note to self: this is a check only on the config, so should be implemented in a
validate
method.