Exemple #1
0
    def test_software_rotvel_alignment_GAS(self):
        print(f"{' SOFTWARE TEST ':*^60}")
        data_required = {
            'partType0':
            ['mass', 'coordinates', 'velocity', 'temperature', 'sphdensity'],
            'partType1': ['mass', 'coordinates', 'velocity'],
            'partType4': ['mass', 'coordinates', 'velocity'],
            'partType5': ['mass', 'coordinates', 'velocity']
        }

        for sim in ['celr_e', 'celr_b', 'macsis']:

            cluster = Cluster(simulation_name=sim,
                              clusterID=0,
                              redshift='z000p000',
                              comovingframe=False,
                              requires=data_required)

            # cluster.info()

            print(f"\n {sim}{' | halo 0 | z=0 ':-^60}")
            pec_velocity = cluster.group_zero_momentum_frame()
            ang_momentum = cluster.group_angular_momentum()
            angle = cluster.angle_between_vectors(pec_velocity, ang_momentum)
            print(f"pec_velocity = {pec_velocity}")
            print(f"ang_momentum = {ang_momentum}")
            print(f"angle = {angle}")
ax.scatter([x0], [y0], marker='*', c='r', s=40, alpha=1)
ax.plot([x0, x0 + a_vec[0]], [y0, y0 + a_vec[1]],
        marker=None,
        c='lime',
        lw=1,
        alpha=1)
ax.plot([x0, x0 + b_vec[0]], [y0, y0 + b_vec[1]],
        marker=None,
        c='lime',
        lw=1,
        alpha=1)
plot_ellipse(x_cent=x0,
             y_cent=y0,
             semimaj=a_val,
             semimin=b_val,
             phi=cluster.angle_between_vectors(a_vec[:2], [0, 1]),
             ax=ax,
             plot_kwargs={
                 'color': 'r',
                 'linestyle': '-',
                 'linewidth': 3,
                 'alpha': 0.8
             })

items_labels = r"""POINT PARTICLE MAP
Cluster {:s} {:d}
$z$ = {:.2f}
$R_{{500\ true}}$ = {:.2f} Mpc
Triaxiality = {:.2f}
Circularity = {:.2f}""".format(cluster.simulation, cluster.clusterID,
                               cluster.z, cluster.r500,