<resource schema="polcatsmc">
	<meta name="creationDate">2014-12-11T13:06:00</meta>
	<meta name="schema-rank">100</meta>
	<meta name="title">Optical Polarimetric Catalog for the SMC</meta>
	<meta name="creator">Lobo Gomes, A.; Magalhães, A. M.;
		Pereyra, A.; Rodrigues, C. V.</meta>
	<meta name="description">
		An optical polarimetric catalog for the Small Magelanic Cloud (SMC) is
		presented. It gives intrinsic and observed polarizations in the V-band
		for a total of 7207 stars located in the Northeast and Wing sections
		of the SMC and part of the Magellanic Bridge.
		</meta>
	<meta name="source">2015ApJ...806...94L</meta>
	<meta name="facility">Cerro Tololo Inter-American Observatory
		(CTIO)</meta>
	
	<meta name="subject">polarimetry</meta>
	<meta name="subject">dwarf-galaxies</meta>
	<meta name="subject">magnetic-fields</meta>
	<meta name="subject">small-magellanic-cloud</meta>

	<meta name="coverage">
		<meta name="waveband">Optical</meta>
	</meta>

	<STREAM id="intrinsic_fields">
		<doc>
			Columns the intrinsic table contributes to the total, finished one.
		</doc>

		<column name="pol_int"
			unit=""
			tablehead="Pol_int"
			description="Intrinsic polarisation in per cent of total flux,
				obtained by substracting the foreground polarization due
				to Milky Way dust from the observed polarization pol_obs.
				See paper, chapter 3, for details on foreground determination."
			verbLevel="1">
			<values min="0.0524" max="5.4077"/>
		</column>
		<column name="e_pol_int"
			unit=""
			tablehead="Err. Pol_int"
			description="Error on the intrinsic polarisation, including
				errors on observed polarisation and the estimate of the
				polarization due to forground dust."
			verbLevel="11"/>
		<column name="pa_pol_int"
			unit="deg"
			tablehead="PA Pol_int"
			description="Position angle of the intrinsic polarisation"
			verbLevel="1"/>
	</STREAM>

	<table id="_intrinsics" primary="poskey">
		<meta name="description">An internal table representing datafilesmcint
			used during main table import.</meta>
		<column name="poskey" type="text"
			description="Position are written in the source file"/>
		<FEED source="intrinsic_fields"/>
	</table>

	<table id="data" onDisk="True" mixin="//scs#q3cindex" adql="True">
		<mixin>//scs#pgs-pos-index</mixin>
		<stc>
			Position ICRS Epoch J1995.85 "raj2000" "dej2000"
		</stc>
		<column name="ct" type="integer" required="True"
			ucd="meta.id;meta.main"
			tablehead="Id"
			description="Object running number"
			verbLevel="1"/>
		<column name="raj2000" type="double precision"
			unit="deg" ucd="pos.eq.ra;meta.main"
			tablehead="RA"
			description="Object Right Ascension ICRS"
			verbLevel="1"
			displayHint="sf=6"/>
		<column name="dej2000" type="double precision"
			unit="deg" ucd="pos.eq.dec;meta.main"
			tablehead="Dec"
			description="Object Declination ICRS"
			verbLevel="1"
			displayHint="sf=7"/>

		<column name="pol_obs"
			unit=""
			tablehead="Pol_obs"
			description="Observed polarization in percent of total flux,
				obtained by determining the Q and U stokes parameters from
				V photometry in four different angles."
			verbLevel="1">
			<values min="0.027" max="5.148"/>
		</column>
		<column name="e_pol_obs"
			unit=""
			tablehead="Err. Pol_obs"
			description="Error in observed polarization including pixel noise.
			The error is given in percent of the total flux."
			verbLevel="11"/>
		<column name="pa_pol_obs"
			unit="deg"
			tablehead="PA Pol_obs"
			description="Position angle of the observed polarization"
			verbLevel="1"/>

		<FEED source="intrinsic_fields"/>

		<column name="vmag"
			unit="mag" ucd="phot.mag;em.opt.V"
			tablehead="m_V"
			description="V band magnitude obtained by summing up the flux
				of the image pair in one frame and calibrating against several
				published catalogs (see Table 3 in the paper)."
			verbLevel="1">
			<values min="9.6899" max="20.6986"/>
		</column>
		<column name="e_vmag"
			unit="mag" ucd="stat.error;phot.mag;em.opt.V"
			tablehead="Err. m_V"
			description="Error in V band magnitude, including photon noise
				and dispersion in the magnitude calibration."
			verbLevel="11"/>
	</table>

	<coverage>
		<updater spaceTable="data"/>
		<temporal>1992-11-13 1992-11-17</temporal>
		<spatial>6/32950-32951,32956-32958,33295,33297-33299,33304-33306,33328</spatial>
	</coverage>

	<data id="_import_intrinsics" auto="false">
		<!-- called by import -->
		<sources pattern="data/datafilesmcint.txt"/>
		<columnGrammar topIgnoredLines="22">
			<colDefs>
				poskey:7-34
				pol_int: 39-44
				e_pol_int: 49-54
				pa_pol_int: 59-64
			</colDefs>
		</columnGrammar>
		<make table="_intrinsics"/>
	</data>

	<data id="import">
		<sources pattern="data/datafilesmcobs.txt"/>
		<columnGrammar topIgnoredLines="22">
			<colDefs>
				ct: 1-4
				key:7-34
				ra_se: 9-18
				dec_se: 23-34
				pol_obs: 39-44
				e_pol_obs: 49-54
				pa_pol_obs: 59-64
				vmag: 69-76
				e_vmag: 81-87
			</colDefs>
		</columnGrammar>

		<make table="data">
			<rowmaker idmaps="*">
				<map key="raj2000">hmsToDeg(@ra_se)</map>
				<map key="dej2000">dmsToDeg(@dec_se)</map>

				<apply name="add_intrinsic">
					<setup>
						<code>
							from gavo import rsc

							intrinsics = rsc.makeData(rd.getById(
								"_import_intrinsics")).getPrimaryTable()
						</code>
					</setup>
					<code>
						try:
							vars.update(intrinsics.getRow(@key))
						except KeyError:
							vars["pol_int"] = vars["e_pol_int"] = vars["pa_pol_int"] = None
					</code>
				</apply>
			</rowmaker>
		</make>
	</data>

	<service id="cone" allowed="scs.xml,form">
		<meta name="shortName">PolCatSMC</meta>
		<meta name="testQuery">
			<meta name="ra">26.322542</meta>
			<meta name="dec">-74.5414167</meta>
			<meta name="sr">0.01</meta>
		</meta>
		<publish render="scs.xml" sets="ivo_managed"/>
		<publish render="form" sets="ivo_managed,local"/>

		<scsCore queriedTable="data">
	 		<FEED source="//scs#coreDescs"/>
			<condDesc buildFrom="pol_int"/>
			<condDesc buildFrom="pol_obs"/>
			<condDesc buildFrom="vmag"/>
		</scsCore>
	</service>
</resource>
