Make it possible to exclude cross terms in BasisPolynomial #180
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.
Currently BasisPolynomial has a single number for max_order, which is the same for all cross pairings of two parameters. So if you want to include uv^2 and u^2v, that's max_order=3. The problem is when you also have e.g. color or dz - you are stuck with the same max_order for terms like color * v^2. This is usually not desired.
This PR makes it possible to more carefully specify the max_order you want for different pairs. max_order is allowed to be a dict whose keys are tuples of parameter names and whose values are the max_order you want for that pairing.
So to have e.g. u,v use 2nd order with cross terms, and also dz use 2nd order with no cross terms with u or v, you would specify:
max_order = { (u,v): 2 }. (The missing (u,dz) and (v,dz) pairs are implicitly zero.)Additionally, we had wanted to try forcing SumPSF to do extra iterations rather than stopping after only 1 or 2. That wasn't possible. So I added the parameter
min_iterto all PSF types, analogous tomax_iter.