Skip to content

JPL SBDB query fails when returned properties have complex units with exponential involved #2368

Description

@jianyangli

For the objects that have properties that involve complex units, such as asteroid Bennu which has density and thermal inertia etc. to be returned, SBDB reports an error because the exponential in the units uses '^' rather than '**'.

from astroquery.jplsbdb import SBDB
sbdb = SBDB.query('bennu', phys=True)

Also it looks like astropy.units.Unit doesn't recognize decimal points when it's in the exponential. The decimal point has to be put inside a pair of parentheses. While this is an astropy issue, it affects how SBDB would parse units.

import astropy.units as u
print(u.Unit('m**(0.5)'))
print(u.Unit('m**0.5'))

astroquery==0.4.7.dev7713

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions