Calculating rotation measure for TNG 100-1 subhalo

Nikita Agarwal
  • 16 Dec '21

Hi Dylan,

I have plotted a particular subhalo as a function of its density parameter (TNG 100-1 catalog).
Kindly request you to help me with the below queries:

 1. How can I calculate the rotation measure value of the subhalo with the TNG 100-1 data available.

 2. I have made my plot with the gas_pos[:,0] as x coordinates and gas_pos[:,2] as y coordinates. How can I find at what slice value of gas_pos[:,1] is the figure plotted?

My code is as :

gas = il.snapshot.loadSubhalo(basePath,99 , 96500, 'gas', fields=None)
    subhalo = il.groupcat.loadSingle(basePath, 99, subhaloID=96500)

if ('Coordinates' in gas.keys() ):
    header = il.groupcat.loadHeader(basePath,i)

    a = 1 / (1 + header['Redshift'])
    ckpc = kpc*a 

    gas = il.snapshot.loadSubhalo(basePath,99 , 96500, 'gas', fields=None)
    subhalo = il.groupcat.loadSingle(basePath, 99, subhaloID=96500)

    gas_pos =(gas['Coordinates'])
    sub_pos = subhalo['SubhaloPos']

    gas_pos =(gas['Coordinates'])*ckpc/h  #kiloparsec
    sub_pos =(subhalo['SubhaloPos'])*ckpc/h

    x = (gas_pos[:,0] -  sub_pos[0])/kpc
    y = (gas_pos[:,1] -  sub_pos[1])/kpc
    z = (gas_pos[:,2] -  sub_pos[2])/kpc

    xc = (np.max(x)+np.min(x))/2
    yc = (np.max(y)+np.min(y))/2
    zc = (np.max(z)+np.min(z))/2

    rho = (gas['Density'])*((1e10*Msun/h)/(ckpc/h)**3)

    make_plot1(rho,'cmr.rainforest',1e-29,1e-23,'Density','Density')

    def make_plot1(param,color,lval,hval,title,label):
    nPixels = [300,300]
    extent = [xc-100,xc+100,zc-100,zc+100]
    grid, _, _, _ = binned_statistic_2d(x,z, param, 'sum', bins=nPixels)

    fig, ax = plt.subplots(figsize=[8,8])
    im = ax.imshow(grid,extent = extent, cmap=color,interpolation='nearest', aspect = 'auto',origin = 'lower', norm = LogNorm(vmin = lval, vmax = hval))

    plt.title(title + "\n Redshift={r}".format( r="{:.2f}".format(header['Redshift'])))
    plt.colorbar(im,label = label)
    plt.xlabel('kpc',fontsize = 20)
    plt.ylabel('kpc',fontsize = 20)
    plt.show()

My output is:

Screenshot from 2021-12-16 11-22-23.png

Kind regards,
Nikita

Dylan Nelson
  • 16 Dec '21

Dear Nikita,

(1) Do you mean the Faraday rotation measure? Then you will have to try to follow the mathematical definition of this quantity to calculate it. I'm afraid I don't have a simple solution to offer.

(2) If you create a 2D histogram of "x" versus "z" simulation coordinates versus each other, as you have done, and ignore the "y" coordinate, then you have effectively made a projection along this direction, including all cells (which you have loaded), regardless of their y-coordinate. Note that calculating a column density (summing masses, then dividing by the pixel area) may make more physical sense than calculating a sum of densities.

Nikita Agarwal
  • 19 Dec '21

Dear Dylan,
Thank you for your inputs.

Will try this and reach out if I have further queries.

Kind regards,
Nikita

Nikita Agarwal
  • 21 Dec '21

Dear Dylan,

Since in a 3D space, Density is a function of x,y,z is there any way to obtain 3D data separately for density for each of x,y, and z in TNG 100-1? Similarly, is there a way to obtain 3D data for Electron Abundance, Neutral Hydrogen Abundance, and for each component of Velocity?

Kind regards,
Nikita

Dylan Nelson
  • 21 Dec '21

Dear Nikita,

You should think of the gas cells in the snapshot as a scattered point set, which provides samples of gas properties (including all those you mentioned, please see documentation) at x,y,z positions in space (given by the Coordinates dataset).

  • Page 1 of 1