generate_catalog
- salsa.generate_catalog(ds_file, n_rays, ray_directory, ion_list, method='spice', center=None, impact_param_lims=(0, 200), ray_length=200, field_parameters={}, fields=[], ftype='gas', extractor_kwargs={}, units_dict={})
Generates a catalog of absorber properties from a given number of lightrays through a dataset. Will look if lrays have already been made, otherwise will create them by uniform randomly sampling impact parameter. Uses OpenMPI to split up light ray creation and absorber extraction among processors.
- Parameters:
ds_file (str or dataset) – either path to a dataset or a loaded dataset
n_rays (int) – number of rays to sample
ray_directory (str) – path to directory where rays loaded from or will be saved if they haven’t been constructed
ion_list (list str) – list of ions to find absorbers from.
method ("spice", optional) – Choose which method to use to extract absorbers. Currently only “spice” is supported.
center (list or array, optional) – The center of the galaxy in units ‘code_length’. If None, defaults to domain_center. Default: None
impact_param_lims (tuple or list, optional) – The range on which to sample impact parameter when constructing lightrays. If no units are associated with the numbers (either astropy or unyt), the code will assume kpc. Default: (0, 200)
ray_length (float, optional) – The length of each light ray. If no units are associated (either astropy or unyt) the code will assume kpc. Default: 200
field_parameters (dict, optional) – The parameters that will be passed to trident during ray construction. This can be something like “bulk_velocity” so that a radial velocity can be saved.
fields (list of str) – YT fields to add to lightrays. Will be included in catalog if “spice” method is selected
ftype (str) – The field to be passed to trident that ion fields will be added to, i.e.
('gas', 'H_p0_number_density').'gas'should work for most grid-based simulations. For particle-based simulations this will not work and needs to be changed.'PartType0'often works though it varies. Seetrident.add_ion_fields()for more informationextractor_kwargs (dict, optional) –
Additional key word arguments to pass to the absorber_extractor to modify default extraction parameters. Either a single dict that will be passed for each ion. Or a dict of ions pointing toward individual extractor kwargs. Examples:
extractor_kwargs={'H I':{'absorber_min':14}, 'C IV':{'absorber_min':13}, 'O VI':{}}extractor_kwargs={'absorber_min':13.5}The first will set different absober mins for each ion, with O VI taking default as specified by
salsa.utils.default_cloud_dict. The second example will set the minimum absorber as 13.5 for every ion. NOTE you cannot mix the two formats. If one ion is specified then all ions must be specified (see ‘O VI’ included even though it’s dictionary is empty)Default: {}
units_dict (dict, optional) – dictionary of astropy units to use for the fields when extracting properties (only relevant for ‘spice’ method) Default: None
- Returns:
full_catalog – Table containing all of the absorbers extracted from all the lightrays. If no absorbers are found, None is returned
- Return type:
astropy QTable