Skip to content

Tutorials

rmjarvis edited this page Sep 11, 2012 · 16 revisions

The examples directory contains files which essentially amount to tutorials on how to use the GalSim code.

To learn how to use GalSim in python, you should read through the files demo*.py. Each file in the series adds some new features, and each new feature is generally well documented, so you can both see an example of how it is used in practice and usually also get some additional explanation for what the code does.

To learn how to use GalSim using config files (probably the easier path for those who don't know python, but useful even for pythonistas), you should read through the files demo*.yaml. Each yaml configuration file does the same thing as the corresponding .py script. So once you understand the .yaml file, you can see how the same thing can be done in python by looking at the corresponding .py file.

Note: The executable that will parse the yaml file is bin/galsim_yaml. Doing scons install will install this executable in /usr/local/bin or $PREFIX/bin (if you specify a different PREFIX). So you should just be able to type galsim_yaml demo1.yaml in the examples directory to use this file (assuming $PREFIX/bin is in your path).