Skip to content

toasim createGWB free spectrum type issue #44

@bencebecsy

Description

@bencebecsy

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions