Coder Social home page Coder Social logo

sbank's Introduction

PyPI version Conda version License Supported Python versions

Build status Maintainability Coverage status

Sbank is a library for generating a template bank for compact binary searches covering a given region of mass and spin parameter space. The program can support all waveform approximants available in the lalsimulation suite. Currently implemented waveforms can be found with sbank --help and others added with only minor additions.

Sbank has been developed collaboratively by a diverse group of LIGO scientists starting in 2012, and has been split off from the larger lalsuite package as a standalone module in 2021. Sbank has been used to generate template banks for the separate GstLAL, MBTA, PyCBC and SPIIR analysis codes. Sbank also offers support for generating precessing and/or higher-order mode template banks.

The source code is open-source on GitHub and we welcome contributions from anyone.

If you use sbank in scientific publication, please see our citation guidelines (which Ian will have to write, for now the PyCBC help page https://pycbc.org/pycbc/latest/html/tmpltbank.html#tmpltbank-alignedstochbank contains the important details).

Structure of sbank

"Structure of sbank" image courtesy of Han Wang, Sun Yat-sen University.

sbank's People

Contributors

alex-nielsen avatar duncanmmacleod avatar humphreywang avatar imacdona avatar johnveitch avatar kwwette avatar lpsinger avatar michal-was avatar reinhardprix avatar skymoo avatar spxiwh avatar titodalcanton avatar vivienr avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

sbank's Issues

LLwadd Executable is broken

@MariaAssiduo noticed that the sbank_pipe executable is failing on python3 because the Llwadd executable defined in sbank is broken.

The reason for this is that a which function is defined to find the location of the executable, but this returns a bytes object and not an str object as expected. A simple fix is to decode bytes to str, but I'm not sure that using which here is a good idea, and the location for llwadd should be given in the config, just like the other executables.

.... Or I just remove sbank_pipe and make people use the PyCBC workflow generator.

sbank error

I tried to use the IMRPhenomPv2 waveforms for the construction of a BBH precessing-spins template bank in the mass range m1 = m2 = [3, 200] solar masses. The starting values for coarse-match-df and iterative-match-df-max in the sbank configuration file .ini were 4.0 respectively, with f_low=23 Hz and min-match=0.90. I am using the latest version of sbank (v0.0.3). I got the following error:

Traceback (most recent call last):
  File "/home/maria.assiduo/gwastro4/sbank_Python3/bin/sbank", line 543, in <module>
    match, matcher = bank.covers(tmplt, opts.match_min)
  File "/home/maria.assiduo/gwastro4/sbank_Python3/lib/python3.6/site-packages/sbank/bank.py", line 226, in covers
    raise ValueError(err_msg)
ValueError: Match is 0. This might indicate that you have the df value too high. Please try setting the coarse-value-df value lower.

Then, I lowered the values of coarse-match and iterative-match in a first tentative to 2.0 and in a second tentative in 1.0, but I got the SAME error message in both cases.
Also, I tried to run the following tests lowering the BBH mass range, which failed with the SAME Error message:

  1. BBH - IMRPhenomPv2
    m1 = m2 = [5- 125] ๐‘€_ส˜
    f_low = 15 Hz
    coarse-match-df= 1.0
    iteractive-match-df-max = 1.0

  2. BBH - IMRPhenomPv2
    m1 = m2 = [10 - 150] ๐‘€_ส˜
    f_low = 15 Hz
    coarse-match-df = 1.0
    iteractive-match-df-max = 1.0

I tried to re-run the tests by commenting coarse-match and iterative-match lines code, but i got the SAME Error message.
Any suggestion on how to resolve this?
However, I successfully obtained a precessing-spins BBH template bank in the mass range m1 = m2 = [10- 100] ๐‘€_ส˜, f_low=23 Hz, coarse-match-df=4.0, iterative-match-df-max=8.0.

sbank issue v0.0.3

Hi. I use since last year sbank v0.03 but never encountered the following error before:

  File "/home/maria.assiduo/gwastro4/sbank_Python3/lib/python3.6/site-packages/ligo/lw/ligolw.py", line 911, in startElementNS
    raise type(e)("line %d: %s" % (self._locator.getLineNumber(), str(e)))
ligo.lw.ligolw.ElementError: line 39: invalid type 'ilwd:char' for Column 'event_id' in Table 'sngl_inspiral', expected type 'int_8s'

I can't figure out how could change the type ilwd:char in int_8s. How to fix it? Thanks in advance.

Aligned-spin approximant issue

On line 284 of sbank file, not all the aligned spin approximants are listed: for example SEOBNRv4 is not listed. So it does not rise an error when you forget to put aligned-spin as an input parameter.

sbank v1.0.0 with IMRPhenomT*

Hi. I need to use the waveforms IMRPhenomTPHM/TP/THM/T to generate template banks with sbank. In conda igwn-py39- the version of lalsimulation seems to include this waveforms

lalsimulation.GetApproximantFromString("IMRPhenomTPHM") and others..

But I don't know how to use sbank with that waveforms. In case of the approximant IMRPhenomXPHM, I just modified sbank adding the following lines:

in waveforms.py:

class IMRPrecessingPhenomXPHMTemplate(IMRPrecessingSpinTemplate, HigherOrderModeTemplate):
    """Class for IMRPhenomXPHM templates"""
    approximant = "IMRPhenomXPHM"

waveforms = {
...
...
"IMRPhenomXPHM": IMRPrecessingPhenomXPHMTemplate,
}

in tau0tau3.py:

proposals = {
...
...
"IMRPhenomXPHM": double_spin_precessing_param_generator
}

And I was able to build template banks. In the case of IMRPhenomTPHM I did something similar, but it doesn't work (here a test /home/maria.assiduo/test_gwastro7/TB_TPHM. and I get the error:

Traceback (most recent call last):
  File "/home/maria.assiduo/gwastro7/sbank_Python3/bin/sbank_pipe", line 300, in <module>
    sbankJob = SBankJob(cp, tag_base=options.user_tag + "_sbank")
  File "/home/maria.assiduo/gwastro7/sbank_Python3/bin/sbank_pipe", line 91, in __init__
    inspiral.InspiralAnalysisJob.__init__(self,cp,sections,exec_name,extension)
  File "/home/maria.assiduo/gwastro7/sbank_Python3/lib/python3.6/site-packages/lalapps/inspiral.py", line 46, in __init__
    pipeline.AnalysisJob.__init__(self,cp,dax)
TypeError: __init__() takes 2 positional arguments but 3 were given

).

