This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
def spherical_collapse(time_array, N_fft=32, eps=1e-4): | |
"""Compute the spherical collapse radius r as a function of time. | |
This is done with the method of Slepian & Philcox (2021), via contour integration and FFTs. | |
Note that the radius and time are given in dimensionless units. | |
Args: | |
time_array (np.ndarray): Array of times in units of the free-fall time. | |