Skip to content

Small bug when calling results.posteriors.asini() #54

@cevawm

Description

@cevawm

If you try to retrieve asini from the posteriors of a RVHGPMmodel model run, and specifically when you provide the posterior_holder method asini() with a primary star mass and a +-1 sigma value (i.e. if you run res.posteriors.asini(star_mass=[tar_prim_mass, tar_prim_mass_err])), you get an error in the function get_planet_semimajor_axis():

`line 370, in get_planet_semimajor_axis
    a = f * star_mass**(1. / 3) * (P / (2 * np.pi))**(2. / 3)
        ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ValueError: operands could not be broadcast together with shapes (167876,) (83938,2) `

This does not happen if you provide just a mass value without a +-1 sigma, i.e. if you only provide a float, not a tuple. In other words, the function has a small bug when dealing with a tuple vs a float for the primary star mass.

I made a quick fix of this error by replacing line 369 in analysis.py with the following:

`star_mass = np.random.normal(star_mass[0], star_mass[1], P.shape)`

(i.e., I replaced line 369 with line 197, which is from the similar get_planet_mass() function).

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions