hifast.flux Flux Calibration#

Overview#

The hifast.flux module converts spectral data from Antenna Temperature (Ta) to Flux Density (Jy). This is a critical step in calibrating the intensity of the observed signal.

Calibration Methods#

The module supports two primary methods for flux calibration:

  1. Pre-measured Gain Curve (Default) This method uses a standard gain curve model derived from long-term monitoring of calibrators. It is the simplest and most common approach.

    • Model: The default model is Jiang2020 (based on Jiang et al. 2020), which describes the gain as a function of Zenith Angle (ZA).

    • Usage: Simply run the command without specifying a calibrator file.

    • Advanced: For the Liu2024 model, you can also provide the ambient temperature using --Atemp.

  2. Noise Diode Calibration This method uses a specific calibrator observation (e.g., 3C48, 3C286) taken with a noise diode injection to determine the system gain for your specific observing session.

    • Usage: Provide the path to the calibrator file using --cbr_store.

    • Filtering: If --cbr_store points to a directory, use --cbr_name to select the specific source.

    • Corrections: You can apply corrections for Tcal differences (--fix_diff_tcal) and Zenith Angle differences (--fix_diff_ZA) between the target and calibrator.

Examples#

# Method 1: Standard calibration using the Jiang2020 gain curve
python -m hifast.flux data/spec_Ta.hdf5

# Method 2: Calibration using a specific noise diode observation file
python -m hifast.flux data/spec_Ta.hdf5 --cbr_store data/calibrator_3C48.hdf5

# Method 2 (Advanced): Using a directory of calibrators and filtering by name
python -m hifast.flux data/spec_Ta.hdf5 --cbr_store data/calibrators/ --cbr_name 3C48

Full Parameter Reference#

Tip

You can also view the full list of parameters and their descriptions directly in your terminal by running:

python -m hifast.flux --help

Convert spectra from Antenna Temperature (Ta) to Flux Density (Jy).

usage: python -m hifast.flux [-h] [--outdir OUTDIR] [-f] [-g G] [-c MY_CONFIG]
                             [--cbr_store FILE/DIR] [--cbr_name NAME]
                             [--only_use_19beams {True,False}]
                             [--fix_diff_tcal {True,False}]
                             [--fix_diff_ZA {True,False}]
                             [--pre_measured {Jiang2020,Liu2024}]
                             [--Atemp DEG_C] [--frange MIN MAX] [--no_radec]
                             FILE

Named Arguments#

--outdir

The directory used to save output file, default is same with the input file

Default: “default”

-f

if set, overwriting file if output file exists

Default: False

-g

save config to file path

-c, --my-config

config file path

Input/Output#

FILE

Input spectra file path (HDF5 format, typically with units in Ta).

Calibration: Noise Diode#

--cbr_store, --cali_fname, --cbr-store, --cali-fname

Path to the calibrator file or directory containing calibrator files. If specified, noise diode calibration is used.

Default: “none”

--cbr_name, --cbr-name

Name pattern of the calibrator source (e.g., “3C48”, “3C286”). Used to filter files if a directory is provided.

Default: “*”

--only_use_19beams, --only-use-19beams

Possible choices: True, False

If True, only use calibrator data that has all 19 beams.

Default: False

--fix_diff_tcal, --fix-diff-tcal

Possible choices: True, False

Correct for Tcal differences between the target observation and the calibrator observation.

Default: True

--fix_diff_ZA, --fix-diff-ZA

Possible choices: True, False

Correct for gain differences due to Zenith Angle (ZA) differences between target and calibrator.

Default: False

Calibration: Pre-measured Gain#

--pre_measured, --pre-measured

Possible choices: Jiang2020, Liu2024

Select the pre-measured gain curve to use if –cbr_store is not set. “Jiang2020” (arXiv:2002.01786) is the standard.

Default: “Jiang2020”

--Atemp, --Tamb

Ambient temperature [Celsius]. Required for “Liu2024” model correction. Ignored for “Jiang2020”.

General Settings#

--frange

Limit the frequency range to process [MHz]. Followed by two values (min, max).

Default: [0, inf]

--no_radec, --no-radec

Skip checking or adding RA/DEC coordinates (use with caution).

Default: False