Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • lisa-simulation/instrument
1 result
Show changes
Commits on Source (7)
......@@ -17,6 +17,7 @@ from h5py import File
from scipy.signal import lfilter, kaiserord, firwin
from scipy.interpolate import InterpolatedUnivariateSpline
from scipy.integrate import cumulative_trapezoid
from packaging.version import Version
from packaging.specifiers import SpecifierSet
from lisaconstants import c
......@@ -204,7 +205,7 @@ class Instrument:
self.telemetry_downsampling = int(telemetry_downsampling)
self.telemetry_dt = self.dt * self.telemetry_downsampling
self.telemetry_fs = 1 / self.telemetry_dt
self.telemetry_size = self.size // self.telemetry_downsampling
self.telemetry_size = int(np.ceil(self.size / self.telemetry_downsampling))
self.telemetry_t = \
self.telemetry_t0 + np.arange(self.telemetry_size, dtype=np.float64) * self.telemetry_dt
......@@ -498,9 +499,11 @@ class Instrument:
self.orbit_file = orbits
self.orbit_dataset = orbit_dataset
with File(self.orbit_file, 'r') as orbitf:
version = orbitf.attrs['version']
version = Version(orbitf.attrs['version'])
logger.debug("Using orbit file version %s", version)
if version in SpecifierSet('~= 1.0'):
if version.is_devrelease:
logger.warning("You are using an orbit file in a development version")
if version in SpecifierSet('~= 1.0', True):
self.init_orbits_file_1_0(orbitf)
else:
raise ValueError(f"unsupported orbit file version '{version}'")
......@@ -561,9 +564,11 @@ class Instrument:
logger.info("Interpolating gravitational-wave responses from GW file '%s'", gws)
self.gw_file = gws
with File(self.gw_file, 'r') as gwf:
version = gwf.attrs['version']
version = Version(gwf.attrs['version'])
logger.debug("Using GW file version %s", version)
if version in SpecifierSet('~= 0.1') or version in SpecifierSet('~= 1.0'):
if version.is_devrelease:
logger.warning("You are using a GW file in a development version")
if version in SpecifierSet('~= 0.1', True) or version in SpecifierSet('~= 1.0', True):
self.gws = ForEachMOSA(lambda mosa: InterpolatedUnivariateSpline(
gwf['t'][:], gwf[f'l_{mosa}'][:], k=5, ext='zeros')(self.physics_t)
)
......@@ -591,9 +596,11 @@ class Instrument:
self.glitch_file = glitches
logger.info("Interpolating glitch signals from glitch file '%s'", self.glitch_file)
with File(self.glitch_file, 'r') as glitchf:
version = glitchf.attrs['version']
version = Version(glitchf.attrs['version'])
logger.debug("Using glitch file version %s", version)
if version in SpecifierSet('~= 1.0'):
if version.is_devrelease:
logger.warning("You are using a glitch file in a development version")
if version in SpecifierSet('~= 1.0', True):
self.glitch_tms = ForEachMOSA(lambda mosa:
0 if f'tm_{mosa}' not in glitchf else \
InterpolatedUnivariateSpline(
......
......@@ -2,6 +2,6 @@
# -*- coding: utf-8 -*-
# pylint: disable=missing-module-docstring
__version__ = '1.0.3'
__version__ = '1.1.dev'
__author__ = 'Jean-Baptiste Bayle'
__email__ = 'j2b.bayle@gmail.com'
......@@ -8,6 +8,8 @@ kiwisolver==1.3.2
lazy-object-proxy==1.6.0
matplotlib==3.4.3
mccabe==0.6.1
mypy==0.931
mypy-extensions==0.4.3
numpy==1.21.3
packaging==21.0
Pillow==8.4.0
......@@ -22,5 +24,6 @@ python-dateutil==2.8.2
scipy==1.7.1
six==1.16.0
toml==0.10.2
tomli==2.0.0
typing-extensions==3.10.0.2
wrapt==1.13.2