Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

toasim createGWB free spectrum type issue #44

Open
bencebecsy opened this issue Apr 20, 2022 · 1 comment · May be fixed by #47
Open

toasim createGWB free spectrum type issue #44

bencebecsy opened this issue Apr 20, 2022 · 1 comment · May be fixed by #47

Comments

@bencebecsy
Copy link
Contributor

bencebecsy commented Apr 20, 2022

I'm getting the following error when trying to simulate a free spectrum GWB with the createGWB function (specifying userSpec):
TypeError: Cannot cast array data from dtype('float128') to dtype('float64') according to the rule 'safe'

Changing 3 lines of code seems to fix this for me.

Line 799 and 800 (https://github.com/vallis/libstempo/blob/master/libstempo/toasim.py#L799) should have an extra float(), so they should read:

    start = float(N.min([p.toas().min() * 86400 for p in psr]) - 86400)
    stop = float(N.max([p.toas().max() * 86400 for p in psr]) + 86400)

And line 898 (https://github.com/vallis/libstempo/blob/master/libstempo/toasim.py#L898) should have an extra type conversion and it should read:

    res_gw.append(f(psr[ll].toas().astype(N.float) * 86400))

If people think this is right I can easily make a pull request.

@bencebecsy
Copy link
Contributor Author

Actually duplicate of #26

@bencebecsy bencebecsy linked a pull request Jun 5, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant