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
#365 - changing GSObject and HSM parameters on the fly #385
Conversation
(#343) Conflicts: galsim/base.py
(#343) Conflicts: include/galsim/SBAiryImpl.h include/galsim/SBDeconvolveImpl.h include/galsim/SBLaguerreImpl.h include/galsim/SBShapelet.h src/SBBox.cpp src/SBDeconvolve.cpp src/SBExponential.cpp src/SBGaussian.cpp src/SBInterpolatedImage.cpp src/SBKolmogorov.cpp src/SBLaguerre.cpp src/SBMoffat.cpp src/SBSersic.cpp
Compiles and tests on all 4 of my systems---but I suppose I should try running some scripts? Let me check the diff files... |
...I see, there is a |
Yes, test_hsmparams is run by nosetests. Thanks for checking it on all your systems! On Apr 4, 2013, at 6:44 AM, Reiko Nakajima notifications@github.com wrote:
Rachel Mandelbaum |
Hi all - I think I finished making the changes I promised, but please let me know if you think the tests of HSMParams are still insufficient and I can make even more. |
Compiles and tests fine on all 4 of my systems. (I'll try to read the dox later today...) |
@@ -379,6 +416,9 @@ def FindAdaptiveMom(object_image, weight = None, badpix = None, guess_sig = 5.0, | |||
exception when moment measurement fails. If set to `False`, then | |||
information about failures will be silently stored in the output | |||
HSMShapeData object. | |||
@param hsmparams The hsmparams keyword can be used to change the settings used by | |||
FindAdaptiveMom when estimating moments; see docstring for psfcorr.py | |||
for more information. |
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.
Probably a stupid question: when you say "see docstring for psfcorr.py for more information", do you mean the docstring above? Or the docstring from other sections of this file psfcorr.py
? (I'm not sure if it has more information that one might be looking for)
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.
I'm confused, I was replying to this on the web interface when it (plus my reply) seemed to disappear. The quick answer is I mean the docstring for the file itself, up at the top (which you can see using help(galsim.psfcorr). However, the hsmparams info is actually somewhere else now, so I will push an update to this comment to reflect its real location. Thanks for pointing this out.
On Apr 22, 2013, at 4:57 PM, Reiko Nakajima notifications@github.com wrote:
In galsim/psfcorr.py:
@@ -379,6 +416,9 @@ def FindAdaptiveMom(object_image, weight = None, badpix = None, guess_sig = 5.0,
exception when moment measurement fails. If set toFalse
, then
information about failures will be silently stored in the output
HSMShapeData object.
- @param hsmparams The hsmparams keyword can be used to change the settings used by
FindAdaptiveMom when estimating moments; see docstring for psfcorr.py
Probably a stupid question: when you say "see docstring for psfcorr.py for more information", do you mean the docstring above? Or the docstring from other sections of this file psfcorr.py? (I'm not sure if it has more information that one might be looking for)for more information.
—
Reply to this email directly or view it on GitHub.
Rachel Mandelbaum
rmandelb@andrew.cmu.edu
http://www.andrew.cmu.edu/~rmandelb/
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.
I just fixed this. Not only was this line pointing to the wrong location for hsmparams documentation, the pointers in base.py to gsparams documentation were also wrong (because we got rid of the versions that were in the galsim/ directory).
One thing I'd like to do on this branch before merging is to add the GSParams stuff to config. I'm working on this now. I think it's working. I'm just adding unit tests for it in test_config_gsobject, which will also serve to make sure that each parameter actually does something when changed. i.e. I'm also testing that the results aren't the same as a GSObject built with the default GSParams. Anyway, I was trying to figure out which demo to add it to (if any), and I was having trouble coming up with something that wouldn't feel too forced. Not that I haven't forced things before just to get them in a demo, of course, but if anyone has an idea for a good place to showcase the gsparams option in a demo, please let me know. |
… psf and gal objects (#365)
I think I have the gsparams working in config now. I set it up so that you can specify any non-default parameters either in the image item, in which case they apply to all objects (psf, pix, and galaxy), or you can add them to a particular one of these, or even particular items farther down the chain in the case of composite objects, lists, etc., in which case the changes would just apply to that particular item (or any contained items in the case of composite objects). I also added a bunch of unit tests about this that check that things change when you change one of the parameters. These are in Finally, I also aded usage of gsparams in demo7, so please take a look at that, and see if it seems reasonable. I tried to change the parameters in a way that made numerical differences, but where I couldn't see that something was obviously wrong in the resulting images. |
Rachel, One of the times I ran the test suite, I got this error:
It happened that there were other things running at the same time, so I think this was just the vagaries of CPU speed on a busy computer. So I disabled the timing tests by default. There is now a parameter near the top of |
Conflicts: galsim/base.py include/galsim/SBSersic.h include/galsim/SBSersicImpl.h pysrc/SBSersic.cpp src/SBMoffat.cpp src/SBSersic.cpp
I was a bit worried about that, btu reasoned that on my system there differences were enough that it shouldn't be an issue even by chance. I guess I was wrong! One option would be to do each operation 10x or something like that, and compare the average times over those realizations, so that random glitches should not have such a significant effect. Otherwise, I agree about disabling the time comparisons. On Apr 23, 2013, at 2:55 PM, Mike Jarvis notifications@github.com wrote:
Rachel Mandelbaum |
Given that people may be sometimes running the tests on machines with many other jobs running, I think it's better to just keep it turned off. Someone working on the hsm code can turn it back on during development to make sure they don't break anything. |
Fine. |
#365 - changing GSObject and HSM parameters on the fly
This pull request includes some work by Mike on #343 and by me on #365 to make it possible to change some of the GSObject and HSM "magic numbers" on the fly, rather than having to change hard-coded values and recompile each time. These changes should facilitate some of the investigations on various issues like #343, #355, #168, #384, etc.
In order to make this work, there are two new classes (GSParams and HSMParams) that set the magic numbers. These are passed in for example to constructors for GSObjects (in the case of GSParams) or to the moments/shape measurement routines (for HSMParams) if the user desires anything other than the defaults.
Another change from Mike's work on #343 that is included in this pull request is a fix to an issue that was causing drawShoot to use too much memory.