<resource schema="antares10">
	<meta name="title">2007-2010 ANTARES search for cosmic neutrino point sources</meta>
	<meta name="description">
		A time integrated search for point sources of cosmic neutrinos was
		performed using the data collected from January 2007 to November 2010 by
		the ANTARES neutrino telescope. This dataset includes a total of 3058
		events obtained during the effective livetime of 813 days.

		This is legacy data.  The most recently released data can be found
		at ivo://org.gavo.dc/antares/q/cone.
	</meta>
	<meta name="_longdoc" format="rst">
This table can be used for TAP queries.  To give you an idea of what
you can do, there's an example_ in the TAP service.

A `worked out use case`_ on comparing IceCube and Antares data using TOPCAT
was kindly contributed by Vladimir Kulikovsky.

Here is another sample query that gives, for all the areas of the
neutrinos, the average energy and the number of photons per area from
the ROSAT survey::

	SELECT
		a.id,
		AVG(energy_cor) AS mean_energy,
		COUNT(*)/(ang_error*ang_error)/exposure_time
	FROM antares10.data AS a
	JOIN rosat.photons AS p on
	1=CONTAINS(POINT('', p.raj2000, p.dej2000),origin_est)
	GROUP BY a.id, ang_error

Note that since this has to do a linear scan through the relatively large
ROSAT photon table, the query will take a while; you will need to execute
it in async mode.

In a separate step, you could compute these averages for the entire table and
see if some systematics show up.

.. _example: http://dc.g-vo.org/tap/examples#Matchingneutrinosearchareaswithnormaltables
.. _worked out use case: /antares10/q/cone/static/HowtoAntares_IceCube_in_TopCAT.pdf
	</meta>
	<meta name="creationDate">2015-12-10T07:42:00</meta>
	<meta name="schema-rank">1000</meta>

	<meta name="subject">cosmological-neutrinos</meta>
	<meta name="subject">neutrino-astronomy</meta>
	<meta name="subject">particle-astrophysics</meta>

	<meta>
		coverage.waveband:Neutrino
		coverage.regionOfRegard: 1
	</meta>

	<meta name="creator">	