In the script waveforms.py there is no defined class for IMRPhenomTTemplate... does this mean that in the current sbank version is not implemented IMRPhenom class in time domain?
I am quite confused and need help to understand.
Thank you in advance.

Banksim error with IMRPhenomXPHM and NRSur7dq4 waveforms

I succesfully obtained two template banks with the family waveforms IMRPhenomXPHM and NRSur7dq4 using SBank. Now I am trying to calculate the effectualness of these banks using Banksim through the following tests:
A (B). choosing the IMRPhenomXPHM as bank-seed (template-approximant) and the NRSur7dq4 as injections (signal-approximant) and viceversa;

I get the following errors:
(A) pycbc_banksim: error: argument --template-approximant: invalid choice: 'IMRPhenomXPHM' (choose from 'EOBNRv2'....)
(B) pycbc_banksim: error: argument --signal-approximant: invalid choice: 'IMRPhenomXPHM' (choose from 'EOBNRv2'....)

It seems that the waveforms IMRPhenomXPHM are not implemented in Banksim? How can I add them?

Thanks in advance.

Python 3.6 can pick up not python 3.7+ scipy

I've had a report that if you try to install sbank in python 3.6 with scipy not present, the code will try to install scipy 1.6.2 (which does not work with python 3.6) and then fail. Why does scipy not automatically use an older, compatible version?

sbank v1.0.0 date format issue

Hello. I have used git clone to install the latest sbank version 1.0.0 in my CIT directory /home/maria.assiduo/gwastro6/

Using it to build a tamplates bank, this error occurred:

Traceback (most recent call last):
  File "/home/maria.assiduo/gwastro6/sbank_Python3/bin/sbank", line 461, in <module>
    process = ligolw_process.register_to_xmldoc(xmldoc, "sbank",
  File "/home/maria.assiduo/gwastro6/sbank_Python3/lib/python3.9/site-packages/ligo/lw/utils/process.py", line 100, in register_to_xmldoc
    process = proctable.RowType.initialized(program = program, process_id = proctable.get_next_id(), **kwargs)
  File "/home/maria.assiduo/gwastro6/sbank_Python3/lib/python3.9/site-packages/ligo/lw/lsctables.py", line 586, in initialized
    cvs_entry_time = lal.UTCToGPS(time.strptime(cvs_entry_time, "%Y-%m-%d %H:%M:%S +0000")) if cvs_entry_time is not None else None,
  File "/cvmfs/oasis.opensciencegrid.org/ligo/sw/conda/envs/igwn-py39-20211019/lib/python3.9/_strptime.py", line 562, in _strptime_time
    tt = _strptime(data_string, format)[0]
  File "/cvmfs/oasis.opensciencegrid.org/ligo/sw/conda/envs/igwn-py39-20211019/lib/python3.9/_strptime.py", line 349, in _strptime
    raise ValueError("time data %r does not match format %r" %
ValueError: time data '2022-01-23 10:19:14 +000' does not match format '%Y-%m-%d %H:%M:%S +0000'

I tried to modify the line 463 in /home/maria.assiduo/gwastro6/sbank_Python3/bin/sbank in this way:

cvs_repository="sbank", cvs_entry_time=strftime('%Y-%m-%d %H:%M:%S +000')) //wrong

cvs_repository="sbank", cvs_entry_time=strftime('%Y-%m-%d %H:%M:%S +0000')) //corrected to match line 586 cvs_entry_time = lal.UTCToGPS(time.strptime(cvs_entry_time, "%Y-%m-%d %H:%M:%S +0000")) in -> /home/maria.assiduo/gwastro6/sbank_Python3/lib/python3.9/site-packages/ligo/lw/lsctables.py

