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

Phys from_sbpy fails for comets #349

Closed
jrob93 opened this issue Jun 16, 2022 · 3 comments · Fixed by #350
Closed

Phys from_sbpy fails for comets #349

jrob93 opened this issue Jun 16, 2022 · 3 comments · Fixed by #350
Labels
potential bug automated label to indicate issue reports

Comments

@jrob93
Copy link

jrob93 commented Jun 16, 2022

High-level problem description
Phys.from_sbdb works fine for asteroids but seem to not like querying comet designations

What did you do?

from sbpy.data import Phys
phys = Phys.from_sbdb("147P")

What did you expect?
I expected the code to return physical data for the comet.

What did really happen?
The code gave an error:

FieldError: Field M1 is not an instance of <class 'astropy.units.quantity.Quantity'>

It seems that astroquery SBDB is not providing units for all the fields that sbpy expects units for. The following code does the query successfully and the OrderedDict does not have units for M1 etc

from astroquery.jplsbdb import SBDB
sbdb = SBDB.query("147P", phys=True)
print(SBDB.schematic(sbdb)) 

Provide information on your environment:
macOS Monterey 12.4
sbpy version: 0.3.1
astropy version: 5.0.1
numpy version: 1.21.2

@jrob93 jrob93 added the potential bug automated label to indicate issue reports label Jun 16, 2022
@mkelley
Copy link
Member

mkelley commented Jun 16, 2022

Thanks, and I can confirm this bug, and have a fix. If you need a workaround in the short term, then get the data from astroquery as you do above, and apply the unit manually.

@mkelley
Copy link
Member

mkelley commented Jun 16, 2022

Ah, except that won't get it into the Phys object without major work. I'm not sure there is an easy workaround.

@jrob93
Copy link
Author

jrob93 commented Jun 16, 2022

No worries, the astroquery solution is fine for me right now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
potential bug automated label to indicate issue reports
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants