{"action":"created","issue":{"url":"https://api.github.com/repos/GalSim-developers/GalSim/issues/736","repository_url":"https://api.github.com/repos/GalSim-developers/GalSim","labels_url":"https://api.github.com/repos/GalSim-developers/GalSim/issues/736/labels{/name}","comments_url":"https://api.github.com/repos/GalSim-developers/GalSim/issues/736/comments","events_url":"https://api.github.com/repos/GalSim-developers/GalSim/issues/736/events","html_url":"https://github.com/GalSim-developers/GalSim/pull/736","id":147050934,"number":736,"title":"#720 A few bug fixes relevant for metacal runs","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":8,"closed_issues":21,"state":"open","created_at":"2016-01-11T20:05:44Z","updated_at":"2016-04-19T17:33:27Z","due_on":null,"closed_at":null},"comments":5,"created_at":"2016-04-08T22:05:25Z","updated_at":"2016-04-23T02:29:31Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/GalSim-developers/GalSim/pulls/736","html_url":"https://github.com/GalSim-developers/GalSim/pull/736","diff_url":"https://github.com/GalSim-developers/GalSim/pull/736.diff","patch_url":"https://github.com/GalSim-developers/GalSim/pull/736.patch"},"body":"This PR won't close issue #720, but given that we'll be releasing version 1.4 soon, I wanted to make sure the bug fixes I've made while investigating the metacal noise properties get included in that release.  Here are the bug fixes I've made on this branch:\r\n\r\n1. There was an error in drawKImage when giving a non-default scale, but letting it automatically set the size.  This is fixed.\r\n2. There was an assert statement in the C++ layer that could be triggered (leading to an ugly abort) when making an InterpolatedImage from an empty input image.  This now gives a graceful Python exception.\r\n3. When deconvolving things that have zeros if fourier space and then reconvolving by something that wasn't perfectly matched due to numerical approximations, the noise could be massively amplified.  This isn't really a bug in anything (that's just the math), but I changed the SBDeconvolve function to max out the inverse at 1/kvalue_accuracy.  This seems appropriate, since that's as accurate as we know any of the zeros most of the time.  And it significantly improved the noise properties of the resulting images.\r\n\r\nThis PR also includes a new test_metacal.py, which is where I'm still working on trying to understand the noise whitening procedures and why strategies 1 and 2 don't work.  This is still work in progress, but for those who are interested, here is a summary of the state of things there:\r\n\r\nThere are several strategies to remove the noise correlations induced by the metacal procedure.  Only strategy 4 works.  I believe I understand why strategy 1 doesn't work, but I haven't figured out a good fix for it yet.  I think strategy 2 should work, but it doesn't.  I don't yet know if this is an error in the test or a bug in GalSim.  Strategy 3 was the one that @esheldon found worked on his tests, but it turns out it only works on square pixels.  We understand why, so there's no bug in the fact that that one fails.  Strategy 4 is our current successful strategy that Erin is using in production metacal code (which lowers the pressure to figuring out how to get 1 or 2 working).  Strategy 5 was an idea I had that I thought might work, but it also only works for square pixels.  I think I understand why that is now, and I'm not sure it can be made to work with arbitrary wcs. "},"comment":{"url":"https://api.github.com/repos/GalSim-developers/GalSim/issues/comments/213652323","html_url":"https://github.com/GalSim-developers/GalSim/pull/736#issuecomment-213652323","issue_url":"https://api.github.com/repos/GalSim-developers/GalSim/issues/736","id":213652323,"user":{"login":"esheldon","id":621661,"avatar_url":"https://avatars.githubusercontent.com/u/621661?v=3","gravatar_id":"","url":"https://api.github.com/users/esheldon","html_url":"https://github.com/esheldon","followers_url":"https://api.github.com/users/esheldon/followers","following_url":"https://api.github.com/users/esheldon/following{/other_user}","gists_url":"https://api.github.com/users/esheldon/gists{/gist_id}","starred_url":"https://api.github.com/users/esheldon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/esheldon/subscriptions","organizations_url":"https://api.github.com/users/esheldon/orgs","repos_url":"https://api.github.com/users/esheldon/repos","events_url":"https://api.github.com/users/esheldon/events{/privacy}","received_events_url":"https://api.github.com/users/esheldon/received_events","type":"User","site_admin":false},"created_at":"2016-04-23T02:29:31Z","updated_at":"2016-04-23T02:29:31Z","body":"I've been using it in production without any issues.\n"}}