AbsorberExtractor¶
-
class
salsa.AbsorberExtractor(ds_filename, ray_filename, ion_name='H I', cut_region_filters=None, wavelength_center=None, velocity_res=10, spectacle_defaults=None, spectacle_res=None, absorber_min=None, frac=0.8)¶ Bases:
objectExtracts absorbers from a trident lightray for a given ion species. Does This through two methods, by using the SPICE (Simple Procedure for Iterative Cloud Extraction) method and by fitting a synthetic spectra made by trident. Fit is done using spectacle
- Parameters
ds_filename (str or YT dataset) – Either Path/name of the dataset to be loaded or the dataset itself
ray_filename (str or Trident ray) – Path/name of the hdf5 ray file to be loaded or the ray already loaded
ion_name (string, optional) – Name of the ion to extract absorbers of Default: “H I”
cut_region_filters (list of strings, optional) – a list of filters defined by the way you use Cut Regions in YT Default: None
wavelegnth_center (float, optional) – The specific absorption line to look at (in unit Angstrom). None defaults to strongest absorption line for specified ion (using trident’s ion table). Default: None
velocity_res (float, optional) – width of velocity bins for spectra. Minimum threshold for combining absorbers in the SPICE method. Default: 10
spectacle_res (float, optional) – Set minimum resolution that spectacle will attempt to fit lines to. (in km/s) If None, default to value of velocity_res Default: None
spectacle_defaults (dict, optional) – Dictionary passed to spectacle defining default parameters/ranges when fitting absorption lines Deafult: None
absorber_min (float, optional) – Minimum Log Column Density that will be used to define an absorber. If None, defaults to either default for specific ion or 13 Default: None
frac (float, optional) – Parameter defining what fraction of the number density is being accounted for in each iteration of the SPICE method. Must be a number between 0 and 1. Default: 0.8
Methods Summary
close()close all opened files, dataset, ray
Uses spectacle to fit a trident made spectra of the specified ion.
get_spice_absorbers([fields, units_dict])Use the SPICE method to extract absorbers and then find features of absorbers.
load_ray(new_ray)loads a new ray into the multi_plot class.
ray_position_prop([units])returns positional/directional properties of the ray so that it can be used like a vector
iteratively run the cloud method to extract all the absorbers in the lightray.
Methods Documentation
-
close()¶ close all opened files, dataset, ray
-
get_spectacle_absorbers()¶ Uses spectacle to fit a trident made spectra of the specified ion.
- Returns
line_stats – Table including all line statistics found from spectacle’s fit of the spectra.
- Return type
pandas.DataFrame
-
get_spice_absorbers(fields=[], units_dict={})¶ Use the SPICE method to extract absorbers and then find features of absorbers. Default outputs column density and central velocity of the absorption line (delta_v) as well as requested fields All in a pandas dataframe.
- Parameters
fields (list, optional) – list of yt fields to extract averages of for the absorbers. Defalut: []
units_dict (dict, optional) – dictionary of fields and corresponding units to use for each field. Default: {}
- Returns
absorber_info – Dataframe of all the absorbers and their corresponding features.
- Return type
pandas.DataFrame
-
load_ray(new_ray)¶ loads a new ray into the multi_plot class. (same dataset)
- Parameters
new_ray (str or yt.ray) – either filename to rayfile or a trident ray that’s already opened
-
ray_position_prop(units='code_length')¶ returns positional/directional properties of the ray so that it can be used like a vector
- Parameters
units (str, optional) – YT defined units to return arrays in. defaults to ‘code length’. Default: ‘code_length’
- Returns
ray_begin (yt.arr) – the starting coordinates of ray
ray_end (yt.arr) – the ending coordinates of the ray
ray_length (yt.arr) – the length of the ray
ray_unit (yt.arr) – unit vector showing direction of the ray
-
run_spice()¶ iteratively run the cloud method to extract all the absorbers in the lightray.
- Returns
List of the indices that indicate the start and end of each absorber.
- Return type
final_intervals: list of tuples of int