ErwanQuintin / STONKS

1 stars 0 forks source link

ACDS connection #1

Open lmichel opened 1 year ago

lmichel commented 1 year ago

The ACDS is a task of the XMM-Newton pipeline computing correlations of the XMM detections with more than 220 archival astronomical catalogs. In addition to the tables of correlations, the ACDS provides graphical products and various plots. A significant enhancement would be to add STONKS output to the ACDS products.

This issue assesses the best way to include the STONKS processing within the ACDS workflow with a minimal impact.

lmichel commented 1 year ago

The simplest way to proceed is to operate STONKS as a Web service that can be queried by positions. For each source, the ACDS query that service around its position and get the STONKS output if any (a png)

https://server:port/stonks?ra=123,67&dec=77.88&radius=12.4
- Returns 
    - HTTP code = 200 + image if a variability has been found
    - HTTP code = 404 otherwise

Other parameters such as various thresholds can be added to the query string.

This requires the response time of the service it be acceptable in the context of processing field of views with about 100 detections.

2 advantages of this approach

lmichel commented 1 year ago

Implementation:

The code must be designed with a loose coupling between the Flask (the Web servlet) endpoints and the logic API. The STONKS API must provide one function processing one query.

This function will be called from a flask method which will take the result and do the HTTP response packaging.

ErwanQuintin commented 1 year ago

Both the archival data loading (LoadSpecificMasterSource.py) and the transient detection (STONKS_PreComputed_Position_alert.py) scripts have been modified to work through queries, based on an input of a single position and flux state. We now need to take care of the Flask interface.