Commit 50e20741 authored by Gregory Ashton's avatar Gregory Ashton
Browse files

Adds type checking for GPSseconds

parent 011f6de7
...@@ -32,8 +32,8 @@ class Writer(BaseSearchClass): ...@@ -32,8 +32,8 @@ class Writer(BaseSearchClass):
---------- ----------
label: string label: string
a human-readable label to be used in naming the output files a human-readable label to be used in naming the output files
tstart, tend : float tstart, duration : int
start and end times (in gps seconds) of the total observation span start and duration (in gps seconds) of the total observation span
tref: float or None tref: float or None
reference time (default is None, which sets the reference time to reference time (default is None, which sets the reference time to
tstart) tstart)
...@@ -48,6 +48,9 @@ class Writer(BaseSearchClass): ...@@ -48,6 +48,9 @@ class Writer(BaseSearchClass):
see `lalapps_Makefakedata_v5 --help` for help with the other paramaters see `lalapps_Makefakedata_v5 --help` for help with the other paramaters
""" """
self.tstart = int(tstart)
self.duration = int(duration)
self.tend = self.tstart + self.duration self.tend = self.tstart + self.duration
if self.minStartTime is None: if self.minStartTime is None:
self.minStartTime = self.tstart self.minStartTime = self.tstart
...@@ -264,8 +267,8 @@ class GlitchWriter(Writer): ...@@ -264,8 +267,8 @@ class GlitchWriter(Writer):
---------- ----------
label: string label: string
a human-readable label to be used in naming the output files a human-readable label to be used in naming the output files
tstart, tend : float tstart, duration : float
start and end times (in gps seconds) of the total observation span start and duration (in gps seconds) of the total observation span
dtglitch: float dtglitch: float
time (in gps seconds) of the glitch after tstart. To create data time (in gps seconds) of the glitch after tstart. To create data
without a glitch, set dtglitch=None without a glitch, set dtglitch=None
...@@ -285,6 +288,9 @@ class GlitchWriter(Writer): ...@@ -285,6 +288,9 @@ class GlitchWriter(Writer):
see `lalapps_Makefakedata_v5 --help` for help with the other paramaters see `lalapps_Makefakedata_v5 --help` for help with the other paramaters
""" """
self.tstart = int(tstart)
self.duration = int(duration)
for d in self.delta_phi, self.delta_F0, self.delta_F1, self.delta_F2: for d in self.delta_phi, self.delta_F0, self.delta_F1, self.delta_F2:
if np.size(d) == 1: if np.size(d) == 1:
d = np.atleast_1d(d) d = np.atleast_1d(d)
...@@ -377,7 +383,7 @@ class FrequencyModulatedArtifactWriter(Writer): ...@@ -377,7 +383,7 @@ class FrequencyModulatedArtifactWriter(Writer):
""" """
Parameters Parameters
---------- ----------
tstart, data_duration : float tstart, data_duration : int
start and duration times (in gps seconds) of the total observation start and duration times (in gps seconds) of the total observation
Pmod, F0, F1 h0: float Pmod, F0, F1 h0: float
Modulation period, freq, freq-drift, and h0 of the artifact Modulation period, freq, freq-drift, and h0 of the artifact
...@@ -392,6 +398,9 @@ class FrequencyModulatedArtifactWriter(Writer): ...@@ -392,6 +398,9 @@ class FrequencyModulatedArtifactWriter(Writer):
see `lalapps_Makefakedata_v4 --help` for help with the other paramaters see `lalapps_Makefakedata_v4 --help` for help with the other paramaters
""" """
self.tstart = int(tstart)
self.data_duration = int(data_duration)
if os.path.isdir(self.outdir) is False: if os.path.isdir(self.outdir) is False:
os.makedirs(self.outdir) os.makedirs(self.outdir)
if tref is None: if tref is None:
...@@ -451,7 +460,7 @@ class FrequencyModulatedArtifactWriter(Writer): ...@@ -451,7 +460,7 @@ class FrequencyModulatedArtifactWriter(Writer):
def concatenate_sft_files(self): def concatenate_sft_files(self):
SFTFilename = lalpulsar.OfficialSFTFilename( SFTFilename = lalpulsar.OfficialSFTFilename(
self.IFO[0], self.IFO[1], self.nsfts, self.Tsft, self.tstart, self.IFO[0], self.IFO[1], self.nsfts, self.Tsft, int(self.tstart),
int(self.data_duration), self.label) int(self.data_duration), self.label)
# If the file already exists, simply remove it for now (no caching # If the file already exists, simply remove it for now (no caching
......
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