-
Notifications
You must be signed in to change notification settings - Fork 30
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
Code updates for JWSTSIAF-284 #363
base: siaf-updates
Are you sure you want to change the base?
Changes from all commits
f2cd70e
0e32388
0834e98
41cd1c9
ad639e9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,9 +17,9 @@ def makeup_polynomial(order = 5): | |
a = np.zeros(terms) | ||
|
||
np.random.seed(seed=1) | ||
a[1] = 0.05 + 0.01 * np.random.rand(1) | ||
a[1] = 0.05 + 0.01 * np.random.rand() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @pbennet I see we are changing the dimensions of the coefficients here. Does this change anything downstream? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess to be specific, I know that with numpy 2.0 there were updates to array operations, but is there a benefit to changing values of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The first case gives me the old warning
and the dimensions of both outputs look the same to me: `In [10]: a[1] = 0.05 + 0.01 * np.random.rand(1) In [11]: print(a.shape) In [12]: a[1] = 0.05 + 0.01 * np.random.rand() In [13]: print(a.shape) |
||
np.random.seed(seed=2) | ||
a[2] = 0.0001 * np.random.rand(1) | ||
a[2] = 0.0001 * np.random.rand() | ||
np.random.seed(seed=3) | ||
a[3:6] = 1.0e-7 * np.random.rand(3) | ||
np.random.seed(seed=4) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -545,7 +545,7 @@ def prepend_rotation_to_polynomial(a, theta, verbose=False): | |
for j in range(m-n-mu, m-mu+1): | ||
factor = (-1)**(m-n-mu) * choose(m-j, mu) * choose(j, m-n-mu) | ||
cosSin = c**(j+2*mu-m+n) * s**(2*m-2*mu-j-n) | ||
atrotate[m, n] = atrotate[m, n] + factor * cosSin * at[m, j] | ||
atrotate[m, n] = np.squeeze(atrotate[m, n] + factor * cosSin * at[m, j]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am looking at a two-dimensional array in python:
It looks like the squeeze method doesn't change the shape/dimensions of the array, is this change necessary? |
||
if verbose: | ||
print(m, n, j, factor, 'cos^', j+2*mu-m+n, 'sin^', 2*m-2*mu-j-n, ' A', m, j) | ||
# Put back in linear layout | ||
|
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.
Fancy -- A little less readable in my opinion but if this is a request added by a team I won't say anymore 👍