Skip to content

Tutorials

rmjarvis edited this page Aug 31, 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 two files BasicDemo.py and MultiObjectDemo.py. Each script in those files 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 example yaml files. The order that probably makes the most sense is

  • BD1.yaml
  • BD2.yaml
  • BD3.yaml
  • MOD1.yaml
  • MOD2.yaml
  • MOD3.yaml
  • MOD4.yaml
  • MOD5.yaml

The somewhat cryptic looking file names refer to the script numbers in BasicDemo.py and MultiObjectDemo.py. Each yaml configuration file does the same thing as the corresponding script in these files. So once you understand the yaml file, you can see how the same thing can be done in python by looking at the corresponding script there.

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 BD1.yaml in the examples directory to use this file.