Configuration Guide
config.txt is the single file that controls every HexMaps run. It uses
a simple INI format with named sections ([section]); lines starting with
# are comments. Relative paths are resolved relative to the location of
config.txt itself.
Every key has a sensible default — you only need to set what differs from those defaults. The sections below document each key individually.
For advanced options (resolution modes, mask combinations, spectral smoothing, HFS correction, FOV erosion, and database fill mode) see the Advanced Configuration page.
[meta]
Metadata that is stored in the header of the output .ecsv table for
provenance. Neither key affects pipeline behaviour.
[meta]
user = Dr. Blocksberg
comments = Example HexMaps run
userYour name or identifier. Stored as-is in the table metadata.
commentsA free-form description of the run (dataset, goal, special settings, …). Stored as-is in the table metadata.
[paths]
All file and directory locations. Relative paths are resolved relative to
config.txt.
[paths]
data_dir = data/
out_dir = output/
folder_savefits = ./saved_fits_files/
# geom_file = keys/target_definitions.txt
# hfs_file = keys/hfs_lines.txt
data_dirDirectory that contains the input FITS files. The pipeline prepends the target name and appends the file extensions from the map and cube tables to build full file paths.
Default:
data/out_dirDirectory for the output
.ecsvdatabase files.Default:
output/folder_savefitsDirectory for FITS moment maps, cubes, and mask files written by the optional fits stage.
Default:
./saved_fits_files/geom_file(optional)Path to the target geometry table. Must be a comma-separated file in the target_definitions format.
Default:
keys/target_definitions.txt(relative toconfig.txt). Uncomment and set only if your file lives elsewhere.hfs_file(optional)Path to the hyperfine structure line definitions file. Only read when
use_hfs_lines = truein[masking]. Must be a comma-separated file in the hfs_lines format.Default:
keys/hfs_lines.txt(relative toconfig.txt). Uncomment and set only if your file lives elsewhere.
[targets]
[targets]
targets = ngc5194, ngc5457
targetsComma-separated list of target names to process in this run. Each name must match the FITS filename prefix (e.g.
ngc5194matchesngc5194_12co21.fits) and must have an entry inkeys/target_definitions.txt.You can list many targets in
target_definitions.txtand process only a subset here without modifying the geometry file.
[overlay]
[overlay]
overlay_file = _12co21.fits
overlay_fileFile extension of the 3D spectral FITS cube used as the spatial and spectral reference for the hexagonal grid. The full filename is assembled as
<target><overlay_file>(e.g.ngc5194_12co21.fits).The overlay cube defines:
the WCS reference frame and pixel scale of all output products
the spectral axis (velocity range, channel width, rest frequency)
the spatial footprint within which sightlines are placed
It must be a 3D cube. In most cases this is the brightest or most commonly observed line (e.g. ¹²CO(2–1)).
Map and Cube Tables
2D maps and 3D spectral cubes are listed as comma-separated rows immediately
after the # ---- maps ---- and # ---- cubes ---- comment markers.
These markers must be present; the rows between them define which datasets
are processed.
Maps (2D)
# ---- maps ----
# col 1: name short identifier used as database key → MAP_<name>
# col 2: description human-readable label
# col 3: unit physical unit (astropy-readable)
# col 4: file_ext file extension; full path = data_dir/<target><file_ext>
# col 5: directory directory containing the file (overrides data_dir)
# col 6: uc_ext uncertainty file extension (optional; leave blank if none)
spire250, SPIRE 250 um, MJy/sr, _spire250_gauss21.fits, data/, _spire250_gauss21_unc.fits
nameShort identifier. The output column in the
.ecsvtable is namedMAP_<name>(e.g.MAP_SPIRE250).descriptionHuman-readable label stored in the column description.
unitPhysical unit string, readable by
astropy.units. Written to the column unit metadata and to FITSBUNITheaders.file_extFile extension appended to the target name to build the full input path:
<data_dir>/<target><file_ext>.directoryOverride directory for this file. Useful when maps live in a different folder from
data_dir.uc_ext(optional)Extension of the corresponding uncertainty map. When provided, the pipeline samples it at the same sightlines and stores it as
MAP_<name>_UC. Leave blank if no uncertainty map is available.
Cubes (3D)
# ---- cubes ----
# col 1: name short identifier → SPEC_<name>, MOM0_<name>, …
# col 2: description human-readable label
# col 3: unit brightness temperature unit (K, Jy/beam, …)
# col 4: file_ext file extension
# col 5: directory directory containing the file
# col 6: map_ext pre-computed moment-0 map extension (optional)
# col 7: map_uc_ext uncertainty of the moment-0 map (optional)
12co21, 12CO(2-1), K, _12co21.fits, data/
12co10, 12CO(1-0), K, _12co10.fits, data/
nameShort identifier. The pipeline generates a family of output columns:
SPEC_<name>(spectrum),MOM0_<name>,MOM1_<name>,MOM2_<name>,TPEAK_<name>,RMS_<name>,EW_<name>, and their error columns.descriptionHuman-readable label stored in the column description.
unitBrightness temperature (or flux density) unit. Used in moment computations and written to output FITS files.
file_extFile extension appended to the target name.
directoryOverride directory for this cube.
map_ext(optional)Extension of a pre-computed integrated intensity (moment-0) map. When provided, it is sampled onto the hex grid and stored alongside the pipeline-computed moment maps.
map_uc_ext(optional)Extension of the uncertainty map corresponding to
map_ext.
Important
The first cube in the list is used as the default reference line for
mask construction (ref_line = first). Place your brightest,
highest-SNR spectral line first. See the Advanced Configuration page for
advanced line-selection options.
Mask Table
External masks are defined as rows after the # ---- mask ---- comment
marker. Three types of entry are supported, each distinguished by its key:
# ---- mask ----
# File mask — a pre-computed binary FITS mask sampled onto the hex grid:
# input_mask = name, description, file_ext, directory
# input_mask = co_mask, CO signal mask, _co_mask.fits, data/
# Velocity-window mask — channels within a fixed velocity range:
# window_mask = name, description, v_start, v_end, unit
# window_mask = win, Fixed velocity window, 400, 600, km/s
# Noise velocity windows — line-free channels for RMS estimation:
# noise_mask = name, description, v_start, v_end, unit
# noise_mask = noise_b, Noise blue, -300, -150, km/s
# noise_mask = noise_r, Noise red, 150, 300, km/s
input_maskAn external binary FITS file that is sampled onto the hexagonal grid at the regrid stage and stored as a
SPEC_<name>column. To use it as part of the signal mask, add theinputtoken toref_line.Columns:
name,description,file_ext,directorywindow_maskA fixed velocity window defined by start and end velocities. All channels within the window are set to 1; all others to 0. To use it as part of the signal mask, add the
windowtoken toref_line.Columns:
name,description,v_start,v_end,unit(unitmust be anastropy.units-readable velocity unit, e.g.km/s).noise_maskOne or more line-free velocity windows used for per-sightline RMS estimation. Multiple rows are OR-combined into a single noise channel mask. Enabled by
use_fixed_noise_mask = truein[masking].Columns:
name,description,v_start,v_end,unitThe pipeline automatically excludes any noise channels that overlap with the signal integration mask, preventing signal contamination of the RMS estimate.
[resolution]
[resolution]
target_res = 27.0
resolution = angular
pixels_per_beam = 2
max_rad = auto
NAXIS_shuff = 200
CDELT_SHUFF = 4000.0
target_resTarget angular resolution. Interpreted according to
resolution:angular→ value in arcsecondsphysical→ value in parsecs (converted per target usingdist_mpcfromtarget_definitions.txt)native→ ignored; the overlay beam is used as-is
Default:
27.0resolutionControls how
target_resis interpreted:angular— usetarget_resdirectly in arcseconds (default)physical— converttarget_res(parsecs) to arcseconds using each target’s distancenative— use the native resolution of the overlay cube; no convolution is performed
Default:
angularpixels_per_beamNumber of hexagonal sampling points per beam diameter. The hex-grid spacing is
target_res / pixels_per_beam.2→ half-beam spacing (default, recommended)1→ one sightline per beam (coarser grid, fewer sightlines)3→ denser grid (sightlines overlap substantially)
Default:
2max_radMaximum map radius in degrees, measured from the target centre. Set to
autoto derive the radius from the overlap between the overlay footprint and the data coverage.Default:
autoNAXIS_shuffNumber of channels in the shuffled spectrum output. The shuffled spectra are centred on the systemic velocity of each sightline and extend ±(NAXIS_shuff/2 × CDELT_SHUFF) m/s.
Default:
200CDELT_SHUFFChannel width of the shuffled spectrum in m/s.
Default:
4000.0
[masking]
[masking]
ref_line = first
SN_processing = 2, 4
strict_mask = false
use_fixed_noise_mask = false
use_hfs_lines = false
fov_erosion_beams = 0.5
mom_thresh = 5
conseq_channels = 3
mom2_method = fwhm
ref_lineComma-separated list of tokens that controls which masks are built and how they are combined. See the Advanced Configuration page for the full token reference and examples.
Quick summary:
Line-selection:
first(default),all,<n>,<LINE_NAME>,individualExternal-mask:
input,windowCombinator:
OR(default),AND
Default:
firstSN_processingTwo S/N thresholds
low, highfor the two-level mask construction. Channels abovehighseed the core mask; the core is grown into adjacent channels abovelowto capture line wings.Default:
2, 4strict_maskOptional post-processing coherence filter applied after the signal mask is built. Options:
false— no additional filtering (default)strict— remove spatially isolated detections smaller than approximately one beam area per channelbroad— re-derive the mask from a spatially smoothed cube with two-level S/N dilation
See the Advanced Configuration page for details and caveats.
Default:
falseuse_fixed_noise_maskWhen
true, use the velocity windows defined bynoise_maskrows in the mask table for per-sightline RMS estimation, instead of using channels outside the integration mask.Useful when the baseline contains emission from other lines that would otherwise bias the noise estimate.
Default:
falseuse_hfs_linesWhen
true, extend the signal mask to the hyperfine satellite frequencies of lines listed inhfs_file. Requireshfs_fileto be set in[paths].Default:
falsefov_erosion_beamsTrim the effective field-of-view by this multiple of the beam FWHM. Pixels near the map edge where the convolution kernel extends beyond the observed area are biased; erosion removes them.
0— disable erosion; keep the full overlay footprint0.5— trim by half a beam (default, recommended minimum)1.0— conservative; trim by one full beam
The same value is applied to the hex-grid footprint and to all FITS output maps so that they share a consistent effective FOV.
Default:
0.5mom_threshS/N threshold for moment-1, moment-2, and equivalent-width computation. Sightlines with peak S/N below this value are excluded from those quantities (but moment-0 is still computed).
Default:
5conseq_channelsMinimum number of consecutive channels above the S/N threshold for a detection to be considered valid. Isolated single-channel spikes are rejected even if they exceed
SN_processing[1].Default:
3mom2_methodDefinition used for the line-width (moment-2) output:
fwhm— convert the intensity-weighted second moment to FWHM (multiply by 2√(2 ln 2)) (default)sqrt— return √(mom2), the intensity-weighted velocity dispersionmath— return the raw mathematical second moment
Default:
fwhm
[spectral]
[spectral]
spec_smooth = default
spec_smooth_method = binned
spec_smoothSpectral smoothing applied to each cube before sampling:
default— no smoothing (default)overlay— smooth to the spectral resolution of the overlay cube<float>— convolve to this resolution in km/s (e.g.5.0)
Default:
defaultspec_smooth_methodAlgorithm used when
spec_smoothis notdefault:binned— bin channels to the nearest integer ratio (default, recommended)gauss— Gaussian kernel convolution. Note: this can underestimate RMS by 10–15 % in low-S/N regions; use with caution for science.combined— bin first, then apply a Gaussian to handle the fractional remainder
Default:
binned
[output]
[output]
save_cubes = false
save_mom_maps = true
save_maps = true
save_mask = false
save_cubesWhen
true, write each convolved PPV cube to a FITS file infolder_savefits. Only applies to the fits stage (--stages all).Default:
falsesave_mom_mapsWhen
true, write moment maps (mom0, mom1, mom2, rms, Tpeak, EW, and their error maps) to FITS files infolder_savefits.Default:
truesave_mapsWhen
true, write the convolved and reprojected 2D band maps to FITS files infolder_savefits.Default:
truesave_maskWhen
true, write the velocity-integration mask(s) to FITS cubes infolder_savefits. One file is written for the combined mask; additional files are written per line when HFS masks or per-line masks are active.Default:
false
[structure]
[structure]
structure_creation = default
# fname_fill = ngc5194_hexmaps_27p0as_2025_01_01.ecsv
structure_creationControls how the pipeline handles existing output
.ecsvfiles:default— create or overwrite the output file each run (default)fill— open an existing file and add only the maps/cubes that are not yet present. Useful for incrementally building up a database without re-processing everything.archive— append a timestamp to the filename and create a new versioned copy each run. The original file is never overwritten.
Default:
defaultfname_fill(only used whenstructure_creation = fill)Explicit filename of the existing
.ecsvto open in fill mode. If not set, the pipeline searchesout_dirfor the most recent matching file.