Next Previous Up Contents
Next: Performing the Fit
Up: How to fit spectra using Yafit
Previous: Preparing Observation Data

3.2 Preparing Model Data

Before fitting, you must prepare your set of model spectra in a way that the program can understand. Yafit understands a number of model formats, including outputs from certain spectral simulation codes. You can either provide your models in one of these formats directly or convert them to the special .ymod format prior to use. The copymodel task can convert from the various foreign model formats to .ymod, optionally applying custom transformations to the data. Even if your model data is in one of the formats that Yafit understands, you may wish to use copymodel so as to apply these additional conversions, for instance annotating or modifying the units on the X (wavelength) or Y (flux) axes to match those presented in the observation data.

Here is an example invocation of copymodel:

   yafit copymodel ifmt=galaxev
                   in=bc2003_salp.a1 in=bc2003_salp.a2 
                   xname=Wavelength xunit=Angstrom
                   yname=Luminosity yunit=erg/s
                   y=3.826e33*y
                   out=gal.ymod
In detail, this works as follows:
ifmt=galaxev
Gives the format in which the input files will be supplied. galaxev is one of the formats that Yafit understands (see Section 4).
in=bc2003_salp.a1 in=bc2003_salp.a2
Names the two input files in galaxev format. Any number of input model files can be given - they will be concatenated together before output.
xname=Wavelength xunit=Angstrom
Labels the axis name and unit for the independent (X) variable.
yname=Luminosity unit=erg/s
Labels the axis name and unit for the dependent (Y) variable.
y=3.826e33*y
Multiplies the input Y (flux) values by a given constant. This sort of thing may be required to convert the values from those used in the input model data to match those used by the observations during the fit.
out=gal.ymod
Gives the name of the output file to which the converted model data will be written. The output file is actaully a specially prepared VOTable or FITS table, and can e.g. be viewed in TOPCAT if required.
A full reference for the copymodel task is given in Appendix A.1.

Having prepared your .ymod file, you can view it using the plotmodel command if you wish before using it for actual fitting.


Next Previous Up Contents
Next: Performing the Fit
Up: How to fit spectra using Yafit
Previous: Preparing Observation Data

Yafit - Yet Another Fitting Tool
User Guide