cassis_lte_python.sim.model_setup ================================= .. py:module:: cassis_lte_python.sim.model_setup Classes ------- .. autoapisummary:: cassis_lte_python.sim.model_setup.ModelConfiguration cassis_lte_python.sim.model_setup.Component cassis_lte_python.sim.model_setup.Window Module Contents --------------- .. py:class:: ModelConfiguration(configuration: dict | str, verbose=True, **kwargs) .. py:attribute:: LOGGER .. py:attribute:: modeling .. py:attribute:: minimize .. py:attribute:: line_analysis .. py:attribute:: jparams .. py:attribute:: jmodel_fit .. py:attribute:: log_path :value: b'.' .. py:attribute:: log_file :value: None .. py:attribute:: species_infos :value: None .. py:attribute:: species_dict .. py:attribute:: thresholds .. py:attribute:: fwhm_max :value: 0.0 .. py:attribute:: tag_list .. py:attribute:: cpt_list :value: [] .. py:attribute:: comp_config_file :value: None .. py:attribute:: params :value: None .. py:attribute:: norm_factors :value: None .. py:attribute:: output_dir .. py:attribute:: data_file .. py:attribute:: data_file_obj :value: None .. py:attribute:: xunit :value: 'MHz' .. py:attribute:: yunit .. py:attribute:: x_obs .. py:attribute:: y_obs .. py:attribute:: vlsr_file :value: 0.0 .. py:attribute:: vlsr_plot .. py:attribute:: line_shift_kms .. py:attribute:: cont_free .. py:attribute:: bl_corr .. py:attribute:: t_a_star .. py:attribute:: tmb2ta :value: None .. py:attribute:: jypb :value: None .. py:attribute:: bmaj :value: None .. py:attribute:: bmin :value: None .. py:attribute:: beam .. py:attribute:: fit_full_range :value: False .. py:attribute:: fit_freq_except :value: [] .. py:attribute:: win_list :value: [] .. py:attribute:: win_list_fit :value: [] .. py:attribute:: win_list_plot :value: [] .. py:attribute:: win_list_gui :value: [] .. py:attribute:: win_list_file :value: [] .. py:attribute:: x_fit :value: None .. py:attribute:: y_fit :value: None .. py:attribute:: x_mod .. py:attribute:: y_mod :value: None .. py:attribute:: dfmhz .. py:attribute:: franges_mhz :value: [] .. py:attribute:: fmin_mhz .. py:attribute:: fmax_mhz .. py:attribute:: mask :value: [] .. py:attribute:: f_err_mhz_max .. py:attribute:: sort .. py:attribute:: line_list_all :value: None .. py:attribute:: tr_list_by_tag :value: None .. py:attribute:: snr_threshold .. py:attribute:: bandwidth .. py:attribute:: oversampling .. py:attribute:: tcmb .. py:attribute:: tau_max .. py:attribute:: file_rejected :value: None .. py:attribute:: constraints .. py:attribute:: latest_valid_params :value: None .. py:attribute:: tau_lim .. py:attribute:: max_iter .. py:attribute:: fit_kws .. py:attribute:: print_report .. py:attribute:: print_debug .. py:attribute:: base_name .. py:attribute:: save_configs .. py:attribute:: save_results .. py:attribute:: save_infos_components .. py:attribute:: save_model_spec .. py:attribute:: save_obs_spec .. py:attribute:: plot_kws .. py:attribute:: user_plot_kws .. py:attribute:: plot_gui .. py:attribute:: gui_kws .. py:attribute:: plot_file .. py:attribute:: file_kws .. py:attribute:: exec_time .. py:method:: load_json(config_file, **kwargs) .. py:method:: get_data(config=None) .. py:method:: get_jypb(config=None) .. py:method:: get_continuum(config=None) .. py:method:: get_tuning_info(config=None) .. py:method:: get_linelist(verbose=True) Retrieving lists of transitions. :param verbose: True (default) or 2. - if True, print number of transitions w/i thresholds - if 2, print infos for each transition :return: 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. .. py:method:: get_v_range_info() .. py:method:: get_rms_cal_info(rms_cal_info=None) .. py:method:: get_tag_list_from_sp_dict(labels) .. py:method:: read_comp_infos(lines_from_file, cpt_dict=None) .. py:method:: read_comp_params(lines_from_file, cpt_dict=None) .. py:method:: read_sp_table(cpt_dict=None, **kwargs) .. py:method:: read_sp_block(blocks_from_file, cpt_dict=None) .. py:method:: get_components(cpt_info) Creates the components. :param cpt_info: dictionary with the components' information ; can contain an item providing a config file :return: 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 .. py:method:: get_windows(verbose=True) .. py:method:: get_velocity_ranges() .. py:method:: get_data_to_fit(init=False, update_x=False) .. py:method:: make_params(json_params: str | None = None, normalize=False, user_value=False) .. py:method:: cpt_dict() .. py:method:: update_tag_list(new_tags, ref_cpt_list=None) .. py:method:: update_parameters(new_pars) .. py:method:: flux_rms_per_species(win_list=None) .. py:method:: avg_snr_per_species(win_list=None) .. py:property:: parameters .. py:property:: x_file .. py:property:: y_file .. py:property:: tc .. py:property:: cont_info .. py:property:: rms_cal .. py:property:: file_spec .. py:property:: output_files .. py:property:: name_config .. py:property:: name_lam .. py:class:: 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) .. py:attribute:: LOGGER .. py:attribute:: name .. py:attribute:: isInteracting :value: False .. py:attribute:: transition_list :value: None .. py:method:: as_json() .. py:method:: check_tex_bounds() .. py:method:: get_fwhm(transition) .. py:method:: get_tex(transition) .. py:method:: get_ntot(transition) .. py:property:: vlsr .. py:property:: size .. py:property:: tex .. py:property:: fwhm .. py:property:: tmax Returns the maximum temperature in K for which the partition function of all species is defined. .. py:property:: tmin Returns the minimum temperature in K for which the partition function of all species is defined. .. py:property:: tag_list Returns the list of tags. .. py:property:: init_tag_list .. py:property:: species_list Returns the list of Species objects. .. py:property:: species_dict Returns a dictionary with (key, val) = (tag, Species object). .. py: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. .. py:class:: 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) .. py:attribute:: transition :value: None .. py:attribute:: plot_nb :value: 0 .. py:attribute:: f_ranges_nofit :value: [] .. py:attribute:: y_mod_cpt .. py:attribute:: y_mod_err_cpt .. py:attribute:: bottom_unit :value: 'MHz' .. py:attribute:: top_unit :value: 'MHz' .. py:attribute:: bottom_lim :value: None .. py:attribute:: top_lim :value: None .. py:attribute:: x_mod_plot :value: None .. py:attribute:: x_file_plot :value: None .. py:attribute:: other_species_selection :value: None .. py:attribute:: main_lines_display .. py:attribute:: other_lines_display .. py:attribute:: other_species_display .. py:attribute:: tag_colors .. py:method:: set_rms_cal(rms_cal_df) .. py:method:: compute_f_range_fit(vlsr_ref) .. py:property:: name .. py:property:: v_range_fit .. py:property:: v_ref_kms .. py:property:: delta_v_range_fit .. py:property:: f_range_fit .. py:property:: v_range_plot .. py:property:: f_range_plot .. py:property:: rms .. py:property:: cal .. py:property:: x_fit .. py:property:: y_fit .. py:property:: in_fit .. py:property:: x_mod .. py:property:: y_mod .. py:property:: y_mod_err .. py:property:: x_file .. py:property:: y_file .. py:property:: y_res .. py:property:: y_min .. py:property:: y_max