Chandra X-Ray Observatory
	(CXC)
Skip to the navigation links
Last modified: December 2013

URL: http://cxc.harvard.edu/sherpa/ahelp/link.html
Jump to: Description · Examples · Bugs · See Also


AHELP for CIAO 4.9 Sherpa v1

link

Context: modeling

Synopsis

Link a model parameter to another model parameter.

Syntax

link( par, val )

Description

The link command links model parameters together, so that the value of one model parameter is determined by the value of another model parameter. The model parameter being linked may be set to an arbitrary arithmetic expression that includes the other model parameter. The linked parameters may be thawed or frozen during the fit with commands thaw() and freeze(), and can be unlinked with the command unlink().

  • par - Sherpa model parameter to be linked
  • val - value of other model parameter or arithmetic function of other model parameter, assigned to 'par'

Example 1

sherpa> link(p1.phoindex, p1.norm)

The link() function assigns the value of the second argument to the first argument. Here, the 'phoindex' parameter of model "p1" is set to the value of the 'norm' parameter of the same model.

Example 2

sherpa> link(p1.phoindex, 1.7*p1.norm)

In this example, the value of the 'phoindex' parameter of model "p1" is set to the 'norm' parameter value multiplied by 1.7.

Example 3

The changes made by the link() function can be viewed with show_model():

sherpa> show_model()
(xsphabs.abs1 * xspowerlaw.p1)
Param        Type          Value          Min          Max      Units
   -----        ----          -----          ---          ---      -----
   abs1.nh      frozen         0.03            0        1e+05 10^22 atoms / cm^2
   p1.phoindex  thawed          1.7           -2            9           
   p1.norm      thawed            1            0        1e+24   

sherpa> link(p1.phoindex, p1.norm)

sherpa> show_model()
(xsphabs.abs1 * xspowerlaw.p1)
   Param        Type          Value          Min          Max      Units
   -----        ----          -----          ---          ---      -----
   abs1.nh      frozen         0.03            0        1e+05 10^22 atoms / cm^2
   p1.phoindex  linked            1            expr: p1.norm           
   p1.norm      thawed            1            0        1e+24           
          

Bugs

See the bugs pages on the Sherpa website for an up-to-date listing of known bugs.

See Also

contrib
renorm
data
get_bkg_plot
info
list_model_ids, show_bkg_model, show_bkg_source
modeling
add_model, add_user_pars, clean, create_model_component, delete_bkg_model, delete_model, delete_model_component, freeze, get_model, get_model_autoassign_func, get_model_component, get_model_component_image, get_model_component_plot, get_model_plot, get_num_par, get_order_plot, get_par, get_pileup_model, get_source, get_source_component_image, get_source_component_plot, guess, image_model, image_model_component, image_source, image_source_component, integrate, integrate1d, load_table_model, load_template_model, load_user_model, normal_sample, paramprompt, reset, save_model, save_source, set_bkg_model, set_full_model, set_model_autoassign_func, set_par, set_pileup_model, set_source, set_xsabund, set_xscosmo, set_xsxsect, set_xsxset, t_sample, thaw, uniform_sample, unlink
plotting
get_lrt_plot, get_lrt_results, get_pvalue_plot, get_pvalue_results, plot_cdf, plot_model, plot_model_component, plot_pdf, plot_pvalue, plot_scatter, plot_source, plot_source_component, plot_trace
psfs
delete_psf, load_conv
saving
save_delchi, save_resid
utilities
calc_chisqr, calc_energy_flux, calc_model_sum, calc_photon_flux, calc_source_sum, calc_stat, eqwidth
visualization
contour_model, contour_ratio, contour_resid, get_ratio, get_resid

Last modified: December 2013
Smithsonian Institute Smithsonian Institute

The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory. 60 Garden Street, Cambridge, MA 02138 USA.   Email:   cxchelp@head.cfa.harvard.edu Smithsonian Institution, Copyright © 1998-2017. All rights reserved.