Commit f2b37d32 authored by Edward Fauchon-Jones's avatar Edward Fauchon-Jones

Rtn invalid dep for phase-sense if no data < 0M

parent 5a5b921b
Pipeline #25147 passed with stage
in 2 minutes and 7 seconds
......@@ -924,6 +924,9 @@ class PhaseSense(InterfieldSpec):
# Determine sense from middle of pre-merger waveform
phase = np.array([sim['phase_l2_m2/X'][:], sim['phase_l2_m2/Y'][:]])
t0 = phase[0][0]*(3.0/4.0)
if t0 >= 0:
self.invalidMsg = "no (2,2) phase before 0M"
return err.InvalidInterfields(self)
t1 = t0*(1.0/3.0)
X = np.arange(t0, t1, 0.1)
Y = IUS(*phase, k=5)(X)
......
......@@ -1898,3 +1898,29 @@ class TestPhaseSense(TestInterfield):
(output, returncode) = helper.lvcnrcheck(['-f', '3', self.f.name], returncode=True)
assert output.strip() == self.output
assert returncode == 1
def test_invalid_phase_zero_inspiral(self):
self.setOutput(
('- [INVALID FIELDS] phase-sense '
'(Field dependencies are invalid)'))
nr = h5.File(self.f.name)
nr['phase_l2_m2']['X'][:] -= nr['phase_l2_m2']['X'][0]
nr.close()
(output, returncode) = helper.lvcnrcheck(['-f', '3', self.f.name], returncode=True)
assert output.strip() == self.output
assert returncode == 1
def test_invalid_phase_positive_inspiral(self):
self.setOutput(
('- [INVALID FIELDS] phase-sense '
'(Field dependencies are invalid)'))
nr = h5.File(self.f.name)
nr['phase_l2_m2']['X'][:] += 10.0 - nr['phase_l2_m2']['X'][0]
nr.close()
(output, returncode) = helper.lvcnrcheck(['-f', '3', self.f.name], returncode=True)
assert output.strip() == self.output
assert returncode == 1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment