llama.files.i3.utils module

Coordinate conversions for IceCube.

llama.files.i3.utils.icecube_coords()

Get the astropy.coordinates.EarthLocation of the IceCube detector.

llama.files.i3.utils.ra_dec2zen_az(mjd, ra_deg, dec_deg)

Take the right ascension/declination equatorial coordinates (used by LIGO and others) of the neutrino and convert them into the zenith and azimuth measured from IceCube (the earth-based coordinates measured from the ICECUBE site at the south pole).

Parameters
  • mjd (float or array-like) – The Modified Julian Date at which to make the conversion.

  • ra_deg (float or array-like) – The right-ascension in degrees of the point or points on the sky.

  • dec_deg (float or array-like) – Same, but for the declination.

Returns

  • zen_deg (float or array-like) – The zenith angle of the point on the sky as measured from IceCube’s location in degrees. Will be a scalar or vector value based on the input.

  • az_deg (float or array-like) – Same, but for the azimuthal angle.

Examples

Pull an archival neutrino and compare its official zenith/azimuth to the conversion provided by this function.

>>> import numpy as np
>>> from llama.files.i3.json import get_archive
>>> ns = get_archive(58392, 58393)
>>> mjds = np.array([n['mjd'] for n in ns])
>>> ras = np.array([n['ra'] for n in ns])
>>> decs = np.array([n['dec'] for n in ns])
>>> azs = np.array([n['azimuth'] for n in ns])
>>> zens = np.array([n['zenith'] for n in ns])
>>> czens, cazs = ra_dec2zen_az(mjds, ras, decs)
>>> max(abs(czens - zens)) < 0.001
True
>>> max(abs(cazs - azs)) < 0.001
True
llama.files.i3.utils.zen_az2ra_dec(mjd, zen_deg, az_deg)

Take the zenith and azimuth of the neutrino (these are earth-based coordinates measured from the ICECUBE site at the south pole) and convert them into the right ascension/declination equatorial coordinates used by LIGO and others.

Parameters
  • mjd (float or array-like) – The Modified Julian Date at which to make the conversion.

  • zen_deg (float or array-like) – The zenith angle of the point on the sky as measured from IceCube’s location in degrees.

  • az_deg (float or array-like) – Same, but for the azimuthal angle.

Returns

  • ra_deg (float or array-like) – The right-ascension in degrees of the input point or points. Will be a scalar or vector value based on the input.

  • dec_deg (float or array-like) – Same, but for the declination.

Examples

Pull an archival neutrino and compare its official RA/dec to the RA dec conversion provided by this function.

>>> import numpy as np
>>> from llama.files.i3.json import get_archive
>>> ns = get_archive(58392, 58393)
>>> mjds = np.array([n['mjd'] for n in ns])
>>> ras = np.array([n['ra'] for n in ns])
>>> decs = np.array([n['dec'] for n in ns])
>>> azs = np.array([n['azimuth'] for n in ns])
>>> zens = np.array([n['zenith'] for n in ns])
>>> cras, cdecs = zen_az2ra_dec(mjds, zens, azs)
>>> max(abs(cras - ras)) < 0.001
True
>>> max(abs(cdecs - decs)) < 0.001
True