| AHELP for CIAO 4.5 Sherpa v1 | get_source_component_image |
Context: modeling |
Synopsis
Returns the 2D data and coordinate settings defining the unconvolved model component image
Syntax
get_source_component_image([id], name)
Description
- id - the id of the dataset to use; if not given, uses the default dataset id (id=1 by default, see "ahelp get_default_id")
- name - the variable name(s) representing the model component(s)
The get_source_component_image() command returns the 2D data array and coordinate system settings defining an image of the unconvolved 2D model components displayed by the image_source_component() command. (The get_model_component_image command is available for returning information pertaining to images of convolved model components.) Once a 2D data set has been loaded into the Sherpa session, this command can be used to list the following attributes associated with an image of the model assigned to that data set:
| Field name | Description |
|---|---|
| name | A label for the object |
| y | The unconvolved model data (as a 2D array) |
| eqpos | Information on the world coordinate system (if available) |
| sky | Information on the physical coordinate system (if available) |
The information returned by get_source_component_image() may be stored in variables, or printed to the screen, as shown in the examples section.
Example 1
sherpa> print get_source_component_image("b1")Return the data arrays and coordinate system settings defining an image of the unconvolved Beta 2D model component "b1" associated with default data set 1.
sherpa> set_model(const2d.c1 + gauss2d.g1 + beta2d.b1)
sherpa> fit()
sherpa> image_source_component(b1)
sherpa> print get_source_component_image(b1)
name = Source_component
y = [[ 9.8039e-01 9.5238e-01 9.0909e-01 ..., 1.4885e-03 1.4771e-03
1.4658e-03]
[ 9.5238e-01 9.2593e-01 8.8496e-01 ..., 1.4884e-03 1.4770e-03
1.4657e-03]
[ 9.0909e-01 8.8496e-01 8.4746e-01 ..., 1.4883e-03 1.4769e-03
1.4656e-03]
...,
[ 2.1788e-03 2.1786e-03 2.1784e-03 ..., 8.8514e-04 8.8109e-04
8.7706e-04]
[ 2.1586e-03 2.1585e-03 2.1582e-03 ..., 8.8179e-04 8.7777e-04
8.7377e-04]
[ 2.1387e-03 2.1386e-03 2.1384e-03 ..., 8.7845e-04 8.7446e-04
8.7050e-04]]
eqpos = world
crval = [ 278.386 -10.5899]
crpix = [ 4096.5 4096.5]
cdelt = [-0.0001 0.0001]
crota = 0
epoch = 2000
equinox = 2000
sky = physical
crval = [ 3798.5 4019.5]
crpix = [ 0.5 0.5]
cdelt = [ 2. 2.]
Example 2
sherpa> set_model(2,"gauss1d.g1+const1d.c1") sherpa> gauss_image=get_source_component_image(2,"g1") sherpa> bin=gauss_image.sky.cdelt
Store the image data and settings returned by the get_model_component_image command for the Guass 2D model component "g1" (assigned to data set 2) to the variable "gauss_image". Use the "gauss_image" variable to access the image binning in physical coordinates.
Bugs
See the bugs pages on the Sherpa website for an up-to-date listing of known bugs.
See Also
- confidence
- get_conf, get_covar, get_int_proj, get_int_unc, get_proj, get_reg_proj, get_reg_unc
- contrib
- get_chart_spectrum
- data
- get_areascal, get_arf, get_arf_plot, get_axes, get_backscal, get_bkg, get_bkg_plot, get_bkg_scale, get_coord, get_counts, get_data, get_data_plot, get_dep, get_dims, get_error, get_exposure, get_grouping, get_indep, get_quality, get_rmf, get_specresp, get_staterror, get_syserror
- filtering
- get_filter
- fitting
- calc_stat_info, get_fit, get_stat_info
- info
- get_default_id, list_model_ids, list_stats, show_bkg_model, show_bkg_source
- methods
- get_draws, get_iter_method_name, get_iter_method_opt, get_method
- modeling
- add_model, add_user_pars, clean, create_model_component, delete_bkg_model, delete_model, delete_model_component, 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_response, get_source, get_source_component_plot, image_model, image_model_component, image_source, image_source_component, integrate, integrate1d, link, load_table_model, load_template_model, load_user_model, normal_sample, reset, save_model, save_source, set_bkg_model, set_full_model, set_model_autoassign_func, set_pileup_model, set_source, set_xsabund, set_xscosmo, set_xsxsect, set_xsxset, t_sample, uniform_sample
- plotting
- get_lrt_plot, get_lrt_results, get_pvalue_plot, get_pvalue_results, get_split_plot, plot_cdf, plot_lrt, plot_model, plot_model_component, plot_pdf, plot_pvalue, plot_scatter, plot_source, plot_source_component, plot_trace
- psfs
- delete_psf, get_kernel, get_psf, load_conv
- saving
- save_delchi, save_resid
- statistics
- get_chisqr_plot, get_delchi_plot, get_prior, get_sampler, get_stat
- utilities
- calc_chisqr, calc_energy_flux, calc_model_sum, calc_photon_flux, calc_source_sum, calc_stat, eqwidth, get_analysis, get_rate
- visualization
- contour_model, contour_ratio, contour_resid, get_ratio, get_resid, image_getregion

![[Sherpa Logo]](../imgs/sherpa_logo_navbar.gif)