Fitting Helike Triplet Line Ratios in ISIS  

Helike TripletsThe heliumlike triplet lines are important astrophysical diagnostics. In particular, the forbidden to intercombination line ratio, f/i, is primarily density sensitive. The ratio of the sum of forbidden and intercombination to the resonance line, (f+i)/r, is sensitive to temperature.I have written some ISIS functions to facilitate fitting of these ratios directly. A single ISIS/SLang source file, triplet_fit.sl contains functions which define a triplet of gaussians and uses linking of parameter functions to define the ratios. These ratios can then be fit parameters, and confidence limits derived explicitly. The funtions have been designed to hide the complications of parameter linking, and to avoid collisions with other model components. In a sense, a triplet can be added as a group to some other model. ExampleFor example, this figure is a simulation of an idealized Ne IX triplet region (no blends, no continuum). The upper panel shows the simulated spectrum (black), a fit (red), residuals (lower pane of top plot), and the contour map of G vs R in the lower plot. The ``+'' is the best fit, and the ``O'' marks the truth.
The above plot was made with triplet_fit_demo.sl which uses supporting functions in triplet_sim.sl, and requires a grating ARF and RMF. The demo also continues to show how to add additional model components, such as blends and a continuum. It is hopefully clear from the demo how this could be applied to real observations. Download AllDownload a compressed tar file contaning the source, demo script and functions, and ARF and RMF for simulations: triplet1.1.tgz.Function ReferenceThe functions are documented in the source file, and usage is copied below. See the demo above for specific usage instances.%% Public functions: %% %% triplet_init_fun( w, f, dw ) %% triplet_link_R( flag ) %% triplet_link_G( flag ) %% triplet_fit_info() %% triplet_map_GR( nconf ) %% triplet_plot_GR( [ hidx,] conf_struct[, device] ) %% triplet_keepopen( flag ) %% triplet_close_plot() %% triplet_cmap_xra( [xmin][, xmax]] ) ; %% triplet_cmap_yra( [ymin][, ymax]] ) ; %% triplet_set_params( w, f, dw ) ; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % USAGE: triplet_init_fun( w, f, dw ) ; % % Define the triplet function, but don't yet tie params. w,f,dw are % 3element arrays, in order of [r,i,f], for initial line parameters % for wavelength, flux, and wavelength range halfwidth. % Each is a 3element array. % Initializes model without lineratio parameter linking (see % triplet_link_R(), triplet_link_G() ). Also see % triplet_set_params(). % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % USAGE: triplet_link_R( [01] ) ; % % Links parameters via functions to make f = i*R % Argument of 1 turns linking on; 0 turns off. % Relies on fit_fun from triplit_init_fun(). % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % USAGE: triplet_link_G( [01] ) ; % % Links parameters via functions to make r = (f+i)/G % Argument of 1 turns linking on; 0 turns off. % Relies on fit_fun from triplit_init_fun(). % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % USAGE: triplet_fit_info; % % Print some information about the model, as a reference for the % model component indices and the r, i, and f lines. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % USAGE: cmap = triplet_map_GR( num_conf_grid ) ; % % Compute confidence contour map with num_conf_grid grid points in % both x and y. Assumes a good fit has already been done to noticed % datasets. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % USAGE: triplet_plot_GR( [hist_idx,] conf_map_struct [, device] ); % % Plot the contours of G vs R. If no spectrum histogram integer index % is given, a value of 1 is assumed. If no device string is given, % "/xwin" is assumed, and opened if not already. (E.g, to plot to a % ps file, use an argument of the form, "filename.ps/vcps"). % conf_map_struct is the confidence map structure returned by % triplet_map_GR(). % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % USAGE: triplet_keepopen( [01] ) ; % % To append plots to hardcopy file, keep the device open after % triplet_plot_GR(), if argument is 1. If argument is 0, then % triplet_plot_GR() will automatically close the postscript device. % For an argument of 1, the device must be closed manually with % triplet_close_plot(). % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % USAGE: triplet_close_plot() ; % % Close the postscript device opened by triplet_plot_GR(), and left % open via triplet_keepopen(1) to allow overplots on the contour % panel. After closing, change to the "xwin" device, if opened with a % prior triplet_plot_GR() to the screen. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % USAGE: triplet_cmap_xra( [xmin][, xmax]] ) ; % USAGE: triplet_cmap_yra( [ymin][, ymax]] ) ; % % Provide confidence contour plot xrange, yrange functions, in order % to override autoscaling. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % USAGE: triplet_set_params( w, f, dw ) ; % % Set the parameters given 3 fluxes and 3 wavelengths, [r,i,f] % dw is delta for tolerance on wavelength min, max param range. % Set sigma to small (unresolved) value. All 3 arguments should be % 3element arrays. % % This can be used to initialize the triplet function parameters % without changing the model definition, and without knowing the % indices or names of the triplet components. Note that this sets the % gaussian sigmas to a frozen and unresolved value of 0.001 (which is % appropriate for use with a grating RFM). % 
This page was last updated May 5, 2005 by David P. Huenemoerder. To comment on it or the material presented here, send email to dph@space.mit.edu.