{"action":"created","issue":{"url":"https://api.github.com/repos/GalSim-developers/GalSim/issues/757","repository_url":"https://api.github.com/repos/GalSim-developers/GalSim","labels_url":"https://api.github.com/repos/GalSim-developers/GalSim/issues/757/labels{/name}","comments_url":"https://api.github.com/repos/GalSim-developers/GalSim/issues/757/comments","events_url":"https://api.github.com/repos/GalSim-developers/GalSim/issues/757/events","html_url":"https://github.com/GalSim-developers/GalSim/issues/757","id":159229373,"number":757,"title":"test_wfirst.py currently fails","user":{"login":"rmjarvis","id":623887,"avatar_url":"https://avatars.githubusercontent.com/u/623887?v=3","gravatar_id":"","url":"https://api.github.com/users/rmjarvis","html_url":"https://github.com/rmjarvis","followers_url":"https://api.github.com/users/rmjarvis/followers","following_url":"https://api.github.com/users/rmjarvis/following{/other_user}","gists_url":"https://api.github.com/users/rmjarvis/gists{/gist_id}","starred_url":"https://api.github.com/users/rmjarvis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmjarvis/subscriptions","organizations_url":"https://api.github.com/users/rmjarvis/orgs","repos_url":"https://api.github.com/users/rmjarvis/repos","events_url":"https://api.github.com/users/rmjarvis/events{/privacy}","received_events_url":"https://api.github.com/users/rmjarvis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/GalSim-developers/GalSim/milestones/13","html_url":"https://github.com/GalSim-developers/GalSim/milestones/v1.4","labels_url":"https://api.github.com/repos/GalSim-developers/GalSim/milestones/13/labels","id":1498158,"number":13,"title":"v1.4","description":null,"creator":{"login":"rmjarvis","id":623887,"avatar_url":"https://avatars.githubusercontent.com/u/623887?v=3","gravatar_id":"","url":"https://api.github.com/users/rmjarvis","html_url":"https://github.com/rmjarvis","followers_url":"https://api.github.com/users/rmjarvis/followers","following_url":"https://api.github.com/users/rmjarvis/following{/other_user}","gists_url":"https://api.github.com/users/rmjarvis/gists{/gist_id}","starred_url":"https://api.github.com/users/rmjarvis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmjarvis/subscriptions","organizations_url":"https://api.github.com/users/rmjarvis/orgs","repos_url":"https://api.github.com/users/rmjarvis/repos","events_url":"https://api.github.com/users/rmjarvis/events{/privacy}","received_events_url":"https://api.github.com/users/rmjarvis/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":32,"state":"open","created_at":"2016-01-11T20:05:44Z","updated_at":"2016-06-08T17:44:10Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2016-06-08T17:44:02Z","updated_at":"2016-06-10T12:28:59Z","closed_at":null,"body":"Running test_wfirst.py from the command line to get the extra, slightly more time-consuming tests is currently failing:\r\n```\r\n$ python test_wfirst.py\r\ntime for test_wfirst_wcs = 1.04\r\ntime for test_wfirst_backgrounds = 0.08\r\ntime for test_wfirst_bandpass = 0.06\r\ntime for test_wfirst_detectors = 0.02\r\nTraceback (most recent call last):\r\n  File \"test_wfirst.py\", line 519, in <module>\r\n    test_wfirst_psfs()\r\n  File \"test_wfirst.py\", line 468, in test_wfirst_psfs\r\n    filename=test_file)\r\n  File \"/Library/Python/2.7/site-packages/galsim/wfirst/wfirst_psfs.py\", line 319, in storePSFImages\r\n    method='no_pixel')\r\n  File \"/Library/Python/2.7/site-packages/galsim/chromatic.py\", line 2003, in drawImage\r\n    wmult, integrator, self.gsparams)\r\n  File \"/Library/Python/2.7/site-packages/galsim/utilities.py\", line 932, in __call__\r\n    result = self.user_function(*key)\r\n  File \"/Library/Python/2.7/site-packages/galsim/chromatic.py\", line 1805, in _get_effective_prof\r\n    method='no_pixel')\r\n  File \"/Library/Python/2.7/site-packages/galsim/chromatic.py\", line 1002, in drawImage\r\n    int_im = self._get_interp_image(bandpass, image=image, integrator=integrator, **kwargs)\r\n  File \"/Library/Python/2.7/site-packages/galsim/chromatic.py\", line 930, in _get_interp_image\r\n    np.max(self.waves)))\r\nRuntimeError: Requested wavelength 300.0 is outside the allowed range: 900.0 to 1230.0 nm\r\n```\r\nIt looks like this is related to the changes in the default thinning/truncation stuff.  The 900-1230 range was designed to match the wavelength range for Y106, but now that filter goes from 300-2200, although most of those values are zeros.\r\n\r\nThe wfirst `getBandpasses` now has a kwarg `default_thin_trunc` which defaults to False, but given what this bandpass looks like, it seems like either that should probably default to True or we should store versions of the bandpasses that remove the extraneous zeros.\r\n\r\nHowever, even if I do switch that to True, then it's still not quite right.  I need to change the 900 -> 885 on line [433 of test_wfirst.py](https://github.com/GalSim-developers/GalSim/blob/master/tests/test_wfirst.py#L433).  \r\n\r\nAnd then the test still doesn't pass, but I'm not sure if this is a real problem or not:\r\n```\r\nTraceback (most recent call last):\r\n  File \"test_wfirst.py\", line 519, in <module>\r\n    test_wfirst_psfs()\r\n  File \"test_wfirst.py\", line 453, in test_wfirst_psfs\r\n    err_msg='PSF at a given wavelength and interpolated chromatic one evaluated at that '\r\n  File \"/Users/Mike/lib/python2.7/site-packages/numpy/testing/utils.py\", line 892, in assert_array_almost_equal\r\n    precision=decimal)\r\n  File \"/Users/Mike/lib/python2.7/site-packages/numpy/testing/utils.py\", line 713, in assert_array_compare\r\n    raise AssertionError(msg)\r\nAssertionError: \r\nArrays are not almost equal to 3 decimals\r\nPSF at a given wavelength and interpolated chromatic one evaluated at that wavelength disagree.\r\n(mismatch 0.00629881582263%)\r\n x: array([[  1.295e-06,   3.367e-06,   3.891e-06, ...,   4.184e-06,\r\n          3.012e-06,   1.152e-06],\r\n       [  2.681e-06,   1.978e-06,   1.822e-06, ...,   1.622e-06,...\r\n y: array([[  7.226e-07,   1.001e-06,   2.299e-06, ...,   2.268e-06,\r\n          8.914e-07,   7.136e-07],\r\n       [  6.530e-07,   8.959e-07,   2.281e-06, ...,   2.115e-06,...\r\n```\r\nIt's only 0.006% of the pixels, so my guess is this is just a numerical fluctuation, not an error."},"comment":{"url":"https://api.github.com/repos/GalSim-developers/GalSim/issues/comments/225169105","html_url":"https://github.com/GalSim-developers/GalSim/issues/757#issuecomment-225169105","issue_url":"https://api.github.com/repos/GalSim-developers/GalSim/issues/757","id":225169105,"user":{"login":"rmandelb","id":1454906,"avatar_url":"https://avatars.githubusercontent.com/u/1454906?v=3","gravatar_id":"","url":"https://api.github.com/users/rmandelb","html_url":"https://github.com/rmandelb","followers_url":"https://api.github.com/users/rmandelb/followers","following_url":"https://api.github.com/users/rmandelb/following{/other_user}","gists_url":"https://api.github.com/users/rmandelb/gists{/gist_id}","starred_url":"https://api.github.com/users/rmandelb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmandelb/subscriptions","organizations_url":"https://api.github.com/users/rmandelb/orgs","repos_url":"https://api.github.com/users/rmandelb/repos","events_url":"https://api.github.com/users/rmandelb/events{/privacy}","received_events_url":"https://api.github.com/users/rmandelb/received_events","type":"User","site_admin":false},"created_at":"2016-06-10T12:28:59Z","updated_at":"2016-06-10T12:28:59Z","body":"Thanks for checking on this.\r\n\r\n1. I think you're right that ```default_thin_trunc``` should be True by default; will do this.\r\n\r\n2. The change to 885 is needed because that's the ```blue_limit``` of the newly thinned / truncated bandpass.   Really, the answer is that lines 433-434 should not be hardcoded, but rather should be set to the ```blue_limit``` and ```red_limit``` so that even if the bandpasses change, we shouldn't have this problem.  Poor test design on my part, sorry; will fix.\r\n\r\n3. Not sure what to do about this 0.006% mismatch; does sound like numerical fluctuations, but I'm reluctant to change the required precision to 2 decimal places.  Let me play around a bit.\r\n"}}
{"actor":{"display_login":"rmandelb"}}