synthpop.modules.age.uniform

A uniform age distribution

Stars are assigned uniformly drawn random ages between the bounds

Classes

Uniform

Uniform age distribution generator

Module Contents

class synthpop.modules.age.uniform.Uniform(low_bound: float, high_bound: float, **kwargs)

Bases: synthpop.modules.age._age.Age

Uniform age distribution generator

age_func_name = 'uniform'
low_bound
high_bound
draw_random_age(N: float or None = None) np.ndarray or float

Generate a random age or ages from a uniform distribution

Parameters

Nint, None, optional

if N is set to an integer, an array with N random ages is returned

Returns

agendarray, float [Gyr]

single age or numpy array of N ages in gigayears

average_age() float

Return the average age of the population

get_maximum_age() float

Return the maximum age that can be generated by the distribution.