Skip to content
Snippets Groups Projects
Commit 53d690cb authored by ChiWai Chan's avatar ChiWai Chan
Browse files

gstlal_inspiral_calc_snr: minor bugs fix

parent dbd16aa3
No related branches found
No related tags found
No related merge requests found
Pipeline #72934 failed
......@@ -136,8 +136,8 @@ def parse_command_line():
group.add_option("--outdir", metavar = "directory", type = "str", help = "Output directory for SNR(s) (require).")
group.add_option("--mode", metavar = "method", type = "int", default = 0, help = "The method (0 = LLOID / 1 = FIR) that is used to calculate SNR (default = 0).")
group.add_option("--complex", action = "store_true", help = "Choose whether to output the complex snr or not.")
group.add_option("--start", metavar = "seconds", type = "int", help = "Start SNR time series at GPS time '--start' (require).")
group.add_option("--end", metavar = "seconds", type = "int", help = "End SNR time series at GPS time '--end' (require).")
group.add_option("--start", metavar = "seconds", type = "float", help = "Start SNR time series at GPS time '--start' (require).")
group.add_option("--end", metavar = "seconds", type = "float", help = "End SNR time series at GPS time '--end' (require).")
group.add_option("--output-width", metavar = "bits", type = "int", default = 32, help = "The size of the output data, can only be 32 or 64 bits (default = 32 bits).")
group.add_option("--instrument", metavar = "name", help = "The detector from which the --reference-psd and --frame-cache are loaded (require).")
parser.add_option_group(group)
......
......@@ -87,7 +87,6 @@ class SNR_Pipeline(object):
"f0": 0,
"sampleUnits" : lal.DimensionlessUnit,
"length" : len(data)}
if data.dtype == numpy.float32:
tseries = lal.CreateREAL4TimeSeries(**para)
elif data.dtype == numpy.float64:
......@@ -103,7 +102,7 @@ class SNR_Pipeline(object):
return tseries
def get_snr_series(self, COMPLEX = False):
assert snr_info["epoch"] is not None, "No SNRs are obtained, check your start time."
assert self.snr_info["epoch"] is not None, "No SNRs are obtained, check your start time."
gps_start = self.snr_info["epoch"].gpsSeconds + self.snr_info["epoch"].gpsNanoSeconds * 10.**-9
gps = gps_start + numpy.arange(len(self.snr_info["data"])) * self.snr_info["deltaT"]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment