linefinder.classify module¶
Tools for categorizing particles into different accretion modes.
@author: Daniel Angles-Alcazar, Zach Hafen @contact: zachary.h.hafen@gmail.com @status: Development
-
class
linefinder.classify.
Classifier
(out_dir, tag, ptracks_tag=<object object>, galids_tag=<object object>, halo_data_dir=<object object>, mtree_halos_index=<object object>, halo_file_tag=<object object>, not_in_main_gal_key='gal_id', classifications_to_save=['is_unaccreted', 'is_pristine', 'is_preprocessed', 'is_merger', 'is_mass_transfer', 'is_wind', 'is_hitherto_EP', 'is_hitherto_NEP', 'is_unaccreted_EP', 'is_unaccreted_NEP'], write_events=True, events_to_save=['is_in_other_gal', 'is_in_main_gal', 'is_accreted', 'is_ejected', 'redshift_first_acc', 'ind_first_acc', 'cumulative_time_in_other_gal', 'gal_event_id', 'time_in_other_gal_before_acc_during_interval', 'is_in_other_CGM'], velocity_scale='Vmax', wind_cut=1.0, absolute_wind_cut=15.0, t_pro=0.03, t_m=0.5, neg=10, main_halo_robustness_criteria='n_star', main_halo_robustness_value=100, min_gal_density=0.173, pp_classifications_to_save=['is_in_CGM', 'is_in_CGM_not_sat', 'is_in_galaxy_halo_interface', 'is_CGM_IGM_accretion', 'is_CGM_wind', 'is_CGM_satellite_wind', 'is_CGM_satellite_ISM', 'CGM_fate_classifications'])[source]¶ Bases:
object
Loads the tracked particle data, and uses that to classify the particles into different categories.
-
additional_postprocessing
(pp_classifications_to_save)[source]¶ Save additional classifications that are available as part of the analysis suite, but are not computed here.
Parameters: pp_classifications_to_save (list of strs) – Classifications available as part of Worldlines that will be saved in the classifications_*.hdf5 file.
-
calc_gal_event_id
()[source]¶ Identify potential accretion/ejection events relative to main galaxy at each redshift
Returns: GalEvent = 0 (no change), 1 (entering galaxy), -1 (leaving galaxy) at that redshift Return type: gal_event_id ( [n_particle, n_snap-1] np.ndarray of ints)
-
get_circular_velocity
()[source]¶ Get the circular velocity of the halo (measured at Rvir).
Returns: Circular velocity of the halo in km/s, indexed the same way that ahf_reader.mtree_halos[i] is. Return type: v_c
-
get_cum_num_acc
()[source]¶ Get the cumulative number of accretions so far.
Returns: Cumulative number of accretion events for that particles. Return type: cum_num_acc ([n_particle, n_snap-1] np.ndarray of ints)
-
get_cumulative_time_in_other_gal
()[source]¶ Get the amount of time in galaxies besides the main galaxy before being accreted.
For a single time in another galaxy, this is the ( age of universe at the last snapshot before the conditions are true ) - ( age of the universe at the last snapshot where the conditions are true ), and generalizes to multiple events in other galaxies.
Returns: - cumulative_time_in_other_gal ([ n_particle, n_snap ]
- np.ndarray of floats): Time in another galaxy at a given snapshot.
-
get_radial_velocity
()[source]¶ Get the radial velocity of particles, relative to the main galaxy.
Returns: The radial velocity of each particle at that redshift, relative to the main galaxy. Return type: v_r ( [n_particle, n_snap] np.ndarray )
-
get_redshift_first_acc
()[source]¶ Get the redshift of first accretion.
Returns: Redshift of first accretion. Return type: redshift_first_acc ([n_particle,] np.ndarray of floats)
-
get_time_difference
()[source]¶ Get the time between snapshots.
Returns: Time between snapshots in Myr. Return type: dt ([n_particle, n_snap-1] np.array)
-
get_time_in_other_gal_before_acc
()[source]¶ Get the amount of time in galaxies besides the main galaxy before being accreted. For a single time in another galaxy, this is the ( age of universe at the last snapshot before the conditions are true ) - ( age of the universe at the last snapshot where the conditions are true ), and generalizes to multiple events in other galaxies.
Returns: Time in another galaxy before being first accreted onto the main galaxy. Return type: time_in_other_gal_before_acc ([ n_particle, ] np.ndarray of floats)
-
get_time_in_other_gal_before_acc_during_interval
()[source]¶ Get the amount of time in galaxies besides the main galaxy before being accreted, during an interval before being accreted.
Returns: time_in_other_gal_before_acc_during_interval ([ n_particle, ] np.ndarray of floats) : Time in another galaxy before being first accreted onto the main galaxy, within some recent time interval
-
get_velocity_scale
()[source]¶ Get the characteristic velocity scale.
Returns: Velocity of the halo in proper km/s. Return type: velocity_scale (np.ndarray)
-
identify_accretion
()[source]¶ Identify ALL gas/star accretion events, i.e. whether or not a particle was outside the galaxy at one redshift, and inside at the next
-
identify_ejection
()[source]¶ Identify ALL gas wind ejection events. These conditions must be met to identify as ejection:
- Inside the main galaxy at one snapshot, and not at the previous snapshot.
- Radial velocity of the particle relative to the main galaxy
- must be greater than some fraction of the circular velocity of the main galaxy.
- Radial velocity of the particle relative to the main galaxy
- must be greater than some base speed.
- The particle must be a gas particle.
- The particle must be outside any other galaxy.
-
identify_hitherto_EP
()[source]¶ Identify particles that have been processed by another galaxy by the tabulated snapshot.
Returns: True for particle i at snapshot j if it has spent at least t_pro in another galaxy by that point. Return type: is_hitherto_EP ( [n_particle,n_snap] np.ndarray of bools )
-
identify_hitherto_NEP
()[source]¶ Identify particles that have not been processed by another galaxy by the tabulated snapshot.
Returns: True for particle i at snapshot j if it has not spent at least t_pro in another galaxy by that point. Return type: is_hitherto_EP ( [n_particle,n_snap] np.ndarray of bools )
-
identify_is_before_first_acc
()[source]¶ Identify when before a particle’s first accretion event.
Returns: If True, then the first accretion event for that particle hasn’t happened yet. Return type: is_before_first_acc ([n_particle, n_snap-1] np.ndarray of bools)
-
identify_is_in_main_gal
()[source]¶ Identify what particles are in a main galaxy. They must be in the main galaxy and not inside any other galaxy at that redshift, even a subhalo galaxy.
Returns: True if in the main galaxy (and not any other galaxy) at that redshift. Return type: is_in_main_gal ( [n_particle, n_snap-1] np.ndarray of bools)
-
identify_is_in_other_CGM
()[source]¶ Identify what particles are in a CGM besides the main CGM.
Returns: True if in a CGM other than the main CGM at that redshift. Return type: is_in_other_cgm ( [n_particle, n_snap-1] np.ndarray of bools)
-
identify_is_in_other_gal
()[source]¶ Identify what particles are in a galaxy besides the main galaxy.
Returns: True if in a galaxy other than the main galaxy at that redshift. Return type: is_in_other_gal ( [n_particle, n_snap-1] np.ndarray of bools)
-
identify_mass_transfer
()[source]¶ Boolean for whether or no particles are from mass transfer
Returns: True for particle i if it has been preprocessed but has not spent at least some minimum amount of time in another galaxy in a recent interval. Return type: is_mass_transfer (np.ndarray of bools)
-
identify_merger
()[source]¶ Boolean for whether or no particles are from galaxies merging.
Returns: True for particle i if it has been preprocessed and has spent at least some minimum amount of time in another galaxy in a recent interval. Return type: is_merger ( [n_particle] np.ndarray of bools )
-
identify_preprocessed
()[source]¶ Identify pre-proceesed gas, or “externally processed” gas.
Returns: True for particle i if it has spent at least some minimum amount of time in another galaxy before being accreted. Return type: is_preprocessed ( [n_particle] np.ndarray of bools )
-
identify_pristine
()[source]¶ Identify pristine gas, or “non-externally processed” gas.
Returns: True for particle i if it has never spent some minimum amount of time in another galaxy before being accreted. Return type: is_pristine ( [n_particle] np.ndarray of bools )
-
identify_unaccreted
()[source]¶ Identify particles never accreted onto the main galaxy.
Returns: True for particle i if it has never been inside the main galaxy. Return type: is_unaccreted ( [n_particle,] np.ndarray of bools )
-
identify_unaccreted_EP
()[source]¶ Identify particles never accreted onto the main galaxy that have spent at least t_pro in another galaxy by the specified snapshot.
Returns: True for particle i at snapshot j if it has spent at least t_pro in another galaxy by that point and never accretes onto the main galaxy. Return type: is_unaccreted_EP ( [n_particle,n_snap] np.ndarray of bools )
-
identify_unaccreted_NEP
()[source]¶ Identify particles never accreted onto the main galaxy that have not spent at least t_pro in another galaxy by the specified snapshot.
Returns: True for particle i at snapshot j if it has not spent at least t_pro in another galaxy by that point. Return type: is_unaccreted_NEP ( [n_particle,n_snap] np.ndarray of bools )
-
identify_wind
()[source]¶ Boolean for whether or not particles are from wind.
Returns: True for particle i if it has been ejected at least once before snapshot n Return type: is_wind ( [n_particle] np.ndarray of bools )
-
ind_first_acc
¶ Get the index of first accretion. This is defined as the the indice immediately after accretion happens.
Returns: Index of first accretion. Return type: ind_first_acc ([n_particle,] np.ndarray of floats)
-
ind_first_snap
¶ Find the indice for first snapshot at which the main merger tree halo is resolved.
-
main_mt_halo_first_snap
¶ Find the first snapshot at which the main merger tree halo is resolved.
-
meets_density_requirement
¶ Find particles that are either stars or have sufficient density to be counted as part of a galaxy.
-
read_data_files
()[source]¶ Read the relevant data files, and store the data in a dictionary for easy access later on.
-