Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ concurrency:

env:
CONDA_PATH: /opt/conda/
BILBY_ALLOW_PARAMETERS_AS_STATE: FALSE
SETUPTOOLS_SCM_IGNORE_DUBIOUS_OWNER: 1

jobs:
Expand Down
18 changes: 2 additions & 16 deletions bilby/gw/detector/interferometer.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

from ...core import utils
from ...core.utils import docstring, logger, PropertyAccessor, safe_file_dump
from ...core.utils.env import string_to_boolean
from .. import utils as gwutils
from .calibration import Recalibrate
from .geometry import InterferometerGeometry
Expand Down Expand Up @@ -505,19 +504,6 @@ def inject_signal_from_waveform_polarizations(self, parameters, injection_polari
for key in parameters:
logger.info(' {} = {}'.format(key, parameters[key]))

@property
def _window_power_correction(self):
"""
This property enables the old (incorrect) PSD correction to be applied
using the :code:`BILBY_INCORRECT_PSD_NORMALIZATION` environment variable.
"""
if string_to_boolean(
os.environ.get("BILBY_INCORRECT_PSD_NORMALIZATION", "FALSE").upper()
):
return self.strain_data.window_factor
else:
return 1

@property
def amplitude_spectral_density_array(self):
""" Returns the amplitude spectral density (ASD) given we know a power spectral density (PSD)
Expand All @@ -529,7 +515,7 @@ def amplitude_spectral_density_array(self):
"""
return self.power_spectral_density.get_amplitude_spectral_density_array(
frequency_array=self.strain_data.frequency_array
) * self._window_power_correction**0.5
)

@property
def power_spectral_density_array(self):
Expand All @@ -544,7 +530,7 @@ def power_spectral_density_array(self):
"""
return self.power_spectral_density.get_power_spectral_density_array(
frequency_array=self.strain_data.frequency_array
) * self._window_power_correction
)

def unit_vector_along_arm(self, arm):
logger.warning("This method has been moved and will be removed in the future."
Expand Down
12 changes: 0 additions & 12 deletions test/gw/detector/interferometer_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import os
import unittest
from unittest import mock

Expand Down Expand Up @@ -385,17 +384,6 @@ def test_psd_not_impacted_by_window_factor(monkeypatch):
)


def test_psd_impacted_by_window_factor_with_environment_variable(monkeypatch):
ifo = bilby.gw.detector.get_empty_interferometer("H1")
ifo.set_strain_data_from_zero_noise(duration=4, sampling_frequency=256)
old_psd = ifo.power_spectral_density_array
factor = 0.1
env = dict(BILBY_INCORRECT_PSD_NORMALIZATION="TRUE")
monkeypatch.setattr(os, "environ", env)
monkeypatch.setattr(ifo.strain_data, "window_factor", factor)
np.testing.assert_array_equal(old_psd * factor, ifo.power_spectral_density_array)


class TestInterferometerEquals(unittest.TestCase):
def setUp(self):
self.name = "name"
Expand Down
Loading