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

ENH: adding SSA method for IRSA #3076

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

bsipocz
Copy link
Member

@bsipocz bsipocz commented Aug 1, 2024

No description provided.

@keflavich
Copy link
Contributor

I'm testing this out now. See #3092 for related work.

First, the format is not the same as sia, which ideally we'd fix:

In [6]: crd = SkyCoord.from_name('Sgr B2')
   ...: sgrb2_q = Irsa.query_ssa(pos=(crd.ra, crd.dec, 0.01,) )

Traceback (most recent call last):
  File ~/mambaforge/envs/py310forge/lib/python3.10/site-packages/pyvo/dal/ssa.py:383 in pos
    ra, dec = pos
ValueError: too many values to unpack (expected 2)

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  Cell In[6], line 2
    sgrb2_q = Irsa.query_ssa(pos=(crd.ra, crd.dec, 0.01,) )
  File ~/repos/astroquery/astroquery/ipac/irsa/core.py:160 in query_ssa
    return self.ssa.search(pos=pos, diameter=diameter, band=band, time=time,
  File ~/mambaforge/envs/py310forge/lib/python3.10/site-packages/pyvo/dal/ssa.py:214 in search
    return self.create_query(
  File ~/mambaforge/envs/py310forge/lib/python3.10/site-packages/pyvo/dal/ssa.py:260 in create_query
    return SSAQuery(
  File ~/mambaforge/envs/py310forge/lib/python3.10/site-packages/pyvo/dal/ssa.py:351 in __init__
    self.pos = pos
  File ~/mambaforge/envs/py310forge/lib/python3.10/site-packages/pyvo/dal/ssa.py:385 in pos
    raise ValueError(
ValueError: Pos must be a sequence with exactly two values, expressing ra and dec in icrs degrees

ssa only wants a 2-tuple, not a 3-tuple

But it looks like right now, this is not yet functional (it is labeled draft, after all)

In [7]: crd = SkyCoord.from_name('Sgr B2')
   ...: sgrb2_q = Irsa.query_ssa(pos=(crd.ra, crd.dec) )
Traceback (most recent call last):
  Cell In[7], line 2
    sgrb2_q = Irsa.query_ssa(pos=(crd.ra, crd.dec) )
  File ~/repos/astroquery/astroquery/ipac/irsa/core.py:160 in query_ssa
    return self.ssa.search(pos=pos, diameter=diameter, band=band, time=time,
  File ~/mambaforge/envs/py310forge/lib/python3.10/site-packages/pyvo/dal/ssa.py:215 in search
    pos=pos, diameter=diameter, band=band, time=time, format=format, **keywords).execute()
  File ~/mambaforge/envs/py310forge/lib/python3.10/site-packages/pyvo/dal/ssa.py:578 in execute
    return SSAResults(self.execute_votable(), url=self.queryurl, session=self._session)
  File ~/mambaforge/envs/py310forge/lib/python3.10/site-packages/pyvo/dal/adhoc.py:111 in __init__
    super().__init__(votable, url=url, session=session)
  File ~/mambaforge/envs/py310forge/lib/python3.10/site-packages/pyvo/dal/query.py:322 in __init__
    raise DALQueryError(self._status[1], self._status[0], url)
DALQueryError: UsageFault: BAD_REQUEST: Unknown parameter: request

In [8]: crd = SkyCoord.from_name('Sgr B2')
   ...: sgrb2_q = Irsa.query_ssa(pos=crd)
Traceback (most recent call last):
  Cell In[8], line 2
    sgrb2_q = Irsa.query_ssa(pos=crd)
  File ~/repos/astroquery/astroquery/ipac/irsa/core.py:160 in query_ssa
    return self.ssa.search(pos=pos, diameter=diameter, band=band, time=time,
  File ~/mambaforge/envs/py310forge/lib/python3.10/site-packages/pyvo/dal/ssa.py:215 in search
    pos=pos, diameter=diameter, band=band, time=time, format=format, **keywords).execute()
  File ~/mambaforge/envs/py310forge/lib/python3.10/site-packages/pyvo/dal/ssa.py:578 in execute
    return SSAResults(self.execute_votable(), url=self.queryurl, session=self._session)
  File ~/mambaforge/envs/py310forge/lib/python3.10/site-packages/pyvo/dal/adhoc.py:111 in __init__
    super().__init__(votable, url=url, session=session)
  File ~/mambaforge/envs/py310forge/lib/python3.10/site-packages/pyvo/dal/query.py:322 in __init__
    raise DALQueryError(self._status[1], self._status[0], url)
DALQueryError: UsageFault: BAD_REQUEST: Unknown parameter: request

@bsipocz
Copy link
Member Author

bsipocz commented Sep 7, 2024

Yeap, whatever I have here is just a dump of the first draft that I came up with during some meeting or such by mostly just copying over sia, without cleaning up and making it ssa specific. Realistically this won't get done before the next quarter (and will need some server-side stuff, too, e.g. caching some queries)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants