LEGWORK modules and API reference
LEGWORK
is composed of 7 different modules, each with a different focus. The diagram below illustrates
how each module is connected to the others as well as listing the general purpose of each module. In particular,
note that the source
module provides a simple interface to the functions in all other modules!

The rest of this page contains the API reference for each individual function in every module, feel free to use the table of contents on the left to easily navigate to the function you need.
legwork.evol Module
Functions using equations from Peters and Mathews (1964) to calculate inspiral times and evolve binary parameters.
Functions
|
Compute eccentricity time derivative |
|
Wrapper that integrates |
|
Evolve an array of circular binaries for |
|
Evolve an array of eccentric binaries for |
|
Computes the merger time for circular binaries |
|
Computes the merger time for binaries |
|
A fit to the Peters 1964 merger time equation (5.14) by Ilya Mandel. |
|
Evolve orbital frequency for |
|
Check that mass and frequency input is valid |
|
Create an array of timesteps |
|
Determine whether a binary is stationary |
Tip
Feeling a bit spun around by all this binary evolution? Check out our
tutorial on using functions in the evol
module here!
legwork.psd Module
Functions to compute various power spectral densities for sensitivity curves
Functions
|
Load in LISA response function from file |
|
Approximate LISA response function |
|
Calculates the effective power spectral density for all instruments. |
|
Calculates the effective LISA power spectral density sensitivity curve |
|
Calculates the effective TianQin power spectral density sensitivity curve |
|
Calculate the confusion noise for a particular model |
|
Calculate the confusion noise using the model from Robson+19 Eq. |
|
Calculate the confusion noise using the model from Huang+20 Table II. |
Calculate the confusion noise using the model from Thiele+20 Eq. |
legwork.snr Module
Functions to calculate signal-to-noise ratio in four different cases
Functions
|
Computes SNR for circular and stationary sources |
|
Computes SNR for eccentric and stationary sources |
|
Computes SNR for circular and stationary sources |
|
Computes SNR for eccentric and evolving sources. |
legwork.source Module
A collection of classes for analysing gravitational wave sources
Classes
|
Class for generic GW sources |
|
Subclass for sources that are stationary |
|
Subclass for sources that are evolving |
Generate a Source class with the LISA verification binaries preloaded. |
Class Inheritance Diagram

Tip
Unable to find the source of your issues? Never fear! Check out our tutorial on using the Source class here!
legwork.strain Module
Computes several types of gravitational wave strains
Functions
|
Computes the modulation of the strain due to the orbit averaged response of the detector to the position, polarisation, and inclination of the source using Cornish+03 Eq.42 and Babak+21. |
|
Computes strain amplitude |
|
Computes characteristic strain amplitude |
Tip
Feeling a little strained trying to parse these docs? Check out our
tutorial on using functions in the strain
module here!
legwork.utils Module
A collection of miscellaneous utility functions
Functions
|
Computes chirp mass of binaries |
|
Compute g(n, e) from Peters and Mathews (1963) Eq.20 |
|
f(e) from Peters and Mathews (1963) Eq.17 |
|
Converts orbital frequency to semi-major axis |
|
Converts semi-major axis to orbital frequency |
|
Convert eccentricity to semi-major axis |
|
Compute beta defined in Peters and Mathews (1964) Eq.5.9 |
|
Computes the c_0 factor in Peters and Mathews (1964) Eq.5.11 |
|
Rate of change of nth frequency of a binary |
|
Convert arguments to numpy arrays |
|
Required for the detector responses <F_+^2>, <F_x^2>, <F_+F_x> |
|
Required for the detector responses <F_+^2>, <F_x^2>, <F_+F_x> |
|
Required for the detector responses <F_+^2>, <F_x^2>, <F_+F_x> |
|
Compute the auto-correlated detector response for the plus polarization |
|
Compute the auto-correlated detector response for the cross polarization |
legwork.visualisation Module
Functions
|
Plot a 1D distribution of |
|
Plot a 2D distribution of x and y |
|
Plot the LISA sensitivity curve |
|
Overlay stationary sources on the LISA sensitivity curve. |
Tip
Not quite sure how things are working vis-à-vis visualisation? Check out our
tutorial on using functions in the visualisation
module here!