ACID_code.Config
- class ACID_code.Config(**kwargs)[source]
The main class for storing ACID configuration settings, with methods to plot and save/load the configuration state.
Initialise with the defaults, overwrite with any inputted kwargs
- defaults = {'bin_size': 100, 'check_interval': 1000, 'continuum_percentile': 90, 'cores': None, 'deterministic_profile': True, 'dev_perc': 25, 'masking_lines': {'medium': {'default_width': 1000, 'lines': [3933.66, 3968.47, 5167.32, 5172.68, 5183.62]}, 'narrow': {'default_width': 200, 'lines': [3820.33, 4307.9, 4327.74, 4383.55, 5270.39, 5889.95, 5895.92, 7593.7, 8226.96]}, 'wide': {'default_width': 2000, 'lines': [3835.38, 3889.05, 4101.74, 4340.47, 4861.34, 6562.81]}}, 'max_steps': None, 'min_checks': 1, 'min_tau_factor': 50, 'moves': [('StretchMove', 0.2, {}), ('DESnookerMove', 0.1, {}), ('DEMove', 0.6, {}), ('DEMove', 0.1, {'gamma0': 1.0})], 'n_sig': 3, 'nsteps': 10000, 'nwalkers': None, 'od': True, 'order': 0, 'order_range': [0], 'parallel': True, 'pix_chunk': 20, 'poly_ord': 3, 'run_mcmc': True, 'sampler_path': None, 'sampler_progress': None, 'sampler_type': 'emcee', 'save_path': None, 'seed': None, 'skips': 1, 'tau_tol': 0.1, 'verbose': 2}
The default configuration settings for ACID, used if not set by the user. See
Acidfor more details on how these are used in ACID.
- properties = ['verbose', 'masking_lines']
Property list for error handling
- data_attributes = ['linelist', 'velocities']
For error handling if Data attributes were accidentally set in config. These should be set in
Datainstead
- data_attributes_input_str = "'{}' is a Data property and should not be set in the Config class.\nSet it directly with 'Data.{}={}' instead."
- update_hipri(**kwargs: Any) None[source]
Updates and overwrites existing keys if their values are not None.
- Parameters:
**kwargs (
dict) – Keyword arguments corresponding to the configuration settings to be updated. The keys must be valid configuration options as defined in the defaults class variable.- Raises:
KeyError – If any key in kwargs is not a valid configuration option as defined in the defaults class variable.
- update_lowpri(**kwargs: Any) None[source]
Updates but does not overwrite existing stored keys.
- Parameters:
**kwargs (
dict) – Keyword arguments corresponding to the configuration settings to be updated. The keys must be valid configuration options as defined in the defaults class variable.- Raises:
KeyError – If any key in kwargs is not a valid configuration option as defined in the defaults class variable.
- to_dict() dict[source]
Convert the Config object to a dictionary of only the stored/modified attributes, if you want the full dictionary including defaults, use to_full_dict.
- to_full_dict() dict[source]
Convert the Config object to a dictionary including all defaults and stored/modified attributes.
- property verbose: ACID_code.IntLike
The stored global verbosity setting for ACID. See
Acidfor more details on how this is used in ACID.
- property masking_lines: MaskingLines
The stored masking lines for ACID. See Using your own line masks for more details on how this is used in ACID.
- plot_masking_lines(return_fig: bool = False) None | tuple[source]
Plots the telluric and/or hydrogen lines that will be masked in the residual masking step, with shaded regions indicating the widths of the masks.
- Parameters:
return_fig (
bool, optional) – Whether to return the figure and axis objects instead of showing the plot, by default False.- Returns:
If return_fig is True,returns a tupleof(fig,ax) where fig is the matplotlib figure objectandax is the axis object.Otherwise,returns Noneandshows the plot.