ch_ephem.coord

CHIME co-ordinate transformations.

Functions

Functions

bmxy_to_hadec(bmx, bmy)

Convert CHIME/FRB beam-model XY coordinates to CIRS hour angle and declination.

cirs_radec(body[, obs])

Convert CIRS to ICRS.

get_range_rate(source, date[, obs])

Calculate rate at which distance between observer and source changes.

hadec_to_bmxy(ha_cirs, dec_cirs)

Convert CIRS hour angle and declination to CHIME/FRB beam-model XY coordinates.

object_coords(body[, date, deg, obs])

Calculate the RA and DEC of a source.

peak_ra(body[, date, deg, obs])

Calculate peak RA for a body.

star_cirs(ra, dec, epoch[, obs])

Create wrapper for skyfield.starlib.Star.

ch_ephem.coord.bmxy_to_hadec(bmx, bmy)[source]

Convert CHIME/FRB beam-model XY coordinates to CIRS hour angle and declination.

Parameters:
Returns:

  • ha_cirs (array_like) – The CIRS Hour Angle in degrees.

  • dec_cirs (array_like) – The CIRS Declination in degrees.

ch_ephem.coord.cirs_radec(body: skyfield.starlib.Star, obs: caput.time.Observer | None = None) skyfield.starlib.Star[source]

Convert CIRS to ICRS.

Converts a Skyfield body in CIRS coordinates at a given epoch to ICRS coordinates observed from obs.

Parameters:
  • body (skyfield.starlib.Star) – Skyfield Star object with positions in CIRS coordinates.

  • obs (caput.time.Observer or None) – The observer instance to use. If not supplied use chime.

Returns:

new_body – Skyfield Star object with positions in ICRS coordinates

Return type:

skyfield.starlib.Star

ch_ephem.coord.get_range_rate(source: SkyfieldSource, date: float | list, obs: caput.time.Observer | None = None) float | np.array[source]

Calculate rate at which distance between observer and source changes.

Parameters:
  • source – Position(s) on the sky.

  • date – Unix time(s) for which to calculate range rate.

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

Returns:

Rate (in m/s) at which the distance between the observer and source changes (i.e., the velocity of observer in direction of source, but positive for observer and source moving appart). If either source or date contains multiple entries, range_rate will be an array. Otherwise, range_rate will be a float.

Return type:

range_rate

Notes

Only one of source and date can contain multiple entries.

This routine uses an skyfield.positionlib.Apparent object (rather than an skyfield.positionlib.Astrometric object) to find the velocity of the observatory and the position of the source. This accounts for the gravitational deflection and the aberration of light. It is unclear if the latter should be taken into account for this Doppler shift calculation, but its effects are negligible.

ch_ephem.coord.hadec_to_bmxy(ha_cirs, dec_cirs)[source]

Convert CIRS hour angle and declination to CHIME/FRB beam-model XY coordinates.

Parameters:
  • ha_cirs (array_like) – The CIRS Hour Angle in degrees.

  • dec_cirs (array_like) – The CIRS Declination in degrees.

Returns:

bmx, bmy – The CHIME/FRB beam model X and Y coordinates in degrees as defined in the beam-model coordinate conventions: https://chime-frb-open-data.github.io/beam-model/#coordinate-conventions

Return type:

ndarray

ch_ephem.coord.object_coords(body: SkyfieldSource, date: float | None = None, deg: bool = False, obs: caput.time.Observer | None = None) tuple[float, float][source]

Calculate the RA and DEC of a source.

Gives the ICRS coordinates if no date is given (=J2000), or if a date is specified gives the CIRS coordinates at that epoch.

This also returns the apparent position, including abberation and deflection by gravitational lensing. This shifts the positions by up to 20 arcseconds.

Parameters:
  • body (skyfield source) – skyfield.starlib.Star or skyfield.vectorlib.VectorSum or skyfield.jpllib.ChebyshevPosition body representing the source.

  • date (float) – Unix time at which to determine ra of source If None, use Jan 01 2000.

  • deg (bool) – Return RA ascension in degrees if True, radians if false (default).

  • obs (caput.time.Observer or None) – An observer instance to use. If not supplied use chime. For many calculations changing from this default will make little difference.

Returns:

ra, dec – Position of the source.

Return type:

float

ch_ephem.coord.peak_ra(body: SkyfieldSource, date: float | None = None, deg: bool = False, obs: caput.time.Observer | None = None)[source]

Calculate peak RA for a body.

Calculates the right ascension where a source is expected to peak in the beam. This is different than the transit RA for observers which are rotated with-respect-to north.

Parameters:
  • body (skyfield source) – skyfield.starlib.Star or skyfield.vectorlib.VectorSum or skyfield.jpllib.ChebyshevPosition representing the source.

  • date (float) – Unix time at which to determine ra of source If None, 1 January, 2000 is used.

  • deg (bool) – If true, return right ascension in degrees. Otherwise, right ascension will be returned in radians.

  • obs (caput.time.Observer or None) – The observer. If not given, or None, the CHIME instrument will be used.

Returns:

peak_ra – RA when the transiting source peaks.

Return type:

float

ch_ephem.coord.star_cirs(ra: skyfield.units.Angle, dec: skyfield.units.Angle, epoch: skyfield.timelib.Time, obs: caput.time.Observer | None = None) skyfield.starlib.Star[source]

Create wrapper for skyfield.starlib.Star.

Creates a position given CIRS coordinates observed from obs.

Parameters:
  • ra (skyfield.api.Angle) – RA and dec of the source in CIRS coordinates

  • dec (skyfield.api.Angle) – RA and dec of the source in CIRS coordinates

  • epoch (skyfield.api.Time) – Time of the observation

  • obs (caput.time.Observer or None) – The observer instance to use. If not supplied use chime.

Returns:

body – Star object in ICRS coordinates

Return type:

skyfield.starlib.Star