GalSim-developers/GalSim — pull request #492 by rmjarvis (2013-12-12 04:10:17+00:00)
Title: #482 A few new features to config

This PR is for a few new handy features for using config files. Nothing pressing, but I wanted to clear my slate of a few of these easier feature requests.

- Add a new `image.retry_failures` item that can be set so that if the construction of a GSObject fails for any reason, you can ask it to retry. An example of this functionality as been added to demo8, where random shear values can be larger than 1, which fails, and the code will retry those items until the shear is < 1.
- Add a new `output.retry_io` item that can be set so that if the output write command fails (due to hard drive overloading for example), then it will wait a second and try again. See [this comment](https://github.com/GalSim-developers/GalSim/issues/482#issuecomment-27349786) for an example where I artificially added a 20% failure rate to the fits write command.
- Change how the indexing works within each image. For #487, I implemented a workaround for how to get the indexing to work correctly when the number of items in each image (or file) is variable. However, it wasn't quite the best solution, imo. But the right way, where we always restart the object numbering at 0 at the start of each image would not have technically been backwards compatible. So I did a hack on that branch and put the better solution here on this branch. So now numbering does start at 0, which I think it more intuitive.
- Add Sum type for value types for which it makes sense: float, int, angle, shear, position. The shear sum option was issue #457, but it made sense to add the Sum type for all of these, since the code is generic.
- Allow the user to modify or add config parameters from the command line. (Issue #479) For example, try the command: `galsim -v3 demo4.yaml output.nproc=-1 gal.rotate="{type: Random}" gal.items.1.ellip.e1=0 | more`. Before it gets into the meat of the calculation, you can peruse the config dict that it will be using, so you can see how the command line edits have changed those items.