Running your own SPS grids

Here we will show how to create an incident grid using Synthesizer. These incident grids are often used as inputs to photoionisation codes like Cloudy, but are also

Firstly, choose the grid you want to create, e.g. BC03, maraston05, or FSPS and find the corresponding python script to install it within the synthesizer-grids repository. To create the grid, you need to specify where you want to place the raw data files from the model (input_dir), and where you would like the grid file to be created (grid_dir), e.g.

python install_bc03.py --input_dir /users/snewman/data/synthesizer_data/input_files --grid_dir /users/snewman/data/synthesizer_data/grids

Some of the scripts to create grids have special requirements. For example, to create the BC03-2016 grid you need a working fortran compiler to convert the binary files into ascii, and you can check this is available by running python which gfortran at the command line. Many of the scripts have the ability to download the original model data files by adding the command --download, but the data for BPASS needs to be installed seperately and that data can be found on the BPASS website. To create the FSPS grid, the python-fsps package needs to be installed and details of how to do this can be found here.

After creating a grid, there is also the option of creating a grid of a reduced size. For example, you can restrict the maximum age of the grid:

python create_reduced_grid.py -grid_dir /users/snewman/data/synthesizer_data/grids -original_grid maraston13_kroupa -max_age 7

where here the maximum age was set to \(10^7\) years.

Running your grid through Cloudy

Here we will now show how to create input files for the code Cloudy. The details of Cloudy and how to install it can be found on the Cloudy website.

Within synthesizer_grids/cloudy/params are a variety of files that can be used to set the parameters used in Cloudy modelling, such as the ionisation parameter and hydrogen density. To use our standard approach where we allow the ionisation parameter to vary with the input ionizing source, but normalised to some reference value, the c23.01-sps.yaml is the most appropriate. Alternatively, c23.01-sps-fixed.yaml can be used for fixed ionisation parameters. To create input files with varying parameter values, we can do something like this:

python create_cloudy_input_grid.py -grid_dir /users/snewman/data/synthesizer_data/grids -cloudy_dir /users/snewman/data/synthesizer_data/cloudy -incident_grid maraston11_kroupa -cloudy_params c23.01-sps -cloudy_params_addition test_suite/ionisation_parameter -machine sciama -verbose True

Then, using the method of your choice, you can run the created input files througn Cloudy. Within synthesizer-grids are example scripts for how to run these using the HPC Apollo at the University of Sussex.

Once these have been run through Cloudy, we can use the Cloudy outputs to create our new grid:

python create_synthesizer_grid.py -grid_dir /users/snewman/data/synthesizer_data/grids -cloudy_dir /users/snewman/data/synthesizer_data/cloudy -incident_grid maraston11 -cloudy_params c23.01-sps-fixed-hydrogen_density