Repository navigation
Expand file tree
/
Copy pathUseCases.tex
More file actions
559 lines (456 loc) · 30.7 KB
/
Copy pathUseCases.tex
File metadata and controls
559 lines (456 loc) · 30.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
Here are some science cases collected from various astronomical projects for this note to represent typical data discovery scenarios in high energy physics.
Each use case presents one strategy for building a ADQL query for an extended TAP service, based on the original {\tt ivoa.obscore} table and on the {\tt ivoa.obscore-hea} table extension.
We distinguished three categories of datasets in this note:
primary observation datasets (typically event-lists and event-bundles for \gls{HEA}), response function datasets, and advanced data product datasets.
In agreement with Semantics WG we have 3 existing/draft/proposed vocabularies:
\begin{itemize}
\item \url{http://www.ivoa.net/rdf/product-type} used for data products served in {\tt ivoa.obscore} table;
\item \url{http://www.ivoa.net/rdf/response-type} to expose response data products;
\item an Advanced data product type vocabulary currently discussed here: \\
{\small \url{https://github.com/ivoa-std/VEPs/pull/21/changes/c4195e1975341881d8fda22cb851ff11b5b74c1f#top}}.\\
\vspace{-20pt}
\item[] Note that the Radio astronomical community also requires the definition of new types of data products for their science ready datasets as ``advanced dataset''.
\end{itemize}
Three strategies have been considered in this note to organize data discovery based on an extension of ObsCore 1.1 in TAP\null. Each of them needs to be evaluated in various situations and explored further in terms of clarity for the user and robustness.
\begin{itemize}
\item {\bf Proposal 1}: Serve all data products in the {\tt ivoa.obscore} table. The attribute {\em dataproduct\_type\/} in {\tt ivoa.obscore} can contain any term from one of the three vocabularies \textsl{product-type}, \textsl{advanced-product-type}, or \textsl{response-type}:
All products are distributed via the {\tt ivoa.obs\-core} table as in
Chandra use cases A.1.8, A.2.1, and A.2.3, CTAO use cases A1.9 and A2.4, and SWGO use case A1.3.
This approach has the advantage that it is easy for the end-user to understand. All data products are accessed from the same table and the user does not have to know details about which data products need to be queried from what table.
A potential disadvantage is that the results of queries for multiple types of datasets will be harder to correlate, especially if the different data products types don't have a one-to-one cardinality relationship. For example, if you search for {\bf hea-event-list} or {\bf light-curve} in a sky region together with {\bf response-function} files, for instance {\bf psf}s, the query response may provide all datasets together mixing the various data product types together. The user will therefore have to determine which {\bf psf}(s) are associated with each {\bf hea-event-list} or {\bf light-curve}.
The user could for example choose to use GROUP BY {\em obs\_id\/}, but still there may be several {\bf light-curve}s and/or {\bf psf}s within the selected region, so the issue is to organize and group properly corresponding {\bf light-curve}s with their associated {\bf psf} files, especially if the point spread function varies over the field of view.
In practice, many advanced data products of the same type may be associated with a single {\bf hea-event-list} and so archives that serve such products will generally provide adequate metadata to allow the correlations to be performed. These metadata may not be directly accessible through the ObsCore TAP service however, which would place the onus on the end-user to perform these correlations after-the fact.
\item {\bf Proposal 2}: Add new terms to the product-type vocabulary and distinguish among response types and advanced product types using {\em data\-product\_subtype\/} in {\tt ivoa.obscore}.
The terms {\bf pdf}, {\bf draws}, {\bf region}, and {\bf response-function} are added to product-type vocabulary.
All products are distributed with the {\tt ivoa.obscore} table.
See use cases A.1.10 and A.1.13 for KM3NeT and Chandra use case A.1.8.
This approach is included largely for compatibility with the ObsCore Recommendation Version 1.1, which has a limited set of {\em dataproduct\_type\/}s and so requires the use of {\em dataproduct\_subtype\/} to discriminate between different data product types that share the same {\em data\-product\_type\/}.
A disadvantage of this approach is that queries on two ObsCore attributes are required to identify certain types of data products, for example different types of {\em response-function\/}s. The interpretation of the {\em dataproduct\_subtype\/} attribute may be ambiguous as the content could be ({\em e.g.\/}) a type of {\bf response-function}, or a category of image ({\em e.g.\/}, an excess map or significance map) or some specific description chosen by a specific archive.
A standardized vocabulary for {\em dataproduct\_subtype\/} will be beneficial. We have proposed standardized terms for various types of {\bf response-function}s in \S~5. However, there are several types of {\bf image}s that are commonly used in \gls{HEA} that could, with some additional discussion, also be standardized.
However, the ability for each individual archive to use {\em dataproduct\_sub\-type\/} ``to more precisely define the nature of the dataset'' (ObsCore Recommendation Version 1.1 \S~4.1) should not be discounted. Each archive is likely to have many different types of data products that would otherwise have the same {\em dataproduct\_type\/} that will need to be discriminated to be discovered efficiently. Some data products may be unique to a particular observatory but nevertheless highly significant for end-users of that observatory's data.
\item {\bf Proposal 3}: Separate the three kinds of products defined in the three distinct vocabularies as proposed with Semantics WG\null.
Implement one table for each kind:
\begin{itemize}
\item {\tt ivoa.obscore} uses {\em dataproduct\_type\/} from the \textsl{product-type} vocabulary;
\item {\tt ivoa.response} uses {\em dataproduct\_type\/} from the \textsl{response-type} vocabulary;
\item {\tt ivoa.adp} uses {\em dataproduct\_type\/} from the \textsl{advanced-product-type} vocabulary.
\end{itemize}
The benefits lie in tracing clearly the connections between response files and/or advanced data products to primary datasets currently included in the \textsl{product-type} vocabulary. This separation also addressed concerns that most {\bf response-function}s are not ``on-the-sky'' data products, despite their importance to \gls{HEA} data analysis. (Advanced data products currently proposed for inclusion in ObsCore are all ``on-the-sky'' data, although the definitions of the products are sufficiently general that this is not required to be the case.)
The disadvantage of this approach is that the end-user will need to know which vocabularies would need to be queried for which data product types and this may require a level of knowledge of IVOA implementation internals that would go beyond what is otherwise required of end-users. This will be more important for end-users who prefer to write their own queries directly using ADQL (for example, using TOPCAT), and could be particularly troublesome if the end user needs to change the syntax of their {\em dataproduct\_type\/} query depending on which vocabulary is used.
This strategy still needs to be investigated in detail. Some hints for implementing this approach are provided in Appendix~\ref{sec:accessoptionsappendix}.
\end{itemize}
\pagebreak
\subsection{Event-List Data and Responses}
\subsubsection{Use Case --- Search for event lists surrounding Sgr A*, for example for an X-ray morphological study}
{\em Identify all \gls{HEA} event lists encompassing Sgr~A* for initial selection for subsequent X-ray morphological studies. Since the focus is on X-ray morphological studies, only the event lists and not the event bundles are desired.\/}
%proposal regular Obscore table
\medskip
\noindent Find all datasets satisfying:
\begin{enumerate}[(i)]
\item Target name = ``Sgr A*'' or position inside 30 arcmin from (266.4168, $-29.0078$),
\item dataproduct\_type = ``hea-event-list''.
\end{enumerate}
\begin{verbatim}
SELECT * FROM ivoa.obscore
NATURAL JOIN ivoa.obscore_hea
WHERE
(target_name = 'Sgr A*' OR
CONTAINS(POINT(s_ra, s_dec), CIRCLE(266.4168, -29.0078, 0.5)) = 1)
AND (dataproduct_type = 'hea-event-list')
\end{verbatim}
\subsubsection{Use Case --- Search for event lists that include a fully calibrated spectral axis for BL Lac for rapid X-ray spectrophotometric evaluation}
{\em Identify all event lists that include the BL Lac, have a fully calibrated spectral axis (i.e., spectral responses have already been applied), and have at least 10,000 events. These data will be used to prepare slides for a presentation. Note that since calib\_status = 2 may not specify that the spectral axis is fully calibrated in physical units (HEA event lists are often considered ``calibrated'' even if the spectral axis is in pulse height units) the calibration status of the spectral axis must be checked explicitly.\/}
%proposal regular Obscore table with join
\medskip
\noindent Find all datasets satisfying:
\begin{enumerate}[(i)]
\item Target name = ``BL Lac'' or position inside 5 arcmin from (330.680338, $+42.27777$),
\item dataproduct\_type = ``hea-event-list'',
\item calib\_level $\geq 2$,
\item em\_calib\_status = ``calibrated'',
\item ev\_xel $\geq 10000$.
\end{enumerate}
\begin{verbatim}
SELECT * FROM ivoa.obscore
NATURAL JOIN ivoa.obscore_hea
WHERE
(target_name = 'BL Lac' OR
CONTAINS(POINT(s_ra, s_dec), CIRCLE(330.680338, +42.27777, 0.083333)) = 1)
AND (dataproduct_type = 'hea-event-list')
AND (calib_level >= 2)
AND (em_calib_status = 'calibrated')
AND (ev_xel >= 10000)
\end{verbatim}
\subsubsection{Use Case --- Search for SWGO event lists and their \glspl{IRF} for the event type `very-good' in the region of Cygnus loop for a TeV spectromorphology study}
{\em Identify all event lists and their associated \glspl{IRF} of the region of Cygnus loop ($3^{\circ}$ diameter) taken with SWGO. Only data of the event type `very-good' are selected, in order to limit the amount of downloaded data.\/}
%proposal 1 : all entries in ivoa.obscore with 3 vocabularies used for dataproduct_type
\medskip
\noindent Find all SWGO datasets satisfying:
\begin{enumerate}[(i)]
\item s\_region position intersects with the source modeled by a circle of 1.5 deg around (312.775, 30.683),
\item dataproduct\_type = ``hea-event-list'' or ``aeff'' or ``edisp'' or ``psf'' or ``bkgrate'',
\item obs\_collection = ``SWGO-DR1'',
\item event\_type = ``very-good''.
\end{enumerate}
First, run the ObsCore query:
\begin{verbatim}
SELECT * FROM ivoa.obscore
NATURAL JOIN ivoa.obscore_hea
WHERE (INTERSECTS(s_region, CIRCLE(312.775, 30.683, 1.5)) = 1)
AND (dataproduct_type = 'hea-event-list' OR dataproduct_type = 'aeff'
OR dataproduct_type = 'edisp' OR dataproduct_type = 'psf'
OR dataproduct_type = 'bkgrate')
AND (obs_collection = 'SWGO-DR1')
AND (event_type = 'very-good')
\end{verbatim}
Then, for each row of the output, we identify the nature of the data product, and retrieve them using the {\em access\_url\/}.
\subsubsection{Use Case --- Search for event bundles via DataLink that include Cas A for a TeV spectromorphology study}
{\em Identify all event bundles (event lists and their associated \glspl{IRF}) that include the Cas A SNR for subsequent TeV spectromorphology studies from a VERITAS data release. Since the instrumental responses are mandatory to remove instrumental effects, the event bundles that include the \glspl{IRF} are required.\/}
%proposal regular Obscore table with product-type update for hea-event-list
%the extra files exposed in the data link depend on the data provider strategy but the vocabularies used in the content-descriptor column must be defined in one of the 3 vocabularies.
\medskip
\noindent Find all VERITAS datasets satisfying:
\begin{enumerate}[(i)]
\item Target name = ``Cas A'' or position inside 2.5 arcmin from (350.8584, $+58.8113$),
\item dataproduct\_type = ``hea-event-list'',
\item obs\_collection = ``VERITAS-DR1'',
\item access\_format = ``datalink''.
\end{enumerate}
\begin{verbatim}
SELECT * FROM ivoa.obscore
NATURAL JOIN ivoa.obscore_hea
WHERE
(target_name = 'Cas A' OR
CONTAINS(POINT(s_ra, s_dec), CIRCLE(350.8584, +58.8113, 0.042)) = 1)
AND (dataproduct_type = 'hea-event-list')
AND (obs_collection = 'VERITAS-DR1')
AND (access_format = ’application/x-votable+xml;content=datalink’)
\end{verbatim}
Then, for each row of the output, we get access to a DataLink table (in VOTable) describing associated data linked to the {\bf hea-event-list} dataset using the {\em access\_url\/}' attribute value of the ObsCore query response table.
\subsubsection{Use Case --- Search for event bundles that include Cas A for X-ray spectrophotometric evolution studies}
{\em Identify all event bundles that include the Cas A SNR and have at least 1 million events for subsequent spectrophotometric studies of the SNR expansion. Since only a few observations are expected to match this request and because the focus is on X-ray spectrophotometric studies, the event bundles that include the responses or the ancillary products used to make the responses are required.\/}
%proposal regular Obscore table joined to ivoa.obscore-hea
\medskip
\noindent Find all datasets satisfying:
\begin{enumerate}[(i)]
\item Target name = ``Cas A'' or position inside 10 arcmin from (350.8584, $+58.8113$),
\item dataproduct\_type = ``hea-event-bundle'',
\item ev\_xel $\geq 1000000$.
\end{enumerate}
\begin{verbatim}
SELECT * FROM ivoa.obscore
NATURAL JOIN ivoa.obscore_hea
WHERE
(target_name = 'Cas A' OR
CONTAINS(POINT(s_ra, s_dec), CIRCLE(350.8584, +58.8113, 0.16667)) = 1)
AND (dataproduct_type = 'hea-event-bundle')
AND (ev_xel >= 1000000)
\end{verbatim}
\subsubsection{Use Case --- Search for event lists and their \glspl{IRF} of CTAO South observations at energies above 10 TeV for blind search of PeVatrons from a data release using DataLink}
{\em Identify all event lists and their associated \glspl{IRF} taken by CTAO South that contains events above 10 TeV. Data taken with the Small Size Telescopes or Medium Size Telescopes can be then selected. \/}
%proposal regular Obscore table joined to ivoa.obscore-hea
\medskip
\noindent Find all CTAO datasets satisfying:
\begin{enumerate}[(i)]
\item dataproduct\_type = ``hea-event-list'',
\item obs\_collection = ``CTAO-DR1'',
\item access\_format = ``datalink'',
\item instrument\_name contains ``CTAO-S'',
\item energy\_max >= $10^{13}$.
\end{enumerate}
First, run the ObsCore query:
\begin{verbatim}
SELECT * FROM ivoa.obscore
NATURAL JOIN ivoa.obscore_hea
WHERE (dataproduct_type = 'hea-event-list')
AND (obs_collection = 'CTAO-DR1')
AND (access_format = 'application/x-votable+xml;content=datalink')
AND (instrument_name LIKE 'CTAO-S')
AND (energy_max >= 1.0e+13)
\end{verbatim}
The query output is a VOTable that follows the DataLink VO standard.
We process this VOTABLE to access to the data:
\begin{enumerate}[(i)]
\item for each row of the query output, get the {\em obs\_id\/} and the {\em access\_url\/} of the DataLink describing the ObsCore dataset entry,
\item get the DataLink VOTable showing the datasets associated to this entry
\item for each row of the DataLink VOTable, get the {\em content\_qualifier\/} and the {\em access\_url\/} attribute's value,
\item download the data associated to each {\em access\_url\/} value.
\end{enumerate}
Table \ref{tab:datalink1} displays an example of the DataLink response table attached to such an hea-event-list discovery.
The {\em obs\_publisher\_did\/} of the single discovered {\bf hea-event-list} is repeated in the ID column of the DataLink table.
Mandatory FIELDS {\em service\_def\/} and {\em error\_messsage\/} are omitted as they are empty.
\begin{landscape}
\begin{center}
\begin{longtable}{|p{0.15\linewidth}|p{0.2\linewidth}|p{0.08\linewidth}|p{0.22\linewidth}|p{0.1\linewidth}|p{0.12\linewidth}|p{0.13\linewidth}|}
\hline%\sptablerule
\textbf{ID} &\textbf{\footnotesize access\_url} &\textbf{\footnotesize semantics}&\textbf{\footnotesize description} &\textbf{\footnotesize content\_type} &\textbf{\footnotesize content\_length} &\textbf{\footnotesize content\_qualifier}\cr
\hline%\sptablerule
{\footnotesize ivo://xxx/yyy/zzz\#ttt} & {\footnotesize https://xxx.yyy/zzz/ttt1.fits} & {\footnotesize \#this} & {\footnotesize hea-event-list} {\footnotesize ivo://xxx/yyy/zzz\#ttt} & {\footnotesize application/x-fits-gadf} & {\footnotesize 1000000} & {\footnotesize hea-event-list} \cr
\hline%\sptablerule
{\footnotesize ivo://xxx/yyy/zzz\#ttt} & {\footnotesize https://xxx.yyy/zzz/ttt2.fits} & {\footnotesize \#calibration} & {\footnotesize Effective area of the telescope/instrument associated with the hea-event-list} {\footnotesize ivo://xxx/yyy/zzz\#ttt} & {\footnotesize application/x-fits-gadf} & {\footnotesize 10000} & {\footnotesize aeff} \cr
\hline%\sptablerule
{\footnotesize ivo://xxx/yyy/zzz\#ttt} & {\footnotesize https://xxx.yyy/zzz/ttt3.fits} & {\footnotesize \#calibration} & {\footnotesize Energy dispersion of hea-event-list} {\footnotesize ivo://xxx/yyy/zzz\#ttt} & {\footnotesize application/x-fits-gadf} & {\footnotesize 10000} & {\footnotesize edisp} \cr
\hline%\sptablerule
{\footnotesize ivo://xxx/yyy/zzz\#ttt} & {\footnotesize https://xxx.yyy/zzz/ttt4.fits} & {\footnotesize \#calibration} & {\footnotesize Point spread function of hea-event-list } {\footnotesize ivo://xxx/yyy/zzz\#ttt} & {\footnotesize image/fits} & {\footnotesize 50000} & {\footnotesize psf} \cr
\hline%\sptablerule
{\footnotesize ivo://xxx/yyy/zzz\#ttt} & {\footnotesize https://xxx.yyy/zzz/ttt5.fits} & {\footnotesize \#calibration} & {\footnotesize Background rate of hea-event-list } {\footnotesize ivo://xxx/yyy/zzz\#ttt} & {\footnotesize text/csv} & {\footnotesize 1000} & {\footnotesize bkgrate} \cr
\hline%\sptablerule
\noalign{\vspace{10pt}}%
\caption{DataLink response table attached to an {\bf hea-event-list} record in ObsCore.}
\label{tab:datalink1}
\end{longtable}
\end{center}
\end{landscape}
\subsubsection{Use Case --- Search for spatially resolved spectro-polarimetric observations of the Crab with spectral resolution R > 100}
{\em Identify all event bundles for observations of the Crab that intersect the 1.0--100.0 keV energy range, have calibrated spatial and time axes, are spatially resolved in 2 dimensions in equatorial coordinates, have spectral resolution $R>100$, and include polarimetry measurements. Note that ObsCore specifies that the axes lengths --- {\em s\_xel1, s\_xel2, em\_xel, t\_xel, pol\_xel} --- should be set to $-1$ for non-pixelated data like event lists, so these quantities are not useful for this query.\/}
%proposal regular Obscore table joined to ivoa.obscore-hea
\medskip
\noindent Find all datasets satisfying:
\begin{enumerate}[(i)]
\item Target name = ``Crab'' or position inside 5 arcmin from (83.6324, $+22.0174$),
\item dataproduct\_type = ``hea-event-bundle'',
\item calib\_level $\geq 2$,
\item em\_res\_power $> 100$,
\item energy\_min $< 100000$,
\item energy\_max $> 1000$,
\item o\_ucd contains ``phys.polarization'',
\item o\_ucd contains ``pos.eq''.
\end{enumerate}
\begin{verbatim}
SELECT * FROM ivoa.obscore
NATURAL JOIN ivoa.obscore_hea
WHERE
(target_name = 'Crab' OR target_name = 'M1' OR
CONTAINS(POINT(s_ra, s_dec), CIRCLE(83.6324, +22.0174, 0.083333)) = 1)
AND (dataproduct_type = 'hea-event-bundle')
AND (calib_level >= 2)
AND (em_res_power > 100)
AND (energy_min < 100000.0) AND (energy_max >= 1000.0)
AND (o_ucd LIKE '%phys.polarization%')
AND (o.ucd LIKE '%pos.eq%')
\end{verbatim}
\subsubsection{Use Case --- Identify PSF response-functions for further analysis of previously downloaded data products}
{\em Identify all Chandra Source Catalog point spread functions for source detections that fall within 2 arcmin radius of (83.84358, $-5.43639$) in the Orion star-forming complex for Chandra observation 4374. These PSFs will be used to analyze previously downloaded catalog data products for the same field.\/ }
%proposal 2 : all in ivoa.obscore with 3 vocabularies but distinguish response-type by dataproduct\_subtype
\medskip
\noindent Find all datasets satisfying:
\begin{enumerate}[(i)]
\item Position inside 3 arcmin from (83.84358, $-5.43639$),
\item dataproduct\_type = ``response-function'',
\item dataproduct\_subtype = ``psf'',
\item obs\_id = ``4374'',
\item obs\_collection = ``CSC2''.
\end{enumerate}
\begin{verbatim}
SELECT * FROM ivoa.obscore
NATURAL JOIN ivoa.obscore_hea
WHERE
(CONTAINS(POINT(s_ra, s_dec), CIRCLE(83.84358, -5.43639, 0.033333)) = 1)
AND (dataproduct_type = 'response-function')
AND (dataproduct_subtype = 'psf')
AND (obs_id = '4374')
AND (obs_collection = 'CSC2')
\end{verbatim}
\subsubsection{Use Case --- Get all the \glspl{IRF} for a given CTAO observation, for simulation purposes}
{\em Simulations are frequently used to estimate the science performance for a given astrophysical use case. To realize such simulations, \glspl{IRF} are required.\/ }
\medskip
\noindent Find the CTAO datasets satisfying:
\begin{enumerate}[(i)]
\item dataproduct\_type = ``aeff'' or dataproduct\_type = ``psf'' or dataproduct\_type = ``edisp'' or dataproduct\_type = ``bkgrate'',
\item obs\_id = ``4374'',
\item obs\_collection = ``CTAO-DR1''.
\end{enumerate}
\begin{verbatim}
SELECT * FROM ivoa.obscore
NATURAL JOIN ivoa.obscore_hea
WHERE
(dataproduct_type = 'aeff'
OR dataproduct_type = 'edisp'
OR dataproduct_type = 'psf'
OR dataproduct_type = 'bkgrate')
AND (obs_id = '4374')
AND (obs_collection = 'CTAO-DR1')
\end{verbatim}
%can be implemented with the response table only
\subsubsection{Use Case --- Search for all ANTARES neutrino data products for a given collection in the direction of a point source}
{\em Using the ANTARES 2007--2017 point source data set, retrieve all events, background estimate, and detector acceptance to calculate the expected neutrino flux from a given point source, e.g. HESSJ0632+057, as in \textit{G. Illuminati for the ANTARES Collaboration, PoS(ICRC2019)920} and recalculate the significance of the neutrino flux.}
\medskip
\noindent Find all datasets satisfying
\begin{enumerate}[(i)]
\item Source (98.24, 5.81) within detector field of view,
\item dataproduct\_type = ``hea-event-bundle'' or ``hea-event-list'' or ``response-function'',
\item obs\_collection = ``ANTARES-2017-PS''.
\end{enumerate}
\begin{verbatim}
SELECT * FROM ivoa.obscore
NATURAL JOIN ivoa.obscore_hea
WHERE
(CONTAINS(POINT('ICRS', 98.24, 5.81), CIRCLE('ICRS', s_ra, s_dec, s_fov)) = 1)
AND (dataproduct_type IN ('hea-event-bundle', 'hea-event-list',
'response-function'))
AND (obs_collection = 'ANTARES-2017-PS')
\end{verbatim}
\subsubsection{Use Case --- Retrieve the instrument response functions for a combined KM3NeT \& CTA sensitivity study for a point source.}
{\em To study the combined future sensitivity for a source that is expected to emit gamma rays and neutrinos, retrieve general IRFs from both instruments to perform a sensitivity study for a source like Vela X as in \textbf{\hyperref[https://doi.org/10.1140/epjc/s10052-023-12279-z]{Eur. Phys. J. C. 84, 112 (2024)}}, considering only track-like events due to their better angular resolution.}
\medskip
\noindent Find all IRF datasets satisfying:
\begin{enumerate}[(i)]
\item Source (0.8, -45.19) within detector field of view
\item dataproduct\_type = ``response-function'',
\item dataproducts from the ``ARCA'' instrument of the ``KM3NeT'' facility,
\item t\_min/t\_max from 2027--2030, ({\em i.e.\/}, MJD 61406--62870),
\item event\_type = ``track'',
\item analysis mode optimized for pointsource searches.
\end{enumerate}
\begin{verbatim}
SELECT * FROM ivoa.obscore
NATURAL JOIN ivoa.obscore_hea
WHERE
(CONTAINS(POINT('ICRS', 0.8, -45.19), CIRCLE('ICRS', s_ra, s_dec, s_fov)) = 1)
AND (dataproduct_type = 'response-function'))
AND (facility_name = 'KM3NeT')
AND (instrument_name LIKE '%ARCA%')
AND (t_max >= 61406)
AND (t_min <= 62870)
AND (event_type = 'track')
AND (analysis_mode = 'pointsource')
\end{verbatim}
% mireille : this query searches in KM3net data collection, but should it be also sent to a CTA archive in order to build the comparison?
\subsubsection{Use Case --- Study the combined neutrino flux for the Galactic plane}
{\em Identify all neutrino data sets in the region of the Galactic plane to perform a combined neutrino flux study extending a study like the IceCube \textbf{Observation of high-energy neutrinos from the Galactic plane. DOI: 10.1126/science.adc9818}, using event lists and IRFs of datasets optimized for the analysis of diffuse neutrino emission.}
\medskip
\noindent Find all neutrino datasets satisfying:
\begin{enumerate}[(i)]
\item dataproduct\_type = ``hea-event-bundle'',
\item messenger\_name = ``neutrino'',
\item analysis\_mode = ``diffuse'',
\item Galactic plane box within the detector field of view.
\end{enumerate}
% diffuse
\begin{verbatim}
SELECT * FROM ivoa.obscore
NATURAL JOIN ivoa.obscore_hea
WHERE
(dataproduct_type = 'hea-event-bundle')
AND (messenger_name = 'neutrino')
AND (analysis_mode = 'diffuse')
AND 1 = INTERSECTS(
CIRCLE('ICRS', s_ra, s_dec, 80),
BOX('GALACTIC', 0, 0, 30, 2))
\end{verbatim}
\subsubsection{Use Case --- Calculate the probability for a source class to be emitters of tau neutrinos}
{\em Using a catalog of potential sources, calculate the probability of measuring a $\nu_{\tau}$ neutrino flux from a stacking of all sources of that type with 10 years of data taking with widely spaced, high energy optical detectors like KM3NeT/ARCA.}
% proposal 2
\medskip
\noindent Find all neutrino datasets satisfying:
\begin{enumerate}[(i)]
\item dataproduct\_type = ``response-function'', dataproduct\_subtype = ``aeff``
\item messenger\_pdgid contains ``$-16$'' or ``$+16$'',
\item obs\_mode = ``wide-array'',
\item analysis\_mode = ``pointsource''.
\end{enumerate}
\begin{verbatim}
SELECT * FROM ivoa.obscore
NATURAL JOIN ivoa.obscore_hea
WHERE
(dataproduct_type = 'response-function')
AND (dataproduct_subtype = 'aeff')
AND (messenger_pdgid = '-16' OR messenger_pdgid = '+16')
AND (obs_mode LIKE '%wide-array%')
AND (analysis_mode LIKE '%pointsource%')
\end{verbatim}
\subsection{Advanced Data Products}
\subsubsection{Use Case --- Search for Chandra Source Catalog position error MCMC draws for X-ray detections in the vicinity of Gaia DR3 486718823701242368}
{\em Identify all Chandra Source Catalog position error MCMC draws for source detections that fall within 5 arcsec radius of (54.036061, $+61.907633$). The MCMC draws will be evaluated to establish whether there are potentially unresolved X-ray sources that may coincide with the white dwarf for observation planning.\/}
% proposal 1 obscore only
\medskip
\noindent Find all datasets satisfying:
\begin{enumerate}[(i)]
\item Position within 5.0 arcsec from (54.036061, $+61.907633$),
\item dataproduct\_type = ``draws'',
\item dataproduct\_subtype = ``poserr'',
\item obs\_collection = ``CSC2''.
\end{enumerate}
\begin{verbatim}
SELECT * FROM ivoa.obscore
NATURAL JOIN ivoa.obscore_hea
WHERE
(CONTAINS(POINT(s_ra, s_dec), CIRCLE(54.036061, +61.907633, 0.0013888)) = 1)
AND (dataproduct_type = 'draws')
AND (dataproduct_subtype = 'poserr')
AND (obs_collection = 'CSC2')
\end{verbatim}
% mireille: naive question: do we really need the join with the ivoa.obscore_hea table ?
% constraints on event_type would require it but no criteria from ivoa.obscore_hea is used
\subsubsection{Use Case --- Search for flux maps for CTAO-North observations between two observations ID}
{\em Identify all flux maps from the CTAO-North data collection within a range of observation identifiers selected by the user.\/}
% proposal obscore only would work with Obscore 1.1
\medskip
\noindent Find all datasets satisfying:
\begin{enumerate}[(i)]
\item dataproduct\_type = ``image'',
\item dataproduct\_subtype = ``fluxmap'',
\item obs\_collection = ``CTAO-DR1'',
\item int(obs\_id) $> 4374$,
\item int(obs\_id) $\leq 4379$,
\item instrument\_name contains ``CTAO-N''.
\end{enumerate}
\begin{verbatim}
SELECT * FROM ivoa.obscore
NATURAL JOIN ivoa.obscore_hea
WHERE
((dataproduct_type = 'image')
OR (dataproduct_subtype = 'fluxmap'))
AND (obs_collection = 'CTAO-DR1')
AND (instrument_name LIKE 'CTAO-N')
AND (CAST(obs_id AS INTEGER) > 4374)
AND (CAST(obs_id AS INTEGER) <= 4379)
\end{verbatim}
\subsubsection{Use Case --- Search for M31 source light curves and aperture photometry probability density functions that intersect a specific time interval}
{\em Identify all light curves and aperture photometry probability density functions of X-ray sources detected in the field of M31 covering the energy range 0.3--7.0 keV that include observation data in the interval MJD 56320--56325 TT during which interval a transient event was thought to have occurred. Because the data products are expected to include extremely sparse time axes, the t\_intervals TMOC must be used for the query.\/}
%mireille
%\TODO{when data product is light-curve, use the new term "light-curve" of the product-type vocabulary instead of "timeseries" which is the top concept in the vocabulary. This vocabulary should be adopted for the new implementations of ObsCore 1.1 and the next versions. }
% proposal 1 with join to ivoa.obscore-hea
\medskip
\noindent Find all datasets satisfying:
\begin{enumerate}[(i)]
\item Position within 1.5 degrees from (10.6847, $+41.2688$),
\item dataproduct\_type = ``light-curve'' {\em or\/} ``pdf'',
\item calib\_level = 4,
% mireille \item energy\_min $\leq 0.3$ {\em and\/} energy\_max $\geq 7.0$,
\item energy\_min $\geq 0.3$ {\em and\/} energy\_max $\leq 7.0$,
\item t\_intervals TMOC intersects\footnote{We note that this function does not yet exist in ADQL} MJD 56320--56325 TT.
\end{enumerate}
\begin{verbatim}
SELECT obs_publisher_did, dataproduct_type, calib_level, energy_min,
energy_max, t_min, t_max, access_url FROM ivoa.obscore
NATURAL JOIN ivoa.obscore_hea
WHERE
(CONTAINS(POINT(s_ra, s_dec), CIRCLE(10.6847, +41.2688, 1.5)) = 1)
AND ((dataproduct_type = 'light-curve') OR (dataproduct_type = 'pdf'))
AND (calib_level = 4)
AND (energy_min <= 300.0) AND (energy_max >= 7000.0)
AND (INTERSECTS(TMOC(27, t_intervals), TMOC(27, 56320.0, 56325.0)) = 1)
\end{verbatim}
\subsubsection{Use Case --- Search for the CTAO flux light curves of PKS 2155-304 in 2030}
{\em Identify all light curves obtained on the source PKS 2155-304 in 2030 with the CTAO observatory.\/}
% proposal ivoa.obscore with join to ivoa.obscore-hea
\medskip
\noindent Find all datasets satisfying:
\begin{enumerate}[(i)]
\item dataproduct\_type = ``light-curve'',
\item obs\_collection = ``CTAO-DR1'',
\item tmin $\geq 62502$ ({\em i.e.\/}, 2030-01-01),
\item tmax $\leq 62866$ ({\em i.e.\/}, 2030-12-31),
\item target\_name = ``PKS 2155-304''.
\end{enumerate}
\begin{verbatim}
SELECT * FROM ivoa.obscore
NATURAL JOIN ivoa.obscore_hea
WHERE
(dataproduct_type = 'light-curve')
AND (obs_collection = 'CTAO-DR1'
AND (t_min >= 62502)
AND (t_max <= 62866)
AND target_name = 'PKS 2155-304')
\end{verbatim}