Grid Tools

This appendix outlines the set of tools provided with MSG to assist in creating and managing custom grids. These tools are built during compilation when the TOOLS enivoronment variable is set to yes (see the Installation chapter for further details); once built, they can be found in the $MSG_DIR/bin directory.

Extracting Spectra

MSG’s HDF5 specgrid files are built from a set of specint (spectroscopic intensity) files representing individual spectra at the grid nodes. These files are themselves extracted from pre-calculated grids, with a variety of supported formats as discussed in each of the following sections.

SYNSPEC

The synspec_to_specint tool extracts an single intensity spectrum from a fort.18 data file produced by the SYNSPEC spectral synthesis package (Lanz & Hubeny, 2003), and writes it to an specint file. This tool accepts the following command-line arguments:

<synspec_file_name>

Name of input file.

<n_mu>

Number of \(\mu\) values in input file (as specified by the nmu parameter in the fort.55 SYNSPEC control file).

<mu_0>

Minimum \(\mu\) value in input file (as specified by the ang0 parameter in the fort.55 SYNSPEC control file).

<lam_min>

Minimum wavelength of output file.

<lam_max>

Maximum wavelength in output file.

<R>

Resolution \(\mathcal{R}=\lambda/\Delta\lambda\) in output file.

<law_str>

Limb-darkening law in output file (see the Limb-Darkening Laws section for a list of options).

<specint_file_name>

Name of output file.

<label> (optional)

Label of atmosphere parameter (must be accompanied by a corresponding <value> argument).

<value> (optional)

Lalue of atmosphere parameter (must be accompanied by a corresponding <label> argument).

Note that <label> and <value> parameters must be paired; and that there can be multiple of these pairs. For the law selected by the <law_str> option, the tool calculates the limb-darkening coefficients at each wavelength via a least-squares fit to the function

\[y(\mu) = 1 - \frac{I_{\lambda}(\mu;\ldots)}{I_{\lambda}(1;\ldots)}.\]

FERRE

The ferre_to_specint tool extracts a series of flux spectra from a data file in FERRE format (see the FERRE User Guide), and writes them to specint files. This tool accepts the following command-line arguments:

<ferre_file_name>

Name of input file.

<ferre_file_type>

Type of input file. This determines the mapping between atmospheric parameters given in the input file, and atmospheric parameters written to the output file. Supported options are: ‘CAP18’ (for the Allende Prieto et al., 2018 grids).

<specint_prefix>

Prefix of output files; specint files will have the name <specint_prefix>-NNNNNNNN.h5, wehre NNNNNNNN is the zero-padded index of the spectrum (starting at 1).

Goettingen

The goettingen_to_specint tool extracts a flux spectrum from a data file in FITS format (with the schema described by Husser et al., 2013), and writes it to a specint file. This tool accepts the following command-line arguments:

<fits_file_name>

Name of input file.

<wave_type>

Type of wavelength abscissa. This determines the number and distribution of points to assume for the input file. Supported options, corresponding to the different grids described by Husser et al. (2013), are: ‘HiRes’ (high-resolution), ‘MedRes-A1’ (medium-resolution, \(\Delta \lambda = 1\,\angstrom\)) and ‘MedRes-R10000’ (medium resolution, \(\mathcal{R}=10\,000\)). grids),

<specint_file_name>

Name of output file.

Note

In order for goettingen_to_specint to build, you must first uncomment/edit the line in $MSG_DIR/build/Makefile that defines the FITS_LDFLAGS variable. This variable defines the flags used to link against your system’s FITS library.

Modifying Spectra

The spectra contained in specint files (as produced by one of the tools above) can be subsetted and/or rebinned using the specint_to_specint tool. This tool accepts the following command-line arguments:

<specint_file_name_in>

Name of input file.

<specint_file_name>

Name of output file.

lam_min=<value> (optional)

Subset to have a minimum wavelength of at least <value>.

lam_max=<value> (optional)

Subset to have a maximum wavelength of at most <value>.

R=<value> (optional)

Rebin to have a uniform resolution \(\mathcal{R}\) of <value>.

dlam=<value> (optional)

Rebin to have a uniform wavelength spacing \(\Delta \lambda\) of <value>.

just=<L|R> (optional)

Justify the new wavelength abscissa to the left (‘L’) or right (‘R’).

Creating Spectroscopic Grids

With a set of specint files extracted, a specgrid file can be created using the specint_to_specgrid tool. This tool accepts the following command-line arguments:

<manifest_file_name>

Name of input manifest file (see below).

<specgrid_file_name>

Name of output file.

<allow_dupes> (optional)

Flag governing handling of duplicate grid nodes in the manifest file; set to ‘T’ to allow duplicates.

The manifest file is a simple text file that lists all the specint files (one per line) that should be included in the grid.

Creating Passband Files

Additional passband files (beyond those already provided in the Passband Files appendix) can be created using the make_passband tool. This tool accepts the following command-line arguments:

<table_file_name>

Name of input file (see below).

<F_0>

Normalizing flux \(F_{0}\) in \(\erg\,\cm^{-2}\,\second^{-1}\,\angstrom\).

<passband_file_name>

Name of output file.

The input file is a text file tabulating wavelength \(\lambda\) (in \(\angstrom\)) and passband response function \(S'(\lambda)\) (see the Evaluating Photometric Colors section).

Creating Photometric Grids

Given a specgrid file, a corresponding photgrid file can be built using the specgrid_to_photgrid tool. This tool accepts the following command-line arguments:

<specgrid_file_name>

Name of input file.

<passband_file_name>

Name of passband file.

<photgrid_file_name>

Name of output file.

Note that it’s not always necessary to create photgrid files, as MSG can convolve with passbands on the fly (as discussed in the Evaluating Photometric Colors section).