<resource schema="annisred">
	<meta name="creationDate">2015-02-15T09:49:00</meta>
	<meta name="schema-rank">1000</meta>
	<meta name="description" format="plain">
		This survey gives photometric redshifts of objects within 275 deg²
		(−50◦ &lt; α &lt; 60◦ and −1.◦25 &lt; δ &lt; +1.◦25) centered on the
		Celestial Equator. Each piece of sky has ∼20 runs of repeated
		scanning by the SDSS camera contributing and thus reaches ∼2 mag
		fainter than the SDSS single pass data, i.e., to r ∼ 23.5 for
		galaxies.
	</meta>
	<meta name="creator">
		Annis, J.; Soares-Santos, M.; Strauss, M.A.; Becker, A.C.;
		Dodelson, S.; Fan, X.; Gunn, J.E.; Hao, J.; Ivezi, Z.;
		Jester, S.; Jiang, L.; Johnston, D.E.; Kubo, J.M; Lampeitl,
		H; Lin, H.; Lupton, R.H.; Miknaitis, G.; Seo H.-J.; Simet,
		M.; Yanny, B.
	</meta>
	<meta name="title">Stripe 82 Photometric Redshifts from
		SDSS Coadditions</meta>
	<meta name="content">
		<meta name="type">Catalog</meta>
	</meta>
	<meta name="coverage.waveband">Optical</meta>

	<meta name="subject">redshift-surveys</meta>
	<meta name="subject">observational-cosmology</meta>
	<meta name="subject">galaxies</meta>

	<meta name="source">2014ApJ...794..120A</meta>

	<table id="main" onDisk="True" adql="True" mixin="//scs#q3cindex">
		<mixin>//scs#pgs-pos-index</mixin>
		<index columns="objID"/>
		<index columns="zphot"/>

		<stc>
			Position ICRS "raj2000" "dej2000"
			Redshift "zphot" Error "zphoterr"
		</stc>

		<column name="objID" type="bigint" required="True"
			ucd="meta.id;meta.main"
			description="Unique SDSS identifier."
			verbLevel="1"/>
		<column name="run" type="smallint" required="True"
			tablehead="Run"
			description="Run number"
			ucd="meta.id;obs"
			note="s"/>
		<column name="rerun" type="smallint" required="True"
			tablehead="Rerun"
			description="Rerun number"
			ucd="meta.id;obs"
			note="s"/>
		<column name="camcol" type="smallint" required="True"
			tablehead="Col."
			description="Camera column"
			ucd="meta.id;instr"
			note="s"/>
		<column name="fieldId" type="bigint" required="True"
			tablehead="Field"
			description="Field number"
			ucd="meta.id;obs.field"
			note="s"/>
		<column name="obj" type="smallint" required="True"
			tablehead="Ob. Id"
			description="The object id within a field. Usually changes between
				reruns of the same field."
			ucd="meta.id"
			note="s"/>
		<column name="raj2000" type="double precision"
			unit="deg" ucd="pos.eq.ra;meta.main"
			description="Right ascension of the object."
			verbLevel="1" displayHint="sf=7"/>
		<column name="dej2000" type="double precision"
			unit="deg" ucd="pos.eq.dec;meta.main"
			description="Declination of the object."
			verbLevel="1" displayHint="sf=7"/>
		<column name="zphot"
			unit=""
			description="Photometric redshift from SDSS' PHOTO pipeline"
			verbLevel="1"
			displayHint="sf=2">
			<values min="0.0" max="2.0"/>
		</column>
		<column name="zphoterr"
			unit=""
			description="Error in the photometric redshift from
				SDSS' PHOTO pipeline"
			verbLevel="1"
			displayHint="sf=2"/>

		<meta name="note" tag="s">
			More information on SDSS-specific terms can be found in
			:bibcode:`2002AJ....123..485S`.  Coadd run numbers are artificial.
		</meta>
	</table>

	<coverage>
		<updater spaceTable="main"/>
		<temporal>1999-09-25 2005-12-01</temporal>
		<spatial>4/1109-1110,1113-1114,1125-1126,1129-1130,1173-1174,1177-1178,1189-1190,1193-1194,1449-1450,1877 5/0,3072,4351,4415,4431,4435,4444,4451,4460,4464,4495,4499,4508,4515,4524,4528,4544,4671,4687,4691,4700,4707,4716,4720,4751,4755,4764,4771,4780,4784,4800,4864,5775,5784,5786-5787,5795,5804,5808,7507,7516,9215,12287 6/4,8,12292,12296,17399,17403,17655,17659,17719,17723,17735,17739,17780,17784,17799,17803,17844,17848,17860,17864,17975,17979,17991,17995,18036,18040,18055,18059,18100,18104,18116,18120,18180,18184,18679,18683,18743,18747,18759,18763,18804,18808,18823,18827,18868,18872,18884,18888,18999,19003,19015,19019,19060,19064,19079,19083,19124,19128,19140,19144,19204,19208,19460,19464,23095,23099,23142,23175,23179,23220,23224,23236,23240,30023,30053,30068,36855,36859,49143,49147</spatial>
	</coverage>

	<data id="import">
		<sources recurse="True">
			<pattern>data/*.fit</pattern>
		</sources>
<!--		<fitsTableGrammar /> -->
		<directGrammar cBooster="res/boosterfunc.c" id="booster"
				type="fits">
			<mapKeys>
				fieldId: field,
				raj2000:ra,
				dej2000:dec,
				zphot: ZPHOT,
				zphoterr: ZPHOTERR
			</mapKeys>
		</directGrammar>
		<make table="main" >
			<rowmaker idmaps="*">
				<simplemaps>
					fieldId: field, raj2000:ra, dej2000:dec,
					zphot: ZPHOT, zphoterr: ZPHOTERR
				</simplemaps>
			</rowmaker>
		</make>
	</data>

	<service id="cone" allowed="form,scs.xml">
		<meta name="shortName">s82 coadd cone</meta>
		<publish render="form" sets="ivo_managed,local"/>
		<publish render="scs.xml" sets="ivo_managed"/>

		<meta name="testQuery">
			<meta name="ra">331.308</meta>
			<meta name="dec">-1.073</meta>
			<meta name="sr">0.01</meta>
		</meta>

		<scsCore queriedTable="main">
	 		<FEED source="//scs#coreDescs"/>
	 		<condDesc buildFrom="zphot"/>
	 		<condDesc buildFrom="objID"/>
	 	</scsCore>
	</service>

	<regSuite title="annisred data">
		<regTest title="Cone search looks ok">
			<url ra="0.01" dec="-1.1129" sr="0.01" zphot="0.5 0.6"
				_DBOPTIONS_ORDER="objid"
				>cone/scs.xml</url>
			<code>
				row = self.getFirstVOTableRow()
				self.assertAlmostEqual(row['dej2000'], -1.11291425559299)
				self.assertAlmostEqual(row['zphoterr'], 0.04993300139904022)
				self.assertAlmostEqual(row['objID'], '8647474690334458051')
			</code>
		</regTest>
	</regSuite>
</resource>
