Example scripts¶
The examples directory contains a number of example python scripts that demonstrate ways of using (elements of) this library for various science analysis steps. Each script is a self-contained unit which produces a plot from the simulation data. The scripts are heavily commented to highlight their internal workings. It is a good idea to run and modify (some of) them yourself before using the library for your own scientific goals!
Note
The emphasis of these examples is to demonstrate how to use various parts of the library. The science questions addressed by them are selected to fit with the library aspects illustrated, rather than representing key scientific targets of the simulations. Also note that the plotting part is deliberately kept simple, so these examples should not be regarded as recommendations on how to present scientific data.
Basic examples¶
These are relatively straightforward, and probably the best ones to try out first.
| Name | Library/simulation features covered | Science aspect |
|---|---|---|
| sfr_mstar_plot.py |
|
Plot Mstar - SFR relation |
| subhalo_map.py | Use
|
Plot subhaloes around a cluster |
| select_galaxies.py | Find galaxies matching
a set of criteria (analogous to a data base query) |
|
| star_density.py |
|
Plot galaxy image |
| phase_diagram.py |
|
Plot the gas phase diagram of a simulation |
More complex example scripts¶
These examples are slightly longer and/or more complex than the “basic” examples. In the second column, only features that have not already been covered in the basic examples above are listed.
| Name | Library/simulation features covered | Science aspect |
|---|---|---|
| galaxy_stars.py | in_subhalo() function to test particles for subhalo membership |
Plot images of a disrupting galaxy |
| galaxy_evolution.py |
|
Plot Mstar and
Zstar evolution for a galaxy |
| sf_history.py |
|
Plot SF history of central and satellite galaxies |
| snipshot_age.py |
|
Plot stellar age
map of a galaxy at a specified time |
| trace_particles.py | find_id_indices() function to
match entries between catalogues (alternative to Gate
class) |
Phase diagram of gas
destined to sit in the cluster core |
| thermal_history.py |
|
Path of one particle
across the phase diagram over time |
| orbits.py |
|
Compare the orbit of
a galaxy in HYDRO and DM-only runs |