-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix scipy.fsolve failure when computing r0_500
- Loading branch information
1 parent
e311a5f
commit 8ceeb7b
Showing
2 changed files
with
38 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import unittest | ||
|
||
import numpy as np | ||
|
||
from desc.imsim.atmPSF import AtmosphericPSF | ||
|
||
class AtmPSF(unittest.TestCase): | ||
def test_r0_500(self): | ||
"""Test that _seeing_resid has the API fsolve wants.""" | ||
for wavelength in [300.0, 500.0, 1100.0]: | ||
for L0 in [10.0, 25.0, 100.0]: | ||
for target_seeing in [0.5, 0.7, 1.0]: | ||
r0s = [0.1, 0.2] | ||
np.testing.assert_array_equal( | ||
np.hstack([ | ||
AtmosphericPSF._seeing_resid(r0s[0], wavelength, L0, target_seeing), | ||
AtmosphericPSF._seeing_resid(r0s[1], wavelength, L0, target_seeing), | ||
]), | ||
AtmosphericPSF._seeing_resid(r0s, wavelength, L0, target_seeing) | ||
) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |