km3astro.random

Random sampling utilities.

Module Contents

Functions

random_azimuth([n, unit])

Draw azimuth, uniformly distributed.

random_zenith([n, unit])

Draw zenith, uniformly distributed in cos(zen).

second_from_interval(start, stop[, n])

Sample random times from an interval (in seconds).

equidistant_from_interval(start, stop[, step])

Draw equidistant samples (fixed stepsize) from interval.

random_date([n, year, astropy_time])

Create random dates in the given year.

km3astro.random.random_azimuth(n=1, unit='rad')[source]

Draw azimuth, uniformly distributed.

km3astro.random.random_zenith(n=1, unit='rad')[source]

Draw zenith, uniformly distributed in cos(zen).

km3astro.random.second_from_interval(start, stop, n=1, **randargs)[source]

Sample random times from an interval (in seconds).

km3astro.random.equidistant_from_interval(start, stop, step=np.timedelta64(2, 'm'))[source]

Draw equidistant samples (fixed stepsize) from interval.

km3astro.random.random_date(n=1, year=2015, astropy_time=False, **randargs)[source]

Create random dates in the given year.

Parameters:
year: int, default: 2015
n: int, default: 1