def test_set_param(): param = get_para() elemental_lines = ['Ar_K', 'Fe_K', 'Ce_L', 'Pt_M'] MS = ModelSpectrum(param, elemental_lines) MS.assemble_models() # get compton model compton = MS.mod.components[0] input_param = {'bound_type': 'other', 'max': 13.0, 'min': 9.0, 'value': 11.0} _set_parameter_hint('coherent_sct_energy', input_param, compton)
def test_set_param_hint(): param = get_para() elemental_lines = ['Ar_K', 'Fe_K', 'Ce_L', 'Pt_M'] bound_options = ['none', 'lohi', 'fixed', 'lo', 'hi'] MS = ModelSpectrum(param, elemental_lines) MS.assemble_models() # get compton model compton = MS.mod.components[0] for v in bound_options: input_param = {'bound_type': v, 'max': 13.0, 'min': 9.0, 'value': 11.0} _set_parameter_hint('coherent_sct_energy', input_param, compton) p = compton.make_params() if v == 'fixed': assert_equal(p['coherent_sct_energy'].vary, False) else: assert_equal(p['coherent_sct_energy'].vary, True)