Adrián-Martínez, S.; Samarai, I. Al; Albert, A.; André, M.; Anghinolfi, M.;
Anton, G.; Anvar, S.; Ardid, M.; Astraatmadja, T.; Aubert, J.-J.; Baret, B.;
Basa, S.; Bertin, V.; Biagi, S.; Bigongiari, C.; Bogazzi, C.; Bou-Cabo, M.;
Bouhou, B.; Bouwhuis, M. C.; Brunner, J.; Busto, J.; Capone, A.; Cârloganu, C.;
Carr, J.; Cecchini, S.; Charif, Z.; Charvis, Ph.; Chiarusi, T.; Circella, M.;
Coniglione, R.; Core, L.; Costantini, H.; Coyle, P.; Creusot, A.; Curtil, C.;
De Bonis, G.; Decowski, M. P.; Dekeyser, I.; Deschamps, A.; Distefano, C.;
Donzaud, C.; Dornic, D.; Dorosti, Q.; Drouhin, D.; Eberl, T.; Emanuele, U.;
Enzenhöfer, A.; Ernenwein, J.-P.; Escoffier, S.; Fehn, K.; Fermani, P.; Ferri,
M.; Ferry, S.; Flaminio, V.; Folger, F.; Fritsch, U.; Fuda, J.-L.; Galatà, S.;
Gay, P.; Geyer, K.; Giacomelli, G.; Giordano, V.; Gleixner, A.; Gómez-González,
J. P.; Graf, K.; Guillard, G.; Hallewell, G.; Hamal, M.; van Haren, H.;
Heijboer, A. J.; Hello, Y.; Hernández-Rey, J. J.; Herold, B.; Hößl, J.; Hsu, C.
C.; de Jong, M.; Kadler, M.; Kalekin, O.; Kappes, A.; Katz, U.; Kavatsyuk, O.;
Kooijman, P.; Kopper, C.; Kouchner, A.; Kreykenbohm, I.; Kulikovskiy, V.;
Lahmann, R.; Lambard, G.; Larosa, G.; Lattuada, D.; Leonora, E.; Lefèvre, D.;
Lim, G.; Lo Presti, D.; Loehner, H.; Loucatos, S.; Louis, F.; Mangano, S.;
Marcelin, M.; Margiotta, A.; Martínez-Mora, J. A.; Meli, A.; Montaruli, T.;
Morganti, M.; Motz, H.; Neff, M.; Nezri, E.; Palioselitis, D.; Păvălaş, G. E.;
Payet, K.; Petrovic, J.; Piattelli, P.; Popa, V.; Pradier, T.; Presani, E.;
Racca, C.; Reed, C.; Riccobene, G.; Richter, R.; Rivière, C.; Robert, A.;
Roensch, K.; Rostovtsev, A.; Ruiz-Rivas, J.; Rujoiu, M.; Samtleben, D. F. E.;
Sapienza, P.; Schmid, J.; Schnabel, J.; Schuller, J.-P.; Schüssler, F.; Seitz,
T.; Shanidze, R.; Simeone, F.; Spies, A.; Spurio, M.; Steijger, J. J. M.;
Stolarczyk, Th.; Sánchez-Losa, A.; Taiuti, M.; Tamburini, C.; Trovato, A.;
Vallage, B.; Vallée, C.; Van Elewyck, V.; Vecchi, M.; Vernin, P.; Visser, E.;
Wagner, S.; Wijnker, G.; Wilms, J.; de Wolf, E.; Yepes, H.; Zaborov, D.;
Zornoza, J. D.; Zúñiga, J.</meta>
	<meta name="creator.logo">/antares10/q/cone/static/antares_logo.png</meta>
	<meta name="instrument">ANTARES</meta>

	<meta name="source">2012ApJ...760...53A</meta>
	<meta name="contentLevel">Research</meta>
	<meta name="type">Catalog</meta>
	<meta name="isPreviousVersionOf"
		ivoId="ivo://org.gavo.dc/antares/q/cone"
		>Antares neutrion point source analysis 2007-2012</meta>

	<table id="data" onDisk="True" adql="True" primary="id">
	  <index columns="ang_error"/>

		<column name="id" type="text"
			ucd="meta.id;meta.main"
			tablehead="Id"
			description="Identifier for this neutrino."
			verbLevel="1"/>
		<column name="raj2000"
			unit="deg" ucd="pos.eq.ra;meta.main"
			tablehead="RA"
			description="Right Ascension, ICRS"
			verbLevel="1"/>
		<column name="dej2000"
			unit="deg" ucd="pos.eq.dec;meta.main"
			tablehead="Dec"
			description="Declination, ICRS"
			verbLevel="1"/>
		<column name="n_hits" type="smallint" required="True"
			ucd="meta.number;obs"
			tablehead="N"
			description="Number of signals from the photo multiplier tubes
				contributing to this observation."
			verbLevel="1"/>
		<column name="ang_error"
			unit="deg" ucd="stat.error;pos"
			tablehead="Ang. Error"
			description="1 sigma confidence radius of the position."
			verbLevel="1">
			<values min="0.1" max="1.0"/>
		</column>
		<column name="origin_est" type="scircle"
			ucd="meta.id;obs.field"
			tablehead="Est. Origin"
			description="A circle around the most likely position with ang_error
				radius (for convenient matching)."
			verbLevel="30"/>
	</table>

	<coverage>
		<updater sourceTable="data" mocOrder="4"/>
		<spatial>2/136,162 3/1-2,9,67,141,168,256-257,261-262,265-266,269,273,278,281,284,287,298,308,320,322,325,332,338,343,354-356,364,366,369,382,385,389,391,418,420,423,436,449,452-453,463,471-472,474,476,480,495,508,512-513,515,517,523-524,526-527,529-530,535,548-549,552,554-556,558-560,565,570,579,582-583,586-587,590-591,593-595,597,600-601,604,606,608,610,613-614,616-617,625,630,634,641-642,644-646,653,655-656,658-662,664-665,667-669,671-672,675-677,680,684,686,688-689,693,704-706,708-709,713,715,717-718,720-721,724,728-730,735-737,739,745,748,752,755,760,764 4/0-2,12-13,15,18,24,26,31,34,43-44,46-48,50,56,59-60,64-66,69,73,75,77,83,104,128-129,131,133,136,138,146-147,152,154,156,164,168-169,176,256-257,259,261-262,265-267,272-274,276,279,281-282,284,286-287,289-292,294-297,301-302,304-305,311,314,316,319,325,327,329,331-332,335-337,345,354-356,360-361,368,385-386,388,394,398,401,404-405,407-409,411,416,419-421,423-424,512,514,516,519,521,523-525,527,531-533,537-538,540,542-544,546-548,556,561,563,571,573,575,580,586-587,594,599,608-610,612,620,644-646,652,655,661-663,676,678,680,682,768-770,773-777,780-781,783-785,787,789-790,794-795,798,800-802,806,808-810,814-815,819,821-824,826,829,834,836,838,840,842,844,846,848,852-853,858,866,868,870,874,899,904,910-912,914,916,920,929,931,933-934,937,1032-1034,1037,1040-1041,1043,1052-1054,1057-1058,1068-1070,1072,1074-1075,1080-1081,1083-1086,1088,1090-1091,1096-1097,1099,1104-1105,1108-1109,1111,1116-1118,1120,1123,1128,1130-1134,1140,1143-1146,1152-1153,1155-1157,1160-1161,1163,1167-1170,1172-1174,1178,1180,1182,1184,1186-1187,1189-1191,1199-1200,1202-1205,1207-1209,1213-1218,1221-1222,1225-1227,1230,1236-1237,1239-1240,1242-1243,1246,1248-1249,1251,1254,1257,1259-1260,1262-1263,1265,1269,1278,1284-1285,1287,1293-1294,1296,1298-1299,1306-1307,1309-1314,1316,1318-1322,1324-1325,1327,1335,1338,1340-1341,1344-1346,1349,1351,1356,1362-1363,1365,1367,1369,1371,1376-1377,1379-1380,1383-1384,1386,1388-1390,1392,1394-1397,1401,1404-1405,1408-1410,1412,1415,1430,1432,1435,1438,1442-1445,1447-1448,1450-1451,1453-1455,1460-1462,1471-1472,1474-1475,1482-1486,1491,1493-1496,1504,1506-1507,1514-1517,1519-1520,1522-1523,1536,1539,1544,1546-1549,1551-1554,1560,1562,1568,1570,1573-1575,1577,1579-1580,1582,1584-1585,1587-1589,1591,1593-1596,1598-1600,1603-1605,1608-1609,1611-1612,1614,1616-1617,1619,1624-1625,1627,1629,1633-1636,1638-1642,1644-1645,1648-1649,1651-1654,1657-1659,1664-1666,1668,1670-1671,1677-1679,1684-1685,1687,1689-1691,1696,1698,1700,1702-1705,1708,1711-1714,1717,1719,1721,1723-1724,1726-1727,1729-1730,1733,1741,1743,1749,1751-1752,1754-1755,1757-1760,1762-1763,1765-1766,1768,1774,1780,1782,1790,1792-1794,1801-1806,1816,1818-1819,1824-1825,1828,1830,1833-1836,1838,1841,1843,1845-1850,1858-1859,1864-1865,1868-1869,1872-1873,1875,1877,1879,1881-1882,1892,1895,1900-1901,1903,1911-1912,1914,1917-1919,1930,1933-1935,1938-1940,1942-1945,1948,1950-1954,1956,1958-1961,1969-1972,1975-1977,1979,1984-1985,1987-1989,1993-1994,1997-1998,2000,2004,2007,2012,2015-2018,2020-2022,2027,2030-2031,2037,2041,2043-2045,2047,2056-2058,2064,2066-2067,2072,2074-2075,2077-2079,2081,2083,2085-2086,2089-2091,2100-2101,2103,2114-2115,2124,2126-2127,2129-2131,2133-2136,2139,2144-2145,2147-2148,2150-2153,2155,2157-2158,2160,2163-2165,2167,2169,2171-2172,2174,2202-2205,2207,2212-2213,2215,2229-2231,2244-2245,2249-2250,2252-2253,2255,2257,2259,2265-2268,2270-2273,2275-2276,2278,2285,2287-2290,2292,2294-2295,2297-2298,2300,2305-2307,2309-2311,2313-2315,2322,2325-2327,2336-2338,2340-2341,2343,2352-2354,2357-2359,2368-2370,2384,2386-2387,2392-2394,2397-2399,2408,2410-2412,2414-2415,2420,2422-2423,2428,2430-2431,2436,2438-2439,2445-2450,2461-2463,2473,2475,2477,2479-2481,2483-2484,2486-2490,2492-2494,2496-2497,2499,2504-2506,2509-2513,2516,2527-2528,2530-2532,2535,2540-2541,2543,2545-2550,2552-2554,2556-2557,2559-2560,2562,2572-2574,2588,2590-2591,2609-2611,2616,2618-2619,2628-2630,2652,2654-2655,2664,2666-2667,2680-2681,2693-2696,2698-2699,2712-2714,2716,2719,2725-2726,2728,2730-2731,2734-2735,2740-2742,2748-2750,2761-2762,2765-2766,2768-2770,2776-2777,2781,2783,2786,2788-2790,2794-2795,2798,2800,2802-2806,2809,2811-2814,2828,2830-2831,2841-2844,2846-2848,2850-2851,2856-2858,2864-2865,2867,2876-2877,2879,2888,2890-2893,2895,2900-2902,2904,2906-2909,2911,2925,2927-2928,2930,2932,2934-2936,2939,2952-2953,2955,2960,2962-2963,2965-2969,2971,2973-2978,2984,2986-2990,2997,2999-3001,3003,3005,3007,3012,3017-3019,3025,3031-3033,3035-3038,3045-3050,3055,3061-3063,3066-3069,3071</spatial>
	</coverage>

	<data id="import">
		<sources pattern="data/*.dat"/>
		<reGrammar topIgnoredLines="3"
			names="ra,de,n_hits,ang_error"/>
		<make table="data">
			<rowmaker idmaps="*">
				<apply name="skip_broken_recs">
					<code>
						if float(@ang_error)&lt;0:
							raise IgnoreThisRow()
					</code>
				</apply>
				<var key="raj2000">float(@ra)</var>
				<var key="dej2000">float(@de)</var>
				<map key="origin_est">pgsphere.SCircle(
					pgsphere.SPoint.fromDegrees(@raj2000, @dej2000),
						float(@ang_error)*utils.DEG)</map>
				<apply>
					<setup>
						<par key="ids_used">set()</par>
					</setup>
					<code>
						ident = "ANTN %s%s"%(utils.degToHms(@raj2000, "", 0),
							utils.degToDms(@dej2000, "", 0))
						if ident in ids_used:
							for letter in range(25):
								guess = ident+chr(97+letter)
								if guess not in ids_used:
									ident = guess
									break
						ids_used.add(ident)
						@id = ident
					</code>
				</apply>
			</rowmaker>
		</make>
	</data>

	<service id="cone" allowed="form,scs.xml,static">
		<property name="staticData">res</property>
		<meta name="testQuery">
			<meta name="ra">278.4</meta>
			<meta name="dec">39.7</meta>
			<meta name="sr">0.1</meta>
		</meta>
		<meta name="maxSR">90</meta>
		<meta name="shortName">antares10 cone</meta>
		<publish render="scs.xml" sets="ivo_managed"/>
		<publish render="form" sets="ivo_managed"/>

		<scsCore queriedTable="data">
			<condDesc silent="True">
				<FEED source="//pql#DALIPars"/>
			</condDesc>
			<condDesc original="//scs#humanInput">
				<phraseMaker original="//scs#humanSCSPhrase">
					<setup original="//scs#scsSetup" id="proxQuery">
						<code><![CDATA[
							def genQuery(_, inPars, outPars):
								return ("scircle(spoint(radians(%%(%s)s), radians(%%(%s)s)),"
									" radians(%%(%s)s)) && origin_est")%(
									base.getSQLKey("RA", inPars["RA"], outPars),
									base.getSQLKey("DEC", inPars["DEC"], outPars),
									base.getSQLKey("SR", inPars["SR"], outPars))
						]]></code>
					</setup>
				</phraseMaker>
			</condDesc>
			<condDesc original="//scs#protoInput">
				<phraseMaker original="//scs#scsPhrase">
					<setup original="proxQuery"/>
				</phraseMaker>
			</condDesc>
			<condDesc buildFrom="ang_error"/>
		</scsCore>
		<outputTable verbLevel="20"/>
	</service>

	<regSuite title="antares10">
		<regTest title="antares10 cone SCS uses origin_est">
			<url RA="214.5" DEC="-87.7" SR="0.001">cone/scs.xml</url>
			<code>
				row = self.getFirstVOTableRow()
				self.assertEqual(row["id"], "ANTN 141800-875400")
				self.assertAlmostEqual(row["_r"], 0.200001525877841)
			</code>
		</regTest>

		<regTest title="antares10 form uses origin_est">
			<url parSet="form" hscs_pos="214.5 -87.7" hscs_sr="1">cone/form</url>
			<code>
				self.assertHasStrings("ANTN 141800-875400", "720.01")
			</code>
		</regTest>
	</regSuite>
</resource>
