Reference

This reference page details the functions included in Virgo, describing their roles and what they do.

simulate

simulate(l, b, beamwidth=0.6, v_min=-400, v_max=400, plot_file='')

Simulate 21 cm profiles based on the LAB HI Survey.

Parameters
  • l (float) – Target galactic longitude [deg]

  • b (float) – Target galactic latitude [deg]

  • beamwidth (float) – Telescope half-power beamwidth (approx. equal to 0.7 * lambda/D) [deg]

  • v_min (float) – Minimum radial velocity (xlim) [km/s]

  • v_max (float) – Maximum radial velocity (xlim) [km/s]

  • plot_file (string) – Output plot filename

Output: NoneType

predict

predict(lat, lon, height=0, source='', date='', plot_sun=True, plot_file='')

Plots source Alt/Az given the observer’s Earth coordinates.

Parameters
  • lat (float) – Observer latitude [deg]

  • lon (float) – Obesrver longitude [deg]

  • height (float) – Observer elevation [m]

  • source (string) – Source object name to predict.

  • date (string) – Date in YYYY-MM-DD format. If no date is given, it defaults to today’s system date.

  • plot_sun (bool) – Also plot Sun position for reference

  • plot_file (string) – Output plot filename

Output: NoneType

equatorial

equatorial(alt, az, lat, lon, height=0)

Takes observer’s location and Alt/Az as input and returns RA/Dec.

Parameters
  • alt (float) – Altitude [deg]

  • az (float) – Azimuth [deg]

  • lat (float) – Observer latitude [deg]

  • lon (float) – Observer longitude [deg]

  • height (float) – Observer elevation [m]

Output: Equatorial coordinates (tuple of floats) - (ra [hr], dec [deg])

galactic

galactic(ra, dec)

Converts RA/Dec. to galactic coordinates, returning galactic longitude and latitude.

Parameters
  • ra (float) – Right ascension [hr]

  • dec (float) – Declination [deg]

Output: Galactic coordinates (tuple of floats) - (l [deg], b [deg])

frequency

frequency(wavelength)

Transform wavelength to frequency.

Parameters

wavelength (float) – Wavelength [m]

Output: Frequency (float) [Hz]

wavelength

wavelength(frequency)

Transform frequency to wavelength.

Parameters

frequency (float) – Wave frequency [Hz]

Output: Wavelength (float) [m]

gain

gain(D, f, e=0.7, u='dBi')

Estimate parabolic antenna gain.

Parameters
  • D (float) – Antenna diameter [m]

  • f (float) – Frequency [Hz]

  • e (float) – Aperture efficiency (0 >= e >= 1)

  • u (string) – Output gain unit (‘dBi’, ‘linear’ or ‘K/Jy’)

Output: Antenna gain (float) [dBi, i or K/Jy depending on u]

A_e

A_e(gain, f)

Transform antenna gain to effective aperture.

Parameters
  • gain (float) – Antenna gain [dBi]

  • f (float) – Frequency [Hz]

Output: Effective antenna aperture (float) [m^2]

beamwidth

beamwidth(D, f)

Estimate parabolic antenna half-power beamwidth (FWHM).

Parameters
  • D (float) – Antenna diameter [m]

  • f (float) – Frequency [Hz]

Output: Antenna half-power (3 dB) beamwidth (float) [deg]

NF

NF(T_noise, T_ref=290)

Convert noise temperature to noise figure.

Parameters
  • T_noise (float) – Noise temperature [K]

  • T_ref (float) – Reference temperature [K]

Output: Noise figure (float) [dB]

T_noise

T_noise(NF, T_ref=290)

Convert noise figure to noise temperature.

Parameters
  • NF (float) – Noise figure [dB]

  • T_ref (float) – Reference temperature [K]

Output: Noise temperature (float) [K]

G_T

G_T(gain, T_sys)

Compute antenna gain-to-noise-temperature (G/T).

Parameters
  • gain (float) – Antenna gain [dBi]

  • T_sys (float) – System noise temperature [K]

Output: Antenna gain-to-noise-temperature (float) [dB/K]

SEFD

SEFD(A_e, T_sys)

Compute system equivalent flux density.

Parameters
  • A_e (float) – Effective antenna aperture [m^2]

  • T_sys (float) – System noise temperature [K]

Output: SEFD value (float) [Jy]

snr

snr(S, sefd, t, bw)

Estimate the obtained signal-to-noise ratio of an observation (radiometer equation).

Parameters
  • S (float) – Source flux density [Jy]

  • sefd (float) – Instrument’s system equivalent flux density [Jy]

  • t (float) – Total on-source integration time [sec]

  • bw (float) – Acquisition bandwidth [Hz]

Output: Signal-to-noise ratio (float) [dimensionless]

map_hi

map_hi(ra=None, dec=None, plot_file='')

Plots the all-sky 21 cm map (LAB HI survey). Setting RA/Dec (optional args) will add a red dot indicating where the telescope is pointing to.

Parameters
  • ra (float) – Right ascension [hr]

  • dec (float) – Declination [deg]

  • plot_file (string) – Output plot filename

Output: NoneType

observe

observe(obs_parameters, spectrometer='wola', obs_file='observation.dat', start_in=0)

Begin data acquisition (requires SDR connected to the machine).

Parameters
  • obs_parameters (dict) – Observation parameters

  • spectrometer (string) – Spectrometer flowchart/pipeline (‘WOLA’/’FTF’)

  • obs_file (string) – Output data filename

  • start_in (float) – Schedule observation start [sec]

Arguments for obs_parameters:

obs_parameters
Parameters
  • dev_args (string) – Device arguments (gr-osmosdr)

  • rf_gain (float) – RF gain

  • if_gain (float) – IF gain

  • bb_gain (float) – Baseband gain

  • frequency (float) – Center frequency [Hz]

  • bandwidth (float) – Instantaneous bandwidth [Hz]

  • channels (int) – Number of frequency channels (FFT size)

  • t_sample (float) – Integration time per FFT sample

  • duration (float) – Total observing duration [sec]

  • loc (string) – Latitude, longitude, and elevation of observation

  • ra_dec (string) – Right ascension and declination of target

  • az_alt (string) – Azimuth and altitude of target

Output: NoneType

plot

plot(obs_parameters='', n=0, m=0, f_rest=0, slope_correction=False, dB=False, rfi=[], xlim=[0, 0], ylim=[0, 0], dm=0, obs_file='observation.dat', cal_file='', waterfall_fits='', spectra_csv='', power_csv='', plot_file='plot.png')

Process, analyze and plot data. (Output: NoneType)

Parameters
  • obs_parameters (dict) – Observation parameters

  • n (int) – Median filter factor (spectrum)

  • m (int) – Median filter factor (time series)

  • f_rest (float) – Spectral line reference frequency used for radial velocity (Doppler shift) calculations [Hz]

  • slope_correction (bool) – Correct slope in poorly-calibrated spectra using linear regression

  • dB (bool) – Display data in decibel scaling

  • rfi (list of tuples) – Blank frequency channels contaminated with RFI ([(low_frequency, high_frequency)]) [Hz]

  • xlim (list) – x-axis limits ([low_frequency, high_frequency]) [Hz]

  • ylim (list) – y-axis limits ([start_time, end_time]) [Hz]

  • dm (float) – Dispersion measure for dedispersion [pc/cm^3]

  • vlsr (bool) – Display graph in VLSR frame of reference

  • meta (bool) – Display header with date, time, and target

  • avg_ylim (list) – Averaged plot y-axis limits ([low, high])

  • cal_ylim (list) – Calibrated plot y-axis limits ([low, high])

  • obs_file (string) – Input observation filename (generated with virgo.observe)

  • cal_file (string) – Input calibration filename (generated with virgo.observe)

  • waterfall_fits (string) – Output FITS filename

  • spectra_csv (string) – Output CSV filename (spectra)

  • power_csv (string) – Output CSV filename (time series)

  • plot_file (string) – Output plot filename

Arguments for obs_parameters:

obs_parameters
Parameters
  • dev_args (string) – Device arguments (gr-osmosdr)

  • rf_gain (float) – RF gain

  • if_gain (float) – IF gain

  • bb_gain (float) – Baseband gain

  • frequency (float) – Center frequency [Hz]

  • bandwidth (float) – Instantaneous bandwidth [Hz]

  • channels (int) – Number of frequency channels (FFT size)

  • t_sample (float) – Integration time per FFT sample

  • duration (float) – Total observing duration [sec]

  • loc (string) – Latitude, longitude, and elevation of observation

  • ra_dec (string) – Right ascension and declination of target

  • az_alt (string) – Azimuth and altitude of target

Output: NoneType

plot_rfi

plot_rfi(rfi_parameters, data='rfi_data', dB=True, plot_file='plot.png')

Plots wideband RFI survey spectrum. (Output: NoneType)

Parameters
  • rfi_parameters (dict) – Identical to obs_parameters, but also including ‘f_lo’: f_lo

  • data (string) – Survey data directory containing individual observations

  • dB (bool) – Display data in decibel scaling

  • plot_file (string) – Output plot filename

Output: NoneType

monitor_rfi

monitor_rfi(f_lo, f_hi, obs_parameters, data='rfi_data')

Begin data acquisition (wideband RFI survey). (Output: NoneType)

Parameters
  • obs_parameters (dict) – Observation parameters (identical to parameters used to acquire data)

  • f_lo (float) – Start frequency [Hz]

  • f_hi (float) – End frequency [Hz]

  • data (string) – Survey data directory to output individual observations to

Arguments for obs_parameters:

obs_parameters
Parameters
  • dev_args (string) – Device arguments (gr-osmosdr)

  • rf_gain (float) – RF gain

  • if_gain (float) – IF gain

  • bb_gain (float) – Baseband gain

  • frequency (float) – Center frequency [Hz]

  • bandwidth (float) – Instantaneous bandwidth [Hz]

  • channels (int) – Number of frequency channels (FFT size)

  • t_sample (float) – Integration time per FFT sample

  • duration (float) – Total observing duration [sec]

  • loc (string) – Latitude, longitude, and elevation of observation

  • ra_dec (string) – Right ascension and declination of target

  • az_alt (string) – Azimuth and altitude of target

Output: NoneType