After the modification, I upgrade sbank with the command line " pip install . " in /home/maria.assiduo/gwastro6/sbank , but nothing changed. The line 463 in /home/maria.assiduo/gwastro6/sbank_Python3/bin/sbank still appear with the initial error

cvs_repository="sbank", cvs_entry_time=strftime('%Y-%m-%d %H:%M:%S +000')).

Any suggestion?

Thank you in advance.

TypeError: 'float' object cannot be interpreted as an integer

Hi,

Running the new SBank code, I get the following error:

Traceback (most recent call last):
  File "/home/maria.assiduo/gwastro/sbank_Python3/bin/sbank", line 527, in <module>
    for tmplt in proposal:
  File "/home/maria.assiduo/gwastro/sbank_Python3/lib/python3.6/site-packages/sbank/tau0tau3.py", line 551, in aligned_spin_param_generator
    for mass1, mass2 in urand_tau0tau3_generator(flow, **kwargs):
  File "/home/maria.assiduo/gwastro/sbank_Python3/lib/python3.6/site-packages/sbank/tau0tau3.py", line 398, in urand_tau0tau3_generator
    lims_tau0, lims_tau3 = tau0tau3_bound(flow, **constraints)
  File "/home/maria.assiduo/gwastro/sbank_Python3/lib/python3.6/site-packages/sbank/tau0tau3.py", line 269, in tau0tau3_bound
    m1m2_points = [(m1, m2min) for m1 in numpy.linspace(m1min, m1max, npts)]
  File "<__array_function__ internals>", line 6, in linspace
  File "/home/maria.assiduo/gwastro/sbank_Python3/lib/python3.6/site-packages/numpy/core/function_base.py", line 113, in linspace
    num = operator.index(num)
TypeError: 'float' object cannot be interpreted as an integer

Any suggestions to fix this? Thanks in advance.

sbank error

Hi. I'm trying to generate a template bank with a copy of sbank in my CIT directory.
The path directory is /home/maria.assiduo/test_gwastro7/New_TemplateBanks/SEOB/.

As usual, I activate the source with the following command line:

source /home/maria.assiduo/gwastro7/sbank_Python3/bin/activate

But I have an error that never happened before and I don't understand:

Traceback (most recent call last): File "/home/maria.assiduo/gwastro7/sbank_Python3/bin/sbank_pipe", line 293, in <module> dag = bank_DAG(options.user_tag) File "/home/maria.assiduo/gwastro7/sbank_Python3/bin/sbank_pipe", line 64, in __init__ fh = open( logfile, "w" ) FileNotFoundError: [Errno 2] No such file or directory: '/usr1/maria.assiduo/tmpdfjgwinn'

Any suggestion? Thanks in advance.

sbank v1.0.2 error

Hi, I'm trying to run the latest version of sbank (I have a copy of it in my CIT home directory) and I encountered the following error:

Traceback (most recent call last):
  File "/home/maria.assiduo/gwastro8/sbank_Python3/bin/sbank_pipe", line 304, in <module>
    sbankJob = SBankJob(cp, tag_base=options.user_tag + "_sbank")
  File "/home/maria.assiduo/gwastro8/sbank_Python3/bin/sbank_pipe", line 91, in __init__
    inspiral.InspiralAnalysisJob.__init__(self,cp,sections,exec_name,extension)
  File "/home/maria.assiduo/gwastro8/sbank_Python3/lib/python3.6/site-packages/lalapps/inspiral.py", line 46, in __init__
    pipeline.AnalysisJob.__init__(self,cp,dax)
TypeError: __init__() takes 2 positional arguments but 3 were given
(sbank_Python3) [maria.assiduo@ldas-pcdev5 bank_SEOBPHM]$ sbank_pipe --config-file sbank_seobphm.ini --user-tag sbank_seobphm
Traceback (most recent call last):
  File "/home/maria.assiduo/gwastro8/sbank_Python3/bin/sbank_pipe", line 304, in <module>
    sbankJob = SBankJob(cp, tag_base=options.user_tag + "_sbank")
  File "/home/maria.assiduo/gwastro8/sbank_Python3/bin/sbank_pipe", line 91, in __init__
    inspiral.InspiralAnalysisJob.__init__(self,cp,sections,exec_name,extension)
  File "/home/maria.assiduo/gwastro8/sbank_Python3/lib/python3.6/site-packages/lalapps/inspiral.py", line 46, in __init__
    pipeline.AnalysisJob.__init__(self,cp,dax)
TypeError: __init__() takes 2 positional arguments but 3 were given

Any suggestion? Thanks in advance.

time data format does not match

Hi, when I run an example of sbank it reported the error:

ValueError: time data '2022-02-21 16:26:03 +000' does not match format '%Y-%m-%d %H:%M:%S +0000'

image

So I edited line 463 in bin/sbank from +000 to +0000, then it worked well :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.