Skip to content

Add ObsLocTAP endpoint with cone search support#91

Draft
jak574 with Copilot wants to merge 7 commits into
mainfrom
copilot/add-obslocatap-endpoint
Draft

Add ObsLocTAP endpoint with cone search support#91
jak574 with Copilot wants to merge 7 commits into
mainfrom
copilot/add-obslocatap-endpoint

Conversation

Copilot AI commented Nov 7, 2025

Copy link
Copy Markdown
Contributor

Change Description

  • My PR includes a link to the issue that I am addressing

Closes #[issue_number]

Implements ObsLocTAP (Observatory Locator Table Access Protocol) IVOA standard endpoint with cone search capability using swifttools.swift_too.PlanQuery to query Swift Pre-Planned Science Timeline.

Solution Description

Core Implementation

  • swift_vo/obsloctap/: New module implementing ObsLocTAP service
    • schema.py: Parameter models for position (RA, DEC, RADIUS) and time range
    • service.py: Query logic using PlanQuery, VOTable formatting per ObsLocTAP spec
    • api.py: FastAPI endpoint /obsloctap/query with parameter parsing

VOSI Compliance

  • Added /obsloctap/availability and /obsloctap/capabilities endpoints
  • Updated swift_vo/vosi/api.py with ObsLocTAP service metadata

Integration

  • Registered module in app.py
  • Added 16 test cases in tests/swift_vo/test_obsloctap.py
  • Updated README with usage examples

Example Usage

# Basic cone search
/vo/obsloctap/query?POS=25,12&TIME=60100/60101

# With custom search radius (1.0 degrees)
/vo/obsloctap/query?POS=25,12,1.0&TIME=60100/60101&MAXREC=10

Returns VOTable with fields: obs_id, s_ra, s_dec, t_planning, t_start, t_stop, target_name

Code Quality

  • I have read the Contribution Guide
  • My code follows the code style of this project
  • My code builds (or compiles) cleanly without any errors or warnings
  • My code contains relevant comments and necessary documentation

Project-Specific Pull Request Checklists

New Feature Checklist

  • I have added or updated the docstrings associated with my feature using the NumPy docstring format
  • I have updated the tutorial to highlight my new feature (if appropriate)
  • I have added unit/End-to-End (E2E) test cases to cover my new feature
  • My change includes a breaking change
    • My change includes backwards compatibility and deprecation warnings (if possible)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • www.swift.psu.edu
    • Triggering command: /home/REDACTED/work/swift-vo/swift-vo/.venv/bin/python3 .venv/bin/pytest tests/ -v (dns block)
    • Triggering command: /home/REDACTED/work/swift-vo/swift-vo/.venv/bin/python3 .venv/bin/pytest tests/swift_vo/test_obsloctap.py -v (dns block)
    • Triggering command: /home/REDACTED/work/swift-vo/swift-vo/.venv/bin/python3 .venv/bin/pytest tests/ -v --tb=short (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>As ObsLocTAP capability to Swift VO</issue_title>
<issue_description>Add ObsLocTAP IVOA endpoint to swift-vo.

For this implementation support a simple cone search only.

Use the python swifttools.swift_too module's PlanQuery in order to fetch results.
</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits November 7, 2025 10:57
Co-authored-by: jak574 <15330708+jak574@users.noreply.github.com>
Co-authored-by: jak574 <15330708+jak574@users.noreply.github.com>
Co-authored-by: jak574 <15330708+jak574@users.noreply.github.com>
Copilot AI changed the title [WIP] Add ObsLocTAP capability to Swift VO Add ObsLocTAP endpoint with cone search support Nov 7, 2025
Copilot AI requested a review from jak574 November 7, 2025 11:03

@jak574 jak574 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot The code uses just the PlanQuery to get planned observations. It should also use ObsQuery to get observations that have been executed. Note: Observations should not double up, so only targets after the most recent ObsQuery entry should be included in planned. Also implement the execution_status entry in the table.

@jak574
jak574 self-requested a review November 7, 2025 14:14

@jak574 jak574 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-copilot @copilot The code uses just the PlanQuery to get planned observations. It should also use ObsQuery to get observations that have been executed. Note: Observations should not double up, so only targets after the most recent ObsQuery entry should be included in planned. Also implement the execution_status entry in the table.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

As ObsLocTAP capability to Swift VO

2 participants