From 404d4327bbe9946d0c454d8c210b53a0f133327c Mon Sep 17 00:00:00 2001 From: Kipp Cannon <kipp.cannon@ligo.org> Date: Wed, 20 Feb 2019 05:23:29 -0800 Subject: [PATCH] gstlal_inspiral_add_template_ids: - reduce the range of numbers used for IDs because they're being stored in 4-byte floats --- .../bin/gstlal_inspiral_add_template_ids | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gstlal-inspiral/bin/gstlal_inspiral_add_template_ids b/gstlal-inspiral/bin/gstlal_inspiral_add_template_ids index 5ec27bc545..aaedaa2d64 100755 --- a/gstlal-inspiral/bin/gstlal_inspiral_add_template_ids +++ b/gstlal-inspiral/bin/gstlal_inspiral_add_template_ids @@ -42,14 +42,14 @@ documents = [(fname, ligolw_utils.load_filename(fname, verbose = True, contentha N = sum(len(lsctables.SnglInspiralTable.get_table(xmldoc)) for fname, xmldoc in documents) # generate template IDs by drawing N samples without replacement from the -# integers between 1 and 2^32. for template bank sizes into the millions -# the probability of this process ever producing the same set of numbers -# twice is infinitessimally small. but its not 0. we don't let N get -# bigger than 1/10 the range from which the IDs are drawn to keep the -# probability of two ID sequences being the same small. - -assert N < 2**31, "too many templates: increase size of draw space" -ids = sorted(random.sample(xrange(2**32), N)) +# integers between 1 and some large number. for template bank sizes into +# the millions the probability of this process ever producing the same set +# of numbers twice is infinitessimally small. but its not 0. we don't let +# N get too close to the number of available IDs to keep the probability of +# two ID sequences being the same small. + +assert N < 50000000, "too many templates: increase size of draw space" +ids = sorted(random.sample(xrange(99999999), N)) # assign the IDs and write back to disk -- GitLab