@_preformat_psd<EOL>def inspiral_range_psd(psd, snr=<NUM_LIT:8>, mass1=<NUM_LIT>, mass2=<NUM_LIT>, horizon=False):
<EOL>mass1 = units.Quantity(mass1, '<STR_LIT>').to('<STR_LIT>')<EOL>mass2 = units.Quantity(mass2, '<STR_LIT>').to('<STR_LIT>')<EOL>mtotal = mass1 + mass2<EOL>mchirp = (mass1 * mass2) ** (<NUM_LIT:3>/<NUM_LIT>) / mtotal ** (<NUM_LIT:1>/<NUM_LIT>)<EOL>fisco = (constants.c ** <NUM_LIT:3> / (constants.G * <NUM_LIT:6>**<NUM_LIT> * pi * mtotal)).to('<STR_LIT>')<EOL>prefactor = (<EOL>(<NUM_LIT>**<NUM_LIT:2> * <NUM_LIT:5> * constants.c ** (<NUM_LIT:1>/<NUM_LIT>) *<EOL>(mchirp * constants.G / constants.c ** <NUM_LIT:2>) ** (<NUM_LIT:5>/<NUM_LIT>)) /<EOL>(<NUM_LIT> * pi ** (<NUM_LIT:4>/<NUM_LIT>) * snr ** <NUM_LIT:2>)<EOL>)<EOL>integrand = <NUM_LIT:1> / psd * psd.frequencies ** (-<NUM_LIT:7>/<NUM_LIT>) * prefactor<EOL>integrand = integrand[psd.frequencies.value < fisco.value]<EOL>if integrand.f0.value == <NUM_LIT:0.0>:<EOL><INDENT>integrand[<NUM_LIT:0>] = <NUM_LIT:0.0><EOL><DEDENT>if horizon:<EOL><INDENT>integrand *= <NUM_LIT> ** <NUM_LIT:2><EOL><DEDENT>return integrand.to('<STR_LIT>')<EOL>
Compute the inspiral sensitive distance PSD from a GW strain PSD

    Parameters
    ----------
    psd : `~gwpy.frequencyseries.FrequencySeries`
        the instrumental power-spectral-density data

    snr : `float`, optional
        the signal-to-noise ratio for which to calculate range,
        default: `8`

    mass1 : `float`, `~astropy.units.Quantity`, optional
        the mass (`float` assumed in solar masses) of the first binary
        component, default: `1.4`

    mass2 : `float`, `~astropy.units.Quantity`, optional
        the mass (`float` assumed in solar masses) of the second binary
        component, default: `1.4`

    horizon : `bool`, optional
        if `True`, return the maximal 'horizon' sensitive distance, otherwise
        return the angle-averaged range, default: `False`

    Returns
    -------
    rspec : `~gwpy.frequencyseries.FrequencySeries`
        the calculated inspiral sensitivity PSD [Mpc^2 / Hz]