def Sn_ET_B(freqs): """Return the average power spectral density noise for Einstein Telescope (variant B) in 1/Hz. .. note:: The data was downloaded from https://apps.et-gw.eu/tds/?content=3&r=14323 and has range ``fmin=1``, ``fmax=10000`` (Hz). :param freqs: Frequencies in Hz over which to evaluate the sensitivity curve. :type freqs: 1d NumPy array :returns: ET-B sensitivity curve in 1/Hz. :rtype: :py:class:`~.FrequencySeries` """ freqs = np.asarray(freqs) # Why is it so difficult to read files in Python packages? :( data = pkgutil.get_data("kuibit", "data/ETB.dat").decode("utf8") # We convert this data in a StringIO that NumPy can read, we can pass this # to load_FrequencySeries, since its backend is np.loadtxt # # ET distributes Amplitude Spectral Densities asd = load_FrequencySeries(StringIO(data)) psd = asd**2 # Resample on the requested frequencies. ETB is well-behaved, so it is fine # to use splines. psd.resample(freqs) return psd
def Sn_aLIGO_plus(freqs): """Return the average power spectral density noise for Advanced LIGO + in 1/Hz. .. note:: The data was downloaded from https://dcc.ligo.org/public/0149/T1800042/005/AplusDesign.txt and has range ``fmin=5``, ``fmax=5000`` (Hz). The resampling to the requested frequencies is done considering the values of the nearest neighbors. :param freqs: Frequencies in Hz over to evaluate the sensitivity curve. :type freqs: 1d NumPy array :returns: aLIGO+ sensitivity curve in 1/Hz. :rtype: :py:class:`~.FrequencySeries` """ freqs = np.asarray(freqs) data = pkgutil.get_data("kuibit", "data/aLIGO_PLUS.dat").decode("utf8") # aLIGO distributes Amplitude Spectral Densities asd = load_FrequencySeries(StringIO(data)) psd = asd**2 # Resample on the requested frequencies. CE1 has some spikes, so it is # better to not use splines. psd.resample(freqs, piecewise_constant=True) return psd
def Sn_KAGRA_D(freqs): """Return the average power spectral density noise for KAGRA in 1/Hz. .. note:: The data was downloaded from https://granite.phys.s.u-tokyo.ac.jp/svn/LCGT/trunk/sensitivity/spectrum/BW2009_VRSED.dat and has range ``fmin=1.00231``, ``fmax=10000`` (Hz). The resampling to the requested frequencies is done considering the values of the nearest neighbors. :param freqs: Frequencies in Hz over to evaluate the sensitivity curve. :type freqs: 1d NumPy array :returns: KAGRA sensitivity curve in 1/Hz. :rtype: :py:class:`~.FrequencySeries` """ freqs = np.asarray(freqs) data = pkgutil.get_data("kuibit", "data/KAGRA_VRSED.dat").decode("utf8") # KAGRA distributes Amplitude Spectral Densities asd = load_FrequencySeries(StringIO(data)) psd = asd**2 # Resample on the requested frequencies. CE1 has some spikes, so it is # better to not use splines. psd.resample(freqs, piecewise_constant=True) return psd
def Sn_aLIGO(freqs): """Return the average power spectral density noise for advanced LIGO in 1/Hz. This is the Zero-Detuned-High-Power noise curve. .. note:: The data was downloaded from https://dcc.ligo.org/LIGO-T1500293-v11/public and has range ``fmin=9``, ``fmax=8192`` (Hz). The resampling to the requested frequencies is done considering the values of the nearest neighbors. :param freqs: Frequencies in Hz over to evaluate the sensitivity curve. :type freqs: 1d NumPy array :returns: Advanced LIGO Zero-Detuned High-Power sensitivity curve in 1/Hz. :rtype: :py:class:`~.FrequencySeries` """ freqs = np.asarray(freqs) data = pkgutil.get_data("kuibit", "data/aLIGO_ZDHP.dat").decode("utf8") # aLIGO distributes Amplitude Spectral Densities asd = load_FrequencySeries(StringIO(data)) psd = asd**2 # Resample on the requested frequencies. CE1 has some spikes, so it is # better to not use splines. psd.resample(freqs, piecewise_constant=True) return psd
def Sn_CE2(freqs): """Return the average power spectral density noise for Einstein Telescope in 1/Hz. .. note:: The data was downloaded from https://cosmicexplorer.org/data/CE2_strain.txt and has range ``fmin=3``, ``fmax=10000`` (Hz). The resampling to the requested frequencies is done considering the values of the nearest neighbors. :param freqs: Frequencies in Hz over which to evaluate the sensitivity curve. :type freqs: 1d NumPy array :returns: CE2 sensitivity curve in 1/Hz. :rtype: :py:class:`~.FrequencySeries` """ freqs = np.asarray(freqs) data = pkgutil.get_data("kuibit", "data/CE1.dat").decode("utf8") # CE distributes Amplitude Spectral Densities asd = load_FrequencySeries(StringIO(data)) psd = asd**2 # Resample on the requested frequencies. CE1 has some spikes, so it is # better to not use splines. psd.resample(freqs, piecewise_constant=True) return psd
def test_load_FrequencySeries(self): path = "tests/tov/output-0000/static_tov/mp_Phi2_l2_m-1_r110.69.asc" f, fft_real, fft_imag = np.loadtxt(path).T ffs = fs.FrequencySeries(f, fft_real + 1j * fft_imag) self.assertEqual( ffs, fs.load_FrequencySeries(path, complex_on_two_columns=True)) path_ligo = "tests/tov/ligo_sens.dat" f, fft = np.loadtxt(path_ligo).T ffs_ligo = fs.FrequencySeries(f, fft) self.assertEqual(ffs_ligo, fs.load_noise_curve(path_ligo))