SpecPro Data Formats

SpecPro takes five input files per source, none of which is actually required for the program to run. A subset can be passed and interface widgets for which there is no data will be left blank.  The five files are:

The contents of each of these files as well as the naming conventions expected by the program are given below.  The example files in the deimos_example and imacs_example directories (available here) would be very helpful to look at if you have questions about the expected formats.

 The 1D Spectrum

The 1D spectrum must be stored in a fits file. The naming convention is:

spec1d.[mask name].[3 digit slit number].[target name].fits

For example, one of the DEIMOS 1D spectrum files in the deimos_example directory is named:


This means the source is from mask m46, slit number 70, with name OPT_var14582. The only thing really needed here is the slit number - the mask and target names can be set to dummy values. Also the slit number can be any integer from 000-999 and does not have to correspond to an actual slit number on a multislit mask.

The 1D fits file must contain a structure with the following fields:

The flux can be in arbitrary units, although something proportional to F_nu is preferable as this matches the spectral templates.

The 2D Spectrum

The 2D spectrum must be stored in a fits file. The naming convention is:

spec2d.[mask name].[3 digit slit number].[target name].fits

The 2D fits file must contain a structure with the following fields:

Note that lambda is a two dimensional array (of the same dimensions as flux and ivar) giving the wavelength solution for each pixel in the 2D image.

The Stamp Image File

The stamps must be stored in a fits file, with naming convention:

stamps.[mask name].[3 digit slit number].[target name].fits

This fits file contains an array of structures. The length of the array is determined by the number of stamp images. Each structure within the array (a single stamp image) is identical in form with the others, and has the following extensions:

If you do not have the inverse variance for the stamp image, just set the ivar array to all zeros. If one of your stamps is smaller or larger than 100x100, resample it to be 100x100 using, for example, the congrid function in IDL.

 To get a feel for this data structure, go into the deimos_example directory, start IDL, and at the command line type:

stamp = mrdfits('stamps.m46.070.OPT_var14582.fits',1)

Then stamp is an array with 32 elements, corresponding to each stamp image from the COSMOS survey. To see the name and pixscale of the 10th element, for example, type:

help, stamp[9].name, stamp[9].pixscale

The Photometry File

The photometry file is an ascii file with name convention:

phot.[mask name].[3 digit slit number].[target name].dat

This file has five columns, as follows:

Filter name   Central Wavelength    Effective Filter Bandwidth   AB Magnitude   AB Magnitude Error

The central wavelength and filter width should be expressed in angstroms. Non-detections are indicated with an AB magnitude of -99, with the AB magnitude error set to the lower bound on the AB magnitude established by the non-detection. Note that the filter name in this file should not contain spaces.

The Information File

The information file is ascii with the naming convention:

info.[mask name].[3 digit slit number].[target name].dat

This file has two columns. The first column contains the names of information fields contained in the file, and the second column has the corresponding values. The information that can be provided is shown below.

ID Integer, can be dummy value.
RA Degrees
DEC Degrees
extractpos Vertical position (in pixels) at which 1D spectrum extracted from 2D
extractwidth Width (in vertical pixels) of 1D extraction around extractpos
slitRA Central RA of slit (deg)
slitDEC Central DEC of slit (deg)
slitlen Length of slit (arcseconds)
slitwid Width of slit (arcseconds)
slitPA Angle of orientation of slit (degrees, 90 indicates EW aligned)
zphot Photometric redshift estimate
zpdf Median redshift from probability density function
zpdf-low Lower bound on redshift
zpdf-up Upper bound on redshift

The extractpos / extractwidth values are used to assist the display of overplotted features on the 2D spectrum.  The slit information, if provided, will allow the slit to be overplotted on the stamp images when the "Show Extraction" button is selected. The zphot value is an initial guess at the redshift based on the photometry.

If you do not have some piece of information, just set it to zero in this file, or omit it.