Skip to content

Specifying a surface-density profile that returns a Quantity should turn on physical outputs for AnyAxisymmetricRazorThinDiskPotential #724

Open
@jobovy

Description

@jobovy

🐛 Bug

See #723: Initializing AnyAxisymmetricRazorThinDiskPotential with a surfdens that returns a Quantity does not turn on physical outputs and the only way to turn them on is to (a) specify ro and vo upon initialiation or (b) turn them on explicitly using turn_physical_on. This is not consistent with the behavior of other potentials.

Reproducible example

Taken from #723:

expdisk = RazorThinExponentialDiskPotential(amp=1e10*u.Msun/u.kpc**2, hr=1*u.kpc)
diskpot = AnyAxisymmetricRazorThinDiskPotential(surfdens=lambda R: np.exp(-R/(1*u.kpc))*u.Msun/u.kpc**2, amp=1e10)
print(expdisk.vcirc(6*u.kpc),diskpot.vcirc(6*u.kpc))

These should give the same, but the former returns outputs with units while the latter returns outputs in internal units.

Expected behavior

Physical outputs are turned on when specifiying surfdens that returns a Quantity.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions