Jamie Budynkiewicz edited User Models and Templates.tex  about 10 years ago

Commit id: 7c37e8cefb23e97270e61ab8076c937830622ff6

deletions | additions      

       

Keeping with our requirements of developing an extensible SED analysis tool, we provide a user-end interface for adding custom models, templates, and template libraries for the fitting engine to use in a Custom Fit Models Manager. Other widely-used SED fitting programs (EXAMPLES) offer these features as well.  Sherpa, Iris' fitting engine, provides \textbf{command line functions} for users to add their own models and templates to a Sherpa session. We wrap a GUI around Sherpa's \texttt{sherpa.astro.ui.utils} functions \texttt{load_user_model}, \texttt{load_table_model}, \texttt{load_template_model}, \texttt{load\_user\_model}, \texttt{load\_table\_model}, \texttt{load\_template\_model},  and \texttt{add_user_pars} \texttt{add\_user\_pars}  for streamlined integration and user-friendliness. The user provides the full path to the directory where the models and templates exist, as well as information about the parameters. Installing a model saves a copy of the model files in the user's home directory (in \~{}/.vao/iris/components), allowing the user to apply the models in future sessions. %; in this way, both users familiar or unacquainted with Sherpa will   \subsection{Custom Python Functions}  Iris accepts custom models written as Python functions saved in *.py files. Any number of functions can be written in the file. The function must take two parameters: the first is an iterable of the model parameters, the second is a placeholder for the spectral axis, 'x.' One caveat is that the spectral data (x) must be in terms of Angstroms. For example, a model file for a modified black body  \(B_{\nu}(T) \left(\frac{\nu}{\nu_{0}}\right)^{\beta}\)  could be defined as in \textbf{code snipet} \ref{user_model_example}. \ref{sec:user_model_example}.  User models can be arbitrarily combined with other custom or preset model functions. \subsection{Table Models}  A table model is a single template, having just the x and y coordiantes. Iris accepts two-columned ASCII files as table models, following the convention where the first column is the spectral values (in Angstroms) and the second contains the fluxes (in photons/s/cm^{2}/\AA). The fit returns the normalization constant (or amplitude) of the model.  \subsection{Template Libraries}  The template model is essentially a list of table models with parameters other than the amplitude. Like the load_template_model \texttt{load\_template\_model}  function in Sherpa, the user must create an index file which lists the parameter values of the templates and the full path to the template those parameter values describe (see Figure \ref{fig:user_models} for an example). Sherpa uses a grid-search method to find the best-fit template.