ch_util.hfbcat

Catalog of HFB test targets

Functions

get_doppler_shifted_freq(source, date[, ...])

Calculate Doppler shifted frequency of spectral feature with rest frequency freq_rest, seen towards source source at time date, due to Earth's motion and rotation, following the relativistic Doppler effect.

Classes

HFBCatalog(name[, ra, dec, alternate_names, ...])

Class for cataloguing HFB targets.

class ch_util.hfbcat.HFBCatalog(name, ra=None, dec=None, alternate_names=[], freq_abs=[], overwrite=0)[source]

Bases: FluxCatalog

Class for cataloguing HFB targets.

fields

List of attributes that are read-from and written-to the JSON catalog files.

Type:

list

Instantiate an HFBCatalog object for an HFB target.

Parameters:
  • name (string) – Name of the source.

  • ra (float) – Right Ascension in degrees.

  • dec (float) – Declination in degrees.

  • alternate_names (list of strings) – Alternate names for the source.

  • freq_abs (list of floats) – Frequencies at which (the peaks of) absorption features are found.

  • overwrite (int between 0 and 2) – Action to take in the event that this source is already in the catalog: - 0 - Return the existing entry. - 1 - Add the measurements to the existing entry. - 2 - Overwrite the existing entry. Default is 0. BUG: Currently, freq_abs is always overwritten.

ch_util.hfbcat.get_doppler_shifted_freq(source: skyfield.starlib.Star | str, date: float | list, freq_rest: float | list = None, obs: caput.time.Observer | None = None) np.array[source]

Calculate Doppler shifted frequency of spectral feature with rest frequency freq_rest, seen towards source source at time date, due to Earth’s motion and rotation, following the relativistic Doppler effect.

Parameters:
  • source – Position(s) on the sky. If the input is a str, attempt to resolve this from ch_util.hfbcat.HFBCatalog.

  • date – Unix time(s) for which to calculate Doppler shift.

  • freq_rest – Rest frequency(ies) in MHz. If None, attempt to obtain rest frequency of absorption feature from ch_util.hfbcat.HFBCatalog.freq_abs.

  • obs – An Observer instance to use. If not supplied use chime. For many calculations changing from this default will make little difference.

Returns:

Doppler shifted frequencies in MHz. Array where rows correspond to the different input rest frequencies and columns correspond either to input times or to input sky positions (whichever contains multiple entries).

Return type:

freq_obs

Notes

Only one of source and date can contain multiple entries.

Example

To get the Doppler shifted frequencies of a feature with a rest frequency of 600 MHz for two positions on the sky at a single point in time (Unix time 1717809534 = 2024-06-07T21:18:54+00:00), run:

>>> from skyfield.starlib import Star
>>> from skyfield.units import Angle
>>> from ch_util.hfbcat import get_doppler_shifted_freq
>>> coord = Star(ra=Angle(degrees=[100, 110]), dec=Angle(degrees=[45, 50]))
>>> get_doppler_shifted_freq(coord, 1717809534, 600)