Kinematic Analysis of Simulation Data

Katherine Harborne

2018-12-07

library(SimSpin)

Here, we examine the flexibility of the sim_analysis() function -

sim_analysis(simdata, bin_type = "r", rmax = 200, rbin = 200, DM_profile = NA)

The purpose of this function is to calculate the kinematic properties of a simulated galaxy within certain user defined bins. Using this function, we can measure both individual components and the total galaxy:

For this example, we will analyse SimSpin_example.hdf5 to explore the various uses of this function. This is the Gadget snapshot for a \(10^{10} M_{\odot}\) S0 galaxy containing 50,000 disc and 75,000 bulge particles of equal mass. The dark matter particles in this simulation have been replaced by a Hernquist analytic profile, with a \(M_{DM}\) = 184.9 \(\times 10^{10} M_{\odot}\) and halo scale radius, \(a_{DM}\) = 34.5 kpc.

We begin by loading the particle data in three ways. First, we load all the particles using the generic sim_data() function. We can load in specific components by specifying the ptype, where we use Gadget convention such that 0 - gas, 1 - dark matter, 2 - disc, 3 - bulge, 4 - stars. You can request any combnation of these types, for example the bulge and disc components would be requested with ptype = c(2,3). Here, we also load each of the disc and bulge components seperately.

galaxy_file = sim_data(system.file("extdata", 'SimSpin_example.hdf5', package="SimSpin"))
disc_file   = sim_data(system.file("extdata", 'SimSpin_example.hdf5', package="SimSpin"), ptype = 2)
bulge_file  = sim_data(system.file("extdata", 'SimSpin_example.hdf5', package="SimSpin"), ptype = 3)

If we run the sim_analysis() function on the full galaxy file simply with the default inputs described above,

S0_defaults = sim_analysis(galaxy_file)
## No dark matter component is included in this analysis. Describe an analytic potential to calculate the total kinematic profile correctly.
## Error in sim_analysis(galaxy_file): DM Error

we receive a warning. This is because the dark matter particles in the SimSpin_example simulation provided have been replaced with an analytic description of the dark matter potential. As the function analyses all components in the simulation by default, the code issues an error. Without this mass in the form of particles, the output Gadget file contains no record of the effect that the dark matter analytic profile has on the other particles in the simulation. We need to specify this using a list, DM_profile, that contains details about that dark matter profile such that the total profile can be calculated properly.

There are two options currently for the type of analytic DM profile, "NFW" and "Hernquist", which each require different inputs:

  1. DM_profile = list("profile" = "NFW", "DM_vm" = 185.9, "DM_a" = 34.5, "DM_rho0" = 0.035)
  2. DM_profile = list("profile" = "Hernquist", "DM_mass" = 184.9, "DM_a" = 34.5)

As the SimSpin_example was run with a Hernquist analytic potential, we will use the second option:

S0_DM = list("profile" = "Hernquist",
             "DM_mass" = 184.9, 
             "DM_a"    = 34.5)

S0_total_3D = sim_analysis(simdata    = galaxy_file,
                           DM_profile = S0_DM)

If we want to consider the radial profiles of the disc or bulge particles in isolation, we specify the isolated data files generated using sim_data() above:

S0_disc_3D  = sim_analysis(simdata = disc_file, DM_profile = S0_DM)
S0_bulge_3D = sim_analysis(simdata = bulge_file, DM_profile = S0_DM)

In these cases, returned is a data frame containing the radial properties of the total galaxy in spherical shells of 1 kpc thickness (given the defaults bin_type = "r", rbin = 200 and rmax = 200). If you wish to consider a greater number of bins or a further radial distance from the centre, these parameters can be specified in the function. These spherical bins divide up the particles in the galaxy something like the image below:

Given that we have examined the system in three dimensions, we can now consider a comprehensive list of radial properties of the total galaxy and its components (radial, tangential and circular velocities, spin parameter and anisotropies are only defined when we consider the distribution of particles in 3D - bin_type = "r"). For example, we can examine the circular velocity and spin parameter profiles of each component in the galaxy:

The function also allows you to bin data in other ways - for example, if you need to bin your data radially along the plane of the disc, you could specify bin_type = cr to give cylindrical radial bins in the layout below:

S0_total_2D = sim_analysis(simdata    = galaxy_file,
                           bin_type   = "cr", 
                           DM_profile = S0_DM)

There is also the option to specify bin_type = z in which you consider planes above the surface of the disc, such as:

S0_total_1D = sim_analysis(simdata    = galaxy_file,
                           bin_type   = "z", 
                           DM_profile = S0_DM)

These latter two bin_type choices will give a smaller number of profiles to plot, given that properties such as the rotational velocity, spin parameter and velocity anisotropy are not well defined from projected viewpoints. Outputs will consist of velocity profiles within the chosen coordinate system, mass, density and angular momentum profiles. For example, running sim_analysis() with bin_type = "cr" will return:

Similarly, for bin_type = "z" we get:

With this information, we can then consider mass and density profiles in different directions, for example:

Overall, this is a quick and simple function that allows your simulation to be initially evaluated. For comparison to mock observation techniques, consider also running the other functions in the SimSpin package such as build_datacube() or find_lambda().