Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

BCGs in Relaxed and Unrelaxed Halos

Using structured collections allows us to do more complicated analysis tasks with simulation particle data. To show what we mean, lets use a structured collection with halo properties and particles to do some comparisons between the galaxies in relaxed and unrelaxed halos.

  • Divide halos into relaxed and unrelaxed subsets

  • Look at their brightest cluster galaxies

  • Investigate the brightest cluster galaxy properties

Data Halo Properties Halo Particles
Tasks Select Filter Add Columns Evaluate

Filtering for Halo Relaxation

As always, let’s start by loading some data. The following line will load a file with both halo properties and particles. This creates a “Structured Collection” (for more see here), where OpenCosmo will automatically pair particles with their assigned halo, making the process of dealing with halo particles simple for the user.

First, we have to make a new column with the offset between rminr_{min}, the potential minimum, and rcomr_{com}, the center of mass. This can be done using .with_new_columns(). Note that we have to specify the dataset we want to add the column to. This is because the Structured Collection has combined a halo_properties dataset with multiple halo particle datasets (star_particles, gas_particles, etc.), and the column could be added to any of these datasets. We will add our column to the halo_properties dataset since the relaxation state is per-halo, rather than per-particle.

Now we can easily use the column to break up our data into relaxed and unrelaxed. This involves two calls to .filter() to make two new datasets.

Now let’s make some plots! We can start with something more straightforward, and look at the mass of the halos. We can also print the fraction of relaxed objects to see if we are getting reasonable results. This plot will only require us to use a .select() column query on the halo_properties dataset, no particles needed yet! See how it is done below:

<Figure size 640x480 with 1 Axes>

Our mass distribution and relaxed halo fraction is in line with what we expect!

BCG Properties

We aren’t restricted to only halo properties when using a structured collection, we also have access to particle data. Let’s use those particles to investigate the Brightest Cluster Galaxy (BCG).

Using Star Particles

We expect BCGs to have slightly different mass distributions based on the relaxation state of the cluster. To show this, let’s put a 50 kpc aperture around the potential minimum of the cluster and calculate the mass of that central galaxy using star particles.

Making a new column with the mass of the BCG will be a more complicated task, so we will forgo using .with_new_columns() and instead use .evaluate(). Evaluate takes a function of the user’s creation and can return the output of that function as a new column in the dataset. For Structured Collections, the function should always have the properties and particles needed for the calculation as input. Hence why our function below only has halo_properties and star_particles as input. From here you write the function as normal and return a dictionary, where the key will be the name of the new column and the value will be the data in the column. When writing the function, you can refer to specific columns by using the column name outright, no need for .select() or .col().

In our call to .evaluate(), we need to make sure to provide the function name, specify what columns the function uses from each dataset, decide the format of the data (numpy or astropy), and determine whether or not we want the column(s) inserted into the dataset. Make sure to always set insert = True so that your new column makes it into your datasets. By default, new columns will be added to the properities dataset.

Now we can use that column just like any other and call .select() and .get_data() to extract the column data and plot.

<Figure size 640x480 with 1 Axes>

Notice how the mass distribution of BCGs in unrelaxed halos is peaked at a slighly lower stellar mass! We can even take this a step further and plot the Stellar Mass - Halo Mass relation for these BCGs. We have all the data we need, so we just need to plot it:

<Figure size 640x480 with 1 Axes>

Adding in Gas Particles

We will incorporate gas particles into our final plots by looking at the bulk motion of stars compared to gas in the BCG. While we are at it, we can also compute the BCG velocity dispersion.

To make these columns we call .evaluate() as before, but now we also provide gas_particles as an input for the function and specify the columns we need for our calculation. Note also how our dictionary now has 4 entries, since we want to add 4 new columns to our dataset. Once again, the name of each column will be the key of each dictionary entry.

Let’s look at the stellar velocity dispersion as a function of mass first.

<Figure size 640x480 with 1 Axes>

As expected, we get a steady increase in velocity dispersion as mass increases!

Now let’s compare the bulk velocity between gas and star particles. Plots like these can help us identify highly disturbed galaxy clusters. The red line is the 1-to-1 line, where the gas and stars are moving with similar bulk velocities.

<Figure size 640x480 with 1 Axes>

As we can see, many galaxies lie close to the 1-to-1 line, but the scatter indicates clusters that are more likely to be disturbed.