Next Previous Up Contents
Next: Acknowledgements
Up: Command Reference
Previous: plotobs


A.6 tableobs

tableobs is used to prepare .yobs files from tables that contain observation data. A yobs file is the natural format in which Yafit stores information about observed spectra, but observations are not usually originally supplied in this form, so tableobs should be used to prepare them in this way. To use this task, you must have a table which contains data from one or more observations and a key file which describes what each column of the table means, in particular which columns represent flux values and flux errors at which wavelengths.

The key file is an ASCII table format containing optional comment lines (blank or starting with the '#' character) followed by a series of lines each describing the observations in one band pass. Each of these lines has four space-separated entries:

  1. yColName: name of the table column containing Y value
  2. yerrColName: name of the table column containing Y errors (or "null")
  3. x: central X value at which measurements are taken
  4. xWidth: width of X range over which measurements are taken
The X and Y here are typically wavelength and flux values, so that x is typically a band pass central wavelength and xWidth is the band pass full width. However, these X and Y values may be interpreted differently if desired, for instance Y may be in magnitudes rather than flux units.

Note that the Y error column may contain the special value "null" if no the input table contains no error information for one or more Y values. In this case however beware that error-less Y values will not be used by the chi2 goodness-of-fit measure in the fit task, since chi-squared fitting makes no sense without error estimates. To introduce given non-null error values you should pre-process the table (e.g. using STILTS) to provide a column containing suitable numeric values.

The input table which the key file describes is a table in any of the formats recognised by the SUN/256 package, including FITS, VOTable, CSV and ASCII. In general it is necessary to say what format it is in with the ifmt parameter.

See Section 3.1 for some more discussion and examples.

Usage:
Usage: tableobs [-help] [-debug]
                in=<table>
                [ifmt=<in-format>]
                key=<key-file>
                [out=<obs-file>]
                [redshift=<expr>]
                [x=<expr>]
                [y=<expr>]
                [xname=<value>]
                [xunit=<value>]
                [yname=<value>]
                [yunit=<value>]
Parameters:
ifmt = <in-format>
Gives the format of the table located by the in parameter (votable, fits, csv etc).

[Default: (auto)]

in = <table>
Location of the table which contains the input observation data. The columns of this table must contain the Y (flux) values and errors at different band passes. Which column means what is specified by the key parameter. The table located by this parameter may be in any of the formats supported by STIL, as defined by the ifmt parameter.
key = <key-file>
Location of file containing the four-column key file that describes which columns of the input table give which information. See the command description for more detail.
out = <obs-file>
Name of the file to which the output yobs file will be written.

[Default: -]

redshift = <expr>
May give an expression for redshift of the input observations in terms of quantities in the input table. If there is one, this will normally be expressed just as the name of the column in the input table which gives redshift. However, it can be an algebraic expression combining column names from the input table - see Section 6. A redshift should only be given if the X values are wavelength (not, for instance, if they are frequencies) since otherwise the fitting program will not treat them properly.
x = <expr>
Formula for the X (wavelength) values in the output observation file in terms of the X values in the key file. The default value of "x" simply makes the one equal to the other, however it is possible to use algebraic expressions here in terms of x, for instance in order to modify the scaling (change units). Normal arithmetic operators as well as some special functions may be used - see Section 6.

[Default: x]

xname = <value>
Gives a name for the output X axis, such as "Wavelength". This does not affect processing, but may be used to annotate the displayed or output results, so it is a good idea to supply a value if known to reduce confusion.

[Default: X]

xunit = <value>
Gives a unit for the output X axis, such as "Angstrom". This does not affect processing, but may be used to annotate the displayed or output results, so it is a good idea to supply a value if known to reduce confusion.
y = <expr>
Formula for the Y (flux) values in the output observation file in terms of the Y values in the input table. the default value of "y" simpley makes the one equal to the other, however it is possible to use algebraic expressions here in terms of y, x (the X values from the input key file), and any of the values in the input table referred to by their column name. Normal arithmetic operators as well as some special functions such as abToJansky() may be used - see Section 6

[Default: y]

yname = <value>
Gives a name for the output Y axis, such as "Flux". This does not affect processing, but may be used to annotate the displayed or output results, so it is a good idea to supply a value if known to reduce confusion.

[Default: Y]

yunit = <value>
Gives a unit for the output Y axis, such as "Jansky". This does not affect processing, but may be used to annotate the displayed or output results, so it is a good idea to supply a value if known to reduce confusion.


Next Previous Up Contents
Next: Acknowledgements
Up: Command Reference
Previous: plotobs

Yafit - Yet Another Fitting Tool
User Guide