hifast.sw Standing Wave Removal#

hifast.sw: Fits and subtracts Standing Waves (SW).

Example#

python -m hifast.sw data/XXX_arcdrift-M01_W-specs_T-flux-bld.hdf5 --method fft --nproc 5
  • Input file should be a *-bld*.hdf5 file processed by hifast.bld. In cases of severe RFI, use hifast.rfi first.

  • Output file will have the suffix -sw.hdf5 or -sw_nobld.hdf5.

  • Example Notebooks:

Parameters#

Main Parameters#

  • --nproc: Followed by a number, specifies the number of processes.

  • --method: {sin_poly, fft}

    • sin_poly: Least squares fitting of polynomial + sinusoidal.

    • fft: Operates in Fourier transform’s phase space, retrieves SW by inverse Fourier transform.

  • --njoin, --s_method_t, --s_sigma_t, --s_method_freq, --s_sigma_freq, --average_every_freq similar to hifast.bld, --njoin not supported with --method fft.

  • --nobld: Return data without baseline removed, only SW removed, suffix ‘-sw_nobld.hdf5’.

Method 1: Polynomial + Sinusoidal Fitting#

--method sin_poly

Parameters:

  • --sin_f: Initial frequency for sinusoidal fitting. Default 0.929, corresponding to a 1.09MHz periodic SW.

  • --bound_f: Frequency range for sinusoidal fitting.

  • --deg: Degree of the polynomial. Default is 1. Typically 0 or 1.

Processing in Fourier Space Post-FFT#

Illustrating with post-first substitution.

  • Main Parameters

    • --sw_base: Removes constant components in Fourier space. If baseline deviates from 0, setting True shifts entire spectrum by constant value.

    • --sw_periods: SW components to be removed. Accepts multiple characters. Default 1mhz 0_04mhz. Characters and corresponding SW periods:

      Character

      SW Period (MHz)

      1mhz

      1.08

      2mhz

      1.92

      0_04mhz

      0.039

      Note: 2mhz SW rarely seen, only once in M06 YY, so need not be added

    • --check_2mhz: If True, adds 2mhz to --sw_periods when inputting Beam 6 files; if not Beam 6, removes 2mhz (if present). Except data from July 31, 2021, do not set this parameter to True.

    • --amp_thr_mean_factor: Modes by average amplitude threshold in Fourier space, identified as known SW types. Input as multiple of median. Corresponds to two thresholds for noise switch off/on.

    • --amp_thr_solo_factor: SW parts by individual spectral line amplitude threshold in Fourier space. Input as multiple of median. Corresponds to two thresholds for noise switch off/on.

    • --chan_wide: Modes within ±(2 * channel number - 1) channels from SW mode center, selected as part of SW. Used for 1mhz and 2mhz SW. Default 5.

    • --chan_narr: Similar to above, but for narrow-band parts. Used for 0_04mhz SW and multiples of 1mhz. Default 2.

    • --choose_method: Method for selecting modes in Fourier space as SW, all or interpolate. Default all.

  • Noise Off (Cal_off) Spectral Line Processing

    SW amplitude and phase affected by noise switch changes, need separate processing.

    _images/fourier_water.png

    Amplitude in Fourier space, 0.92 microseconds corresponding to 1MHz SW, 1.84 microseconds to double frequency.#

    • Adjust --amp_thr_mean_factor through interactive page

      _images/select_amp_mean.png

      Average amplitude in Fourier space, peaks for two SW exceed threshold.#

    • Adjust --amp_thr_solo_factor through interactive page

      _images/select_amp_solo.png

      Individual amplitude in Fourier space, peaks for two SW exceed threshold, --chan_wide and --chan_narr cover necessary peaks.#

  • Noise On (Cal_on) Spectral Line Processing

    Same method to determine thresholds when on.

  • Inverse Fourier Transform

    Inverse transform selected Fourier modes yields SW.

  • If --iter_twice True, second substitution after SW removal, repeat process. Theoretically better results, see previous explanations.

Notes#

  • Post-FFT, data at frequency edges degrade due to truncation in discrete Fourier transforms. Discard 5~10MHz of lower-quality data at ends.

  • Larger bandwidth of input file, higher FFT resolution. Minimum 50MHz recommended.

Parameters#

Use command python -m hifast.sw -h | more for more parameter details.

Author: astroR2, 2023/3/9
References:
Xu, Chen, et al. HiFAST: An H I Data Calibration and Imaging Pipeline for
FAST III. Standing Wave Removal, 2023