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

Commit id: cfc1ed60fe84238015f2b2e2bc59ac2ce5ae9a34

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 \underline{command \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}, and \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 \underline{code \textbf{code  snipet} \ref{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.