Exemple #1
0
            mpeak = float(halo[61]) / .7
            #Add the halo values to the lists to be written to an ascii file.
            Id_list.append(Id)
            pid_list.append(pid)
            mvir_list.append(mvir)
            mpeak_list.append(mpeak)
            stellar_mass_10rvir_list.append(
                stellar_mass_10rvir.in_units('Msun'))
            stellar_mass_15rvir_list.append(
                stellar_mass_15rvir.in_units('Msun'))
            stellar_mass_20rvir_list.append(
                stellar_mass_20rvir.in_units('Msun'))
            stellar_mass_rvir_list.append(stellar_mass_rvir.in_units('Msun'))
            darkmatter_mass_rvir_list.append(
                darkmatter_mass_rvir.in_units('Msun'))
            gas_mass_rvir_list.append(gas_mass_rvir.in_units('Msun'))

            #Now make the xyz graphs if wanted.
            if gen_xyz == 'True':
                #check if the current Id is in the top X halos we want graphs for
                if Id in largest_halo_ids:
                    rvirprj.rvirprojections(ds, center, rvir, sp, out_dir,
                                            VELA_a, Id)

        #Now write the halo mass information to an ascii file
        file_name = '%s/halomass%s.ascii' % (out_dir, VELA_a)
        data = Table([Id_list, pid_list, mvir_list, mpeak_list, stellar_mass_10rvir_list, stellar_mass_15rvir_list, stellar_mass_20rvir_list, stellar_mass_rvir_list, gas_mass_rvir_list, darkmatter_mass_rvir_list],\
                     names=['Id[1]', 'Pid[5]', 'Mvir[11]', 'Mpeak[61]', 'stars_.1rvir', 'stars .15rvir', 'stars .2rvir',\
                           'stars rvir', 'gas rvir', 'dark rvir'])
        ascii.write(data, output=file_name, overwrite=True)
            gas_mass_010, gas_mass_015, gas_mass_020 = None, None, None
            stellar_halfmass_010, stellar_halfmass_015, stellar_halfmass_020 = None, None, None
            stellar_halfmass_010_delta, stellar_halfmass_015_delta, stellar_halfmass_020_delta = None, None, None

            x = ds.quan(float(halo[17]), 'Mpccm/h')
            y = ds.quan(float(halo[18]), 'Mpccm/h')
            z = ds.quan(float(halo[19]), 'Mpccm/h')
            mvir = ds.quan(float(halo[10]), 'Msun/h')
            rvir = ds.quan(float(halo[11]), 'kpccm/h')
            rockstar_id = float(halo[1])
            center = [x, y, z]
            print(rvir.in_units('kpc'), center)

            sp_proj = ds.sphere(center, (float(rvir.in_units('kpc')), 'kpc'))

            rvirprj.rvirprojections(ds, center, rvir, sp_proj, out_dir,
                                    current_scale, rockstar_id, count)
            count = count + 1

            sp = ds.sphere(center, (float(rvir.in_units('kpc')) * 2.25, 'kpc'))

            radius_bins = ds.arr(
                np.linspace(0, float(rvir.in_units('kpc')) * 2.25, num=100),
                'kpc')
            print(rockstar_id)
            #print(radius_bins)

            #add set varialbles to none so if they do not get set, we see that when the get written

            rp_gas = yt.create_profile(sp,
                                       'radius', [('gas', 'cell_mass')],
                                       accumulation=True,
Exemple #3
0
            mpeak = float(halo[61]) / .7
            #Add the halo values to the lists to be written to an ascii file.
            Id_list.append(Id)
            pid_list.append(pid)
            mvir_list.append(mvir)
            mpeak_list.append(mpeak)
            stellar_mass_10rvir_list.append(
                stellar_mass_10rvir.in_units('Msun'))
            stellar_mass_15rvir_list.append(
                stellar_mass_15rvir.in_units('Msun'))
            stellar_mass_20rvir_list.append(
                stellar_mass_20rvir.in_units('Msun'))
            stellar_mass_rvir_list.append(stellar_mass_rvir.in_units('Msun'))
            darkmatter_mass_rvir_list.append(
                darkmatter_mass_rvir.in_units('Msun'))
            gas_mass_rvir_list.append(gas_mass_rvir.in_units('Msun'))

            #Now make the xyz graphs if wanted.
            if gen_xyz == 'True':
                #check if the current Id is in the top X halos we want graphs for
                if Id in largest_halo_ids:
                    rvirprj.rvirprojections(ds, center, rvir, sp, out_dir,
                                            current_scale, Id)

        #Now write the halo mass information to an ascii file
        file_name = '%s/halomass%s.ascii' % (out_dir, current_scale)
        data = Table([Id_list, pid_list, mvir_list, mpeak_list, stellar_mass_10rvir_list, stellar_mass_15rvir_list, stellar_mass_20rvir_list, stellar_mass_rvir_list, gas_mass_rvir_list, darkmatter_mass_rvir_list],\
                     names=['Id[1]', 'Pid[5]', 'Mvir[11]', 'Mpeak[61]', 'stars_.1rvir', 'stars .15rvir', 'stars .2rvir',\
                           'stars rvir', 'gas rvir', 'dark rvir'])
        ascii.write(data, output=file_name, overwrite=True)