cassis_lte_python.sim.model_setup#

Classes#

Module Contents#

class cassis_lte_python.sim.model_setup.ModelConfiguration(configuration: dict | str, verbose=True, **kwargs)#
LOGGER#
modeling#
minimize#
line_analysis#
jparams#
jmodel_fit#
log_path = b'.'#
log_file = None#
species_infos = None#
species_dict#
thresholds#
fwhm_max = 0.0#
tag_list#
cpt_list = []#
comp_config_file = None#
params = None#
norm_factors = None#
output_dir#
data_file#
data_file_obj = None#
xunit = 'MHz'#
yunit#
x_obs#
y_obs#
vlsr_file = 0.0#
vlsr_plot#
line_shift_kms#
cont_free#
bl_corr#
t_a_star#
tmb2ta = None#
jypb = None#
bmaj = None#
bmin = None#
beam#
fit_full_range = False#
fit_freq_except = []#
win_list = []#
win_list_fit = []#
win_list_plot = []#
win_list_gui = []#
win_list_file = []#
x_fit = None#
y_fit = None#
x_mod#
y_mod = None#
dfmhz#
franges_mhz = []#
fmin_mhz#
fmax_mhz#
mask = []#
f_err_mhz_max#
sort#
line_list_all = None#
tr_list_by_tag = None#
snr_threshold#
bandwidth#
oversampling#
tcmb#
tau_max#
file_rejected = None#
constraints#
latest_valid_params = None#
tau_lim#
max_iter#
fit_kws#
print_report#
print_debug#
base_name#
save_configs#
save_results#
save_infos_components#
save_model_spec#
save_obs_spec#
plot_kws#
user_plot_kws#
plot_gui#
gui_kws#
plot_file#
file_kws#
exec_time#
load_json(config_file, **kwargs)#
get_data(config=None)#
get_jypb(config=None)#
get_continuum(config=None)#
get_tuning_info(config=None)#
get_linelist(verbose=True)#

Retrieving lists of transitions.

Parameters:

verbose

True (default) or 2.

  • if True, print number of transitions w/i thresholds

  • if 2, print infos for each transition

Returns:

None

line_list_all (dataframe): the list of all transitions (no thresholds, except f_err_mhz_max) line_list_all_by_tag (dictionary): the list of transitions (no thresholds), for each tag tr_list_by_tag (dictionary): the list of transitions (w/i thresholds if applies), for each tag If computing a model only or fitting by velocity, apply thresholds.

get_v_range_info()#
get_rms_cal_info(rms_cal_info=None)#
get_tag_list_from_sp_dict(labels)#
read_comp_infos(lines_from_file, cpt_dict=None)#
read_comp_params(lines_from_file, cpt_dict=None)#
read_sp_table(cpt_dict=None, **kwargs)#
read_sp_block(blocks_from_file, cpt_dict=None)#
get_components(cpt_info)#

Creates the components.

Parameters:

cpt_info – dictionary with the components’ information ; can contain an item providing a config file

Returns:

None

Possible formats for the config file :

  1. (componentConfig.txt)

    Whether a component is interacting and infos (min, value, max, vary) on size, tex, vlsr, fwhm e.g.: c1_interacting True […] # Add at least 3 lines per component (size, tex, vlsr) ; can add a 4th line with fwhm info name min value max vary # do not change this line c1_size 1 2 3 True c1_tex 100 200 300 True c1_vlsr 0 3 5 True c1_fwhm 2.0 5.0 12.0 True

  2. (infosComponentSpecies.txt)

    List of species (or key) per component Whether component is interacting Infos (min, value, max, vary) on size, tex, vlsr, fwhm Table with thresholds and column density info e.g.: c1_species CH3OHs […] c1_interacting True […] name min value max vary # do not change this line c1_size 1 1 3 False c1_tex 100 350 1000 True c1_vlsr 5 6.7 8 True c1_fwhm 1.5 3.5 6.5 False c2_size 1 1 50 False c2_tex 5 160 450 True c2_vlsr 5 7 8 True c2_fwhm 0.9 1.8 4.4 False […] tag eup_min eup_max aij_min aij_max err_max c1_ntot c1_ntot_min_fact c1_ntot_max_fact 28503 0.0 300.0 1.0e-6 * 3 6.0e17 1e-3 1e3

  3. (infosComponentSpecies.txt)

    Infos (min, value, max, vary) on size, tex, vlsr, fwhm plus one block per species with thresholds and column density (species and interacting are in the user’s script) e.g.: name min value max vary # do not change this line c1_size 1 6 10 False c1_tex 50 100 150 False c1_vlsr 2 4 6 True c1_fwhm 2.0 4.5 12.0 False […] tag eup_min eup_max aij_min aij_max err_max 44501 0.0 600.0 1.0e-6 * 3 name min value max vary # do not change this line c1_ntot 1e-3 1.0e15 1e3 True c2_ntot 1e-3 1.0e14 1e3 True c3_ntot 1e-3 1.0e14 1e3 True

get_windows(verbose=True)#
get_velocity_ranges()#
get_data_to_fit(init=False, update_x=False)#
make_params(json_params: str | None = None, normalize=False, user_value=False)#
cpt_dict()#
update_tag_list(new_tags, ref_cpt_list=None)#
update_parameters(new_pars)#
flux_rms_per_species(win_list=None)#
avg_snr_per_species(win_list=None)#
property parameters#
property x_file#
property y_file#
property tc#
property cont_info#
property rms_cal#
property file_spec#
property output_files#
property name_config#
property name_lam#
class cassis_lte_python.sim.model_setup.Component(name: str, species_list: list, is_interacting=False, vlsr: int, float, dict = None, size: int, float, dict = None, tex: int, float, dict = 100.0, fwhm: int, float, dict = None)#
LOGGER#
name#
isInteracting = False#
transition_list = None#
as_json()#
check_tex_bounds()#
get_fwhm(transition)#
get_tex(transition)#
get_ntot(transition)#
property vlsr#
property size#
property tex#
property fwhm#
property tmax#

Returns the maximum temperature in K for which the partition function of all species is defined.

property tmin#

Returns the minimum temperature in K for which the partition function of all species is defined.

property tag_list#

Returns the list of tags.

property init_tag_list#
property species_list#

Returns the list of Species objects.

property species_dict#

Returns a dictionary with (key, val) = (tag, Species object).

property parameters#

Returns a dictionary with (key, val) = (parameter name, Parameter object) for the following variables: vlsr, size, tex, fwhm, ntot of each species in species_list.

class cassis_lte_python.sim.model_setup.Window(transition=None, plot_nb=0, name='', v_range_fit=None, f_range_fit=None, rms=None, cal=None, x_mod=None, bl_corr=False, v_ref_kms=0.0)#
transition = None#
plot_nb = 0#
f_ranges_nofit = []#
y_mod_cpt#
y_mod_err_cpt#
bottom_unit = 'MHz'#
top_unit = 'MHz'#
bottom_lim = None#
top_lim = None#
x_mod_plot = None#
x_file_plot = None#
other_species_selection = None#
main_lines_display#
other_lines_display#
other_species_display#
tag_colors#
set_rms_cal(rms_cal_df)#
compute_f_range_fit(vlsr_ref)#
property name#
property v_range_fit#
property v_ref_kms#
property delta_v_range_fit#
property f_range_fit#
property v_range_plot#
property f_range_plot#
property rms#
property cal#
property x_fit#
property y_fit#
property in_fit#
property x_mod#
property y_mod#
property y_mod_err#
property x_file#
property y_file#
property y_res#
property y_min#
property y_max#