prob_at_location (function)

prob_at_location(ra, dec, mapPath, mjd=False, log=False, distance=False, probdensity=False)[source]

Return the probability contour a given sky-location resides within in a heaplix skymap

Key Arguments:
  • ra – right ascension in decimal degrees (float or list)

  • dec – declination in decimal degrees (float or list)

  • mapPath – path the the HealPix map

  • mjd – MJD of transient event (e.g. discovery date). If supplied, a time-delta from the map event is returned (float or list)

  • log – logger

  • distance – return also a distance (if present). Default False

  • probdensity – return also the probability density. Default False

Return:
  • probs – a list of probabilities the same length as the input RA and Dec lists. One probability per location.

  • timeDeltas – a list of time-deltas (days) the same length as the input RA, Dec and MJD lists. One delta per input MJD giving the time since the map event. Only returned if MJD is supplied.

  • distance – a list of location specific distances and distance-sigmas. A list of tuples. Only returned if distance=True.

  • probdensity – a list of location specific probability densities. Only returned if probdensity=True.

You can pass a single coordinate to return the probability contour that location lies within on the skymap:

from skytag.commonutils import prob_at_location
prob = prob_at_location(
    ra=10.343234,
    dec=14.345532,
    mapPath="/path/to/bayestar.multiorder.fits"
)

Or a list of coordinates:

from skytag.commonutils import prob_at_location
prob = prob_at_location(
    log=log,
    ra=[10.343234, 170.343532],
    dec=[14.345532, -40.532255],
    mapPath=pathToOutputDir + "/bayestar.multiorder.fits"
)

You can also pass in a list of MJDs to also return a list of time-deltas:

from skytag.commonutils import prob_at_location
prob, deltas = prob_at_location(
    log=log,
    ra=[10.343234, 170.343532],
    dec=[14.345532, -40.532255],
    mjd=[60034.257381, 60063.257381],
    mapPath=pathToOutputDir + "/bayestar.multiorder.fits"
)

Here probs = [100.0, 74.55] and deltas = [-28.11018, 0.88982]. Deltas are in days, with negative deltas occurring before the map event.

You can also request distance estimates at the locations:

from skytag.commonutils import prob_at_location
prob, deltas, distance = prob_at_location(
    log=log,
    ra=[10.343234, 170.343532],
    dec=[14.345532, -40.532255],
    mjd=[60034.257381, 60063.257381],
    mapPath=pathToOutputDir + "/bayestar.multiorder.fits",
    distance=True
)

The distances are returned as a list of tuples (distance in MPC, distance sigma in MPC)

You can also request probability density (per steradian) at the locations,

from skytag.commonutils import prob_at_location
prob, deltas, distance, probdensity = prob_at_location(
    log=log,
    ra=[10.343234, 170.343532],
    dec=[14.345532, -40.532255],
    mjd=[60034.257381, 60063.257381],
    mapPath=pathToOutputDir + "/bayestar.multiorder.fits",
    distance=True,
    probdensity=True
)