Companion Codes

20150602 work in progress

A list of codes needed, or useful, to prepare the input to MyGIsFOS and interpret / convert the output for some use.

Grid preparation and handling:

Makegrid: makegrid is a family of codes used to package the synthetic spectra that will constitute the synthetic grid in the binary format MyGIsFOS uses. I describe it as a “family” of codes because, although the general structure of makegrid does not change, grids coming in different initial formats will generally need somewhat different versions of makegrid. In general, makegrid needs:

Broadgrid:broadgrid_multibroad is used to convolve the binary grid with a gaussian kernel of given FWHM to apply instrumental (or rotational / macroturbulent) broadening to the MyGIsFOS grid. makegrid produces usually un-broadened binary grids, which is the most flexible option since it allows the user to broaden the grid differently for different needs without having to repeat the grid packaging.Buy means of broadgrid_multibroad, then, the un-broadened original grid may be broadened differently for each grid frame (a typical user case is if each frame is a different FLAMES setting, since they have different resolutions).

Notice that, in general, nothing stops the user to feed pre-broadened spectra to makegrid, e.g. because this is what the user has access to. However, the grid broadening is written by broadgrid multibroad in the grid header and is used by MyGIsFOS to set some calculation parameters (i.e. i must be present and correct or MyGIsFOS will misbehave), an ad-hoc version of makegrid will be needed if an initial non-zero broadening must be written at the grid packaging phase.

Opengrid and get_from_grid: opengrid_multibroad is generally used to inspect a binary grid and, if needed, extract a spectrum from it. When called, opengrid_multibroad reads the grid header and reports on the grid comment, metrics, assumed composition, and broadening. It then asks if the user wants to extract a spectrum, and if this is requested, asks for the parameters to be extracted. It is not an interpolator, so it extracts only spectra present in the grid. get_from_grid (in debugging phase) is instead used to extract a spectrum from a binary grid by using call arguments, so to be scriptable, for instance:

./get_from_grid.exe my_grid.bin 5200 2.5 1.0 -1.5 0.4 2 612 650 t5200g250m150vt10ap04_612to650.txt

will extract the spectrum for the given parameters, and only the part of it between 612 and 650 nm, and place it in the filename at the end

Patchgrid: patchgrid (in debugging phase) is used to perform a grid “patching”, i.e. substituting a section of a binary grid with a different one. The basic function of this is to correct lines for which updated atomic data have become available, without having to recompute the whole grid. To do so, a “mini-grid” must be computed around the wavelength range to be modified, but with a small range on either side where the new synthesis is identical to the old one. Similarly to what happens with makegrid, an input file listing the patch file for each grid point must be provided.