<resource schema="spm4">
	<meta name="creationDate">2012-09-14T12:39:00Z</meta>
	<meta name="schema-rank">1000</meta>
	<meta name="title">Yale/San Juan SPM4 Catalog</meta>
	<meta name="description" format="plain">
		The SPM4 Catalog contains absolute proper motions, celestial coordinates,
		and B,V photometry for 103,319,647 stars and galaxies between the south
		celestial pole and -20 degrees declination.  The catalog is roughly
		complete to V=17.5.  It is based on photographic and CCD observations
		taken with the Yale Southern Observatory's double-astrograph at Cesco
		Observatory in El Leoncito, Argentina.
	</meta>

	<meta name="subject">stars</meta>
	<meta name="subject">surveys</meta>
	<meta name="subject">astrometry</meta>
	<meta name="subject">proper-motions</meta>

	<meta name="_longdoc" format="rst"><![CDATA[
Observations
============

The first-epoch survey, taken from 1965 to 1979, was entirely photographic.
The second-epoch survey is approximately 1/3 photographic (taken from 1988
to 1998) and 2/3 CCD-based (taken from 2004 through 2008).  The survey
consists of fields at 5-degree centers in declination and varying separation
along right ascension, but always less than or equal to 5 degrees.  Since
each photographic plate covers a 6.3 x 6.3 degree area of sky, there is
significant overlap in the photographic portion of the survey.  Also, each
field has a pair of blue and yellow passband plates taken (typically)
simultaneouly with the double-astrograph.  For a small fraction of the
fields, plates were repeated within the same "epoch".  Each photographic
observation consisted of two offset exposures, one 2 hours in duration, the
other 2 minutes.  Also, an objective wire grating was always used in order
to produce measurable grating images for the brighter stars.  In this
manner, the effective dynamic range of the plates was greatly increased,
allowing bright Hipparocos-magnitude stars to be linked to external galaxies
on the same plate.  A more thorough description of the plate material and
the various image systems is given by Girard et al. (1998).

All SPM plates were scanned with the Precision Measuring Machine (PMM) at the
US Naval Observatory's Flagstaff Station (NOFS).  The raw pixel data were
saved and later analyzed at the US Naval Observatory in Washington (USNO),
to obtain image centers and photometric indices for all detectable images.

Beginning in 2001, CCD cameras were installed on the double astrograph in
order to complete the SPM second-epoch survey.  (Photographic plates with
the 103 emulsion were no longer being produced.)  Two cameras were installed,
a 4K x 4K PixelVision (PV) camera (15 micron pixels) in the focal plane of
the yellow lens, and an Apogee 1K x 1K (24 micron pixels) camera behind the
blue lens.  The latter was later replaced by an Apogee Alta 2K x 2K (12
micron pixels) CCD camera.  Exposure times were 120-s, reaching the same
depth as the first-epoch plates.  As with the plates, the objective grating
was in place for the CCD observations.  A two-fold overlap of frames with
the PV's 0.93 x 0.93 degree FOV was initiated for all SPM fields lacking
second-epoch plate material.  Eventually, when it was found that a single
CCD exposure was superior to the multiple first-epoch plate material in
terms of astrometric precision, the two-fold coverage was changed to single
coverage with the PV frames.  The yellow lens' PV data were used for both
astrometry and photometry.  The blue lens' Apogee data were used only in
the photometric reductions.


Construction of the Catalog
===========================

The astrometric reductions, for both the photographic and CCD data, made
use of an input "master" catalog that was necessary to properly identify
the various multiple images (diffraction grating orders and, in the case of
the plates, multiple exposures).  This master catalog was constructed by
combining the following external catalogs in the specified order;

=== ===================================================================
 #   Source catalog
=== ===================================================================
 1   Hipparcos
 2   Tycho2
 3   UCAC2
 4   2MASS psc
 5   2MASS xsc (extended sources, largely (but not entirely!) galaxies)
 6   LEDA      (confirmed galaxies, Paturel et al. 2005, A&A 430, 751)
 7   QSO       (Veron-Cetty & Veron 2006, A&A 455, 773)
=== ===================================================================

Objects appearing in multiple catalogs were found by positional coincidence
and reconciled by adopting the position of the higher ranked one (Hipparocs
being considered best).  This master input catalog was then used to identify
all measurable images within the list of detections in the SPM plate and
CCD data.  Thus, an object that does not appear in any of these input
catalogs, cannot appear in the SPM4 catalog.  The completeness of the SPM4
is the product of the completeness of these input catalogs and the magnitude
limits and resolving limits (i.e., ability to center crowded/blended images)
of the SPM material.

There are 670 SPM field centers at declination -20 degrees and southward.
The SPM4 is comprised of 660 of these fields.  There are nine -20-deg fields
for which first-epoch plates were never taken and one -20-deg field for which
the first-epoch plates were mistakenly not measured.  Thus, the northern
boundary of the SPM4 sky coverage contains a small number of "notches"
at which the northernmost stars are at approximately -21.9 degrees instead
of -20 degrees.

An input master catalog, as described above, was constructed from cutouts
of the external source catalogs for each of the 660 SPM fields included
in the SPM4.  Within a single field, each object was assigned a "master"
ID number that was simply the running number corresponding to the order of
that object in the field's cumulative list.  Thus, Hipparcos stars would be
assigned the lowest numbers, increasing through Tycho2 stars, UCAC2 stars,
etc.  Combining the three digit field number with the seven digit master
catalog number within a field yields a star's overall SPM4 ID number.
Since many stars in the substantial overlap of neighboring fields would
possess multiple IDs, the ID from the lowest numbered field was adopted as
the unique SPM4 identifier.


Astrometric Reductions
''''''''''''''''''''''

All SPM plates were scanned with the PMM at NOFS.  The raw pixel data from
the scans were stored and sent to USNO for analysis.  The existing StarScan
pipeline (Zacharias et al. 2008) was heavily modified by USNO staff to
accomodate the SPM pixel data.  The overall process included a conversion of
the PMM transmission values into density values, smoothing the data for the
purposes of image detection and background fitting, and then fitting the
unsmoothed 2-d density profiles with an azimuthally symmetric exponential
function.  (Tests using an elliptical exponential function showed no
improvement over the azimuthally symmetric one, even for the slightly
elongated 1st and 2nd-order diffraction images.)  The derived image positions
on each of the 884 PMM CCD footprints required to cover an SPM plate were then
transformed into a single global coordinate system using information from the
overlap regions of adjacent footprints and the laser interferometric metrology
of the footprint centers.  As the resulting astrometry from all first-epoch
SPM plates was included in the construction of the UCAC3 catalog, further
discussion of the PMM data analysis can be found in Zacharias et al. (2010).
The USNO-derived centers and image parameters for all detections on the SPM
plates, both first and second-epoch plates, were then provided to the Yale SPM
team for subsequent reduction.

The SPM CCD frames are corrected for bias, dark (in the case of the Apogee
frames, dark current is neglible in the PV), and flatfielding.  SExtractor
is used to identify detections, give aperture photometry, and provide
preliminary x,y centers.  Final x,y centers are derived by fitting
two-dimensional elliptical Gaussian functions to the image intensities.
See Casetti-Dinescu et al. (2007) for further details of the astrometric
reduction procedures used with the PixelVision camera data.

In general, similar techniques to those used in constructing previous
versions of SPM catalogs were used to build the SPM4.  (See Girard et al.
1998, Platais et al. 1998, Girard et al. 2004.)  Stars for which both
the central-order exposure and first-order grating-image pair were
measurable were used to derive and correct each plate's magnitude equation
individually.  Following the procedures developed for the SPM1 and SPM2
catalogs, all extended sources were given magnitude corrections corresponding
to their measured magnitude shifted by -0.7.

In the case of the CCD image centers, there were systematic offsets
detected between the position of the central image and the mean of the
positions of the grating-order pairs.  However, these did not follow the
behavior expected for magnitude equation (or charge transfer efficiency
effects).  Therefore, this offset was corrected as such, a simple offset
between the image order systems, instead of as a magnitude equation.
(See Casetti-Dinescu et al. 2007.)

Measures from all exposures and all grating-image systems were transformed
to a single system for each plate and for each CCD frame.  The CCD x,y
positions were then corrected for a fixed-pattern geometric distortion
believed to be linked to the filter.  This correction "mask" was built up
from residuals of hundreds of frames at different pointings reduced into
UCAC2 coordinates.  The corrected CCD x,y positions were then transformed
onto the system of the UCAC2 to facilitate pasting together the roughly 50
to 100 frames (depending on whether it had two-fold or single coverage) that
comprise a 6 deg x 6 deg SPM field.  An overlap method is employed to
perform this task, using Tycho2 stars as an external reference system to
ensure that systematics from the individual overlap solutions do not
accumulate.  In this manner, an artificial "pseudo-plate" is built up from
CCD frames.  This pseudo-plate can then be treated the same as a real
second-epoch plate.

In previous versions of SPM catalogs, first- and second-epoch plate pairs
were combined to yield relative proper motions per plate pair.  These
were then corrected to absolute proper motions using external galaxies in
the case of SPM1 and SPM2, or Hipparcos star proper motions in the case of
SPM3.  For the SPM4, instead of combining plate pairs, we have decided to
construct the best possible position catalogs at first and at second epoch,
over the entire coverage area.  This is accomplished by dividing the
plates into three groups; first-epoch plates, second-epoch plates, and
second-epoch pseudo-plates, then combining plate data within each group using
a plate-overlap strategy as follows.

Within each of these plate groups, all plates are pushed through the software
pipeline that performs the preliminary reductions described above.  This
pipeline combines multiple images of the same star (short/long exposure and
diffraction orders), corrects the positions for magnitude equation, and then
models these x,y positions into RA,Dec from a subset of the Tycho2 catalog
adjusted to the epoch of the plate.  (The subset is roughly half the Tycho2
stars, those of better quality.)  The plate model consists of classical
5th-order distortion terms plus a general 3rd-order polynomial.  Uncertainties
as a function of magnitude are derived from the scatter of stars with multiple
images measured on that plate.

With each plate having been reduced into RA,Dec on the system of Tycho2,
we then make use of the overlapping areas to make further adjustments of
each plate.  This is done in an iterative approach as opposed to a
simultaneous global solution.  The procedure we're using is to

1) create an "internal+external" reference catalog by doing a weighted
   average of mutiply-measured stars' RA,Dec and supplementing this with
   Hipparcos and Tycho2 positions/proper-motions,
2) model each plate into this ref catalog with a general 3rd-order model
   plus classical 5th-order distortion, correcting the plate's RA,Decs at
   the end of the iteration,
3) examine the differences in positions, obtained before and after this
   iteration.  If it's still subtstantial, go back to step 1/.

The presence of the Hipparcos/Tycho2 stars in the reference catalog prevents
errors from the overlap solutions from accumulating and causing a reference
system drift.  The number of iterations required for convergence was from
5 to 9 for the three plate groups.

When all is done, i.e., after sufficient convergence of the iterative
solutions, the weighted-average positions for every object on every plate
are derived and adopted as the celestial coordinates of that object, at the
weighted mean epoch for that particular star.

This procedure was applied to the first-epoch plates, the second-epoch plates,
and the second-epoch pseudo-plates that had been pasted together from the
PV CCD frame data.  For this last group, a second "pasting" of the CCDs
was performed using preliminary proper motions derived from a first
iteration to update all CCD data within a single pseudo-plate to the same
epoch.  Also, for the pseudo-plate regions it was realized that there were
some "holes" in the sky coverage from several causes.  In areas with
single-fold sky coverage, inaccurate telescope pointing led to occasional
gaps between adjacent PV frames.  Additionally, some frames that had passed
a quality check at the telescope were later found to have problems that
rendered them unusable.  Finally, there were a handful of SPM fields for
which the second-epoch plates were also unusable and pseudo-plates created
from an incomplete number of CCD frames in these fields were constructed in
their place.  In order to avoid having holes or cracks in the SPM4 sky
coverage for want of second-epoch positions in these cases, it was decided to
supplement the pseudo-plate fields with second-epoch positions taken from
the master input catalog.  The additional stars and galaxies added were those
with input catalog V estimates less than 17.5 in most areas, but a cutoff of
V=16.5 was used in two galactic plane fields.  Of course, in order to appear
in the final SPM4 catalog, a corresponding detection and measure of the
object in the first-epoch plate material must exist.  Objects with proper
motions derived in this manner can be identified in the catalog, their values
of np and nc, the number of second-epoch plate and CCD measures per object,
will both be zero.

When completed, first-epoch positions and second-epoch positions on the
system of the ICRS were in hand for all detected objects in the 660 fields.
Uncertainties in the positions were derived from the (weighted) scatter of
multiply measured stars as a function of magnitude and this empirical relation
calculated for each object according to its magnitude estimate.

The positions and uncertainties were then combined to yield proper motions
and proper-motion uncertainties in a straightforward manner.  While in
theory these proper motions should be on the system of the ICRS via Hipparcos
and Tycho2, and thus absolute, in practice an additional correction is
needed.  Examining the measured proper motions of galaxies within each
field as well as the differences with Hipparcos proper motions at the bright
end, it was apparent that a residual magnitude equation remained in the
derived proper motions.  It was decided to calculate a final correction to
absolute proper motion per field that was linear with magnitude, using the
mean magnitude of galaxies and of Hipparcos stars on the field.  Such a
linear correction was derived for all 660 fields.  The actual proper-motion
correction applied to each star in the catalog was the weighted mean of the
corrections for the three closest field centers to the star, weighted by the
inverse distance from the field center squared.

We note that the quoted uncertainties, particularly those of the proper
motions, are unexpectedly (and possibly unrealistically) low.  This may
be due to the use of weightings that are themselves uncertain enough that
a single measurement dominates the calculated mean, more so than it should.
The uncertainties will be studied further and presented in an upcoming
paper (Girard et al. 2010).  In the meantime, the proper-motion
uncertainties should be used with caution.

Photometric Reductions
''''''''''''''''''''''

The B,V photometry in the SPM4 is extremely heterogeneous.  In some cases,
it is derived from our blue and visual filtered CCD cameras.  In some cases,
it is derived from the PMM measures of our first-epoch plates.  And in the
cases where neither of these are available or reliable, it is propogated
from the input master catalog.  In this latter group one can find relatively
good photometry from Tycho2 or less reliable extrapolations to B and V
magnitudes from 2MASS J,H,K.  As such, it is difficult to estimate
uncertainties for much of the B,V photometry listed.  Our magnitude errors
are as likely to be caused by spurious radius measures or inapproriate
extrapolations as they are by signal to noise considerations.  Thus, we
do not provide individual uncertainty estimates for the B,V photometry
listed.  We do, however, indicate the source of the B and V values given,
be they CCD-based, plate-based, or input catalog values.

For the purpose of identifying which image orders should be searched for
within the list of detections on a plate or CCD, a magnitude estimate of
each star in the input master catalog is needed.  For Hipparcos and Tycho2
stars, the B_Tycho and V_Tycho values (transformed to the Johnson system)
were adopted.  For almost all other stars, B and V photometry was not
available so an approximate extrapolation was derived based on 2MASS J,H,K.
Hipparcos and Tycho2 stars, which have both B,V and 2MASS photometry, were
used to calibrate each SPM field with a relation of the form

::

	B-J = b0 + b1*(J-H) + b2*(H-K) + b3*J*(J-H) + b4*J*(H-K)

with a similar function for V-J.  These were used to provide an approximate
estimate of B and V for stars without Tycho2 photometry.  For the small
fraction of objects without Tycho2 or 2MASS photometry, the objects were
assumed to be faint and arbitrarily assigned the magnitude limit of the
plate or CCD on which it was expected to fall.  Again, these input master
catalog B,V magnitude estimates were primarily to aid in identifying the
various image orders detected.  Only in the case that there was neither SPM
plate-based photometry nor SPM CCD-based photmetry did these estimates find
their way to the final catalog.

The PV and Apogee CCD frames of the second-epoch SPM survey were reduced in
a standard fashion using aperture photometry with calibration into Tycho2
V and B photometry (corrected to the Johnson system).  When available, these
CCD-based magnitudes are provided in the SPM4 catalog, superseding the other
magnitude estimates.

Photographic photometry based on the parameters of the image model fits of
the PMM scan data proved to be problematic.  Among the various image model
fit parameters derived, the fit radius provided the best (although still
poor) correlation with external calibrating photometry.  For extended sources,
the radius was, of course, inappropriate.  For such objects the input master
catalog's magnitude estimate was retained instead, (unless there existed
CCD-based photometry).  Also, there was a large, non-gaussian scatter between
the radius measures and calibrating photometry, indicating that at times the
radius estimate was simply erroneous.  Thus, during the SPM4 plate photometric
reduction procedure, a comparison was made between the preliminarily derived
(radius-based) magnitude and that from the input master catalog.  If these
differed by more than one magnitude, it was interpreted as evidence that one
or the either was in error.  Since we could not know which, a somewhat
expedient choice was made: the fainter of the two magnitude values was
retained, under the assumption that the steepness of the luminosity function
implies that it is more likely that the star is faint.  Unfortunately, the
only relevant flag that was retained per star was whether or not it had
passed through the plate photometry portion of the pipeline, not whether the
resulting magnitude estimate was truly plate-based or a retention of the input
master catalog value.  The photographic photometry was disappointingly poor
in any event.  Thus, the only truly reliable B,V photometry in the SPM4
catalog is that flagged as being CCD-based, i.e., with ib=3 and/or iv=3.

Acknowledgements
================

The Southern Proper Motion program is a decades-long endeavor involving the
participation of numerous institutions and countless people.  The following
is a meager attempt at listing those "countless" many who have contributed
to the success of the SPM program, culminating with the release of the SPM4
catalog.

* Bill van Altena (Yale)
* Terry Girard (Yale)
* Norbert Zacharias (USNO)
* Carlos Lopez (Univ. de San Juan, Argentina)
* Dana Casetti-Dinescu (Yale)
* Kathy Vieira (Yale/CIDA)
* Dave Monet (NOFS)
* Danillo Castillo (ALMA)
* David Herrera (NOAO)
* Imants Platais (Johns Hopkins)
* Vera Kozhurina-Platais (STScI)
* Tim Beers (Michigan State Univ.)
* Young Sun Lee (Michigan State Univ.)
* Reed Meyer (TripAdvisor LLC, Boston)
* Arnold Klemola (Lick Obs.)
* Rene Mendez (Univ. de Chile)
* Xinjian Guo (Yale)
* Paulo Holvorcem (Univ. Estadual de Campinas, Brazil)
* John T. Lee (Interactive Data, Boxborough, Mass.)
* Zhenghong Tang (Shanghai Astronomical Obs.)
* Valdimir Korchagin (Rostov Univ., Russia)
* Ting-Gao Yang (Chinese Academy of Sciences, Time Service Center)
* Wen-Zhang Ma (Beijing Normal Univ.)
* Gary Wycoff (USNO)
* Charlie Finch (USNO)
* Jin-Fuw Lee (IBM, deceased)

The authors are grateful to the National Science Foundation for their
substantial support in the form of a series of grants spanning more than two
decades, the University of San Juan for extensive logistical and personnel
support throughout the course of the survey, the Argentine CONICET for funding
of some of the instrumentation, and Yale University for critical financial
support during the completion of the SPM program.  Also, the program would not
have begun were it not for an initial grant from the Ford Foundation, which we
also gratefully acknowledge.  Finally, we are indebted to our observers who
provided the raw material upon which this catalog is based.
]]>
	</meta>
	<meta name="copyright" format="rst">
		This data essentially is a mirror of
		http://www.astro.yale.edu/astrom/spm4cat/spm4.html.  If you use it, please
		reference 2011AJ....142...15G.
	</meta>
	<meta name="source">2011AJ....142...15G</meta>
	<meta name="creator">Girard, T. M.; van Altena, W. F.; Zacharias, N.;
		Vieira, K.; Casetti-Dinescu, D. I.; Castillo, D.; Herrera, D.; Lee, Y. S.;
		Beers, T. C.; Monet, D. G.; López, C. E.
	</meta>


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

	<table id="main" onDisk="True" adql="True" mixin="//scs#q3cindex">
		<index columns="spmid"/>
		<index columns="magV"/>
		<stc>
			TimeInterval TT 1965-01-01 2008-12-31
			Position ICRS
				"raj2000" "dej2000" Error "e_raj2000" "e_dej2000"
				Velocity "pmra" "pmde" Error "e_pmra" "e_pmde"
		</stc>

		<column name="spmid" type="text"
			ucd="meta.id;meta.main"
			tablehead="Id"
			description="Unique SPM4 id (field number + input catalog line number)"
			verbLevel="1"/>
		<column name="raj2000" type="double precision"
			unit="deg" ucd="pos.eq.ra;meta.main"
			tablehead="RA"
			description="Right Ascension (ICRS, epoch=2000.0)"
			verbLevel="1"/>
		<column name="dej2000" type="double precision"
			unit="deg" ucd="pos.eq.dec;meta.main"
			tablehead="Dec"
			description="Declination (ICRS, epoch=2000.0)"
			verbLevel="1"/>
		<column name="e_raj2000"
			unit="deg" ucd="stat.error;pos.eq.ra;meta.main"
			tablehead="Err. RA"
			description="Expected uncertainty in Right Ascension at
				mean epoch"
			verbLevel="15"/>
		<column name="e_dej2000"
			unit="deg" ucd="stat.error;pos.eq.dec;meta.main"
			tablehead="Err. Dec"
			description="Expected uncertainty in Declination at mean epoch"
			verbLevel="15"/>
		<column name="pmra"
			unit="deg/yr" ucd="pos.pm;pos.eq.ra"
			tablehead="PM(RA)"
			description="Absolute proper motion in RA (mu_alpha*cos(Dec))"
			verbLevel="9"/>
		<column name="pmde"
			unit="deg/yr" ucd="pos.pm;pos.eq.dec"
			tablehead="PM(Dec)"
			description="Absolute proper motion in Declination"
			verbLevel="9"/>
		<column name="e_pmra"
			unit="deg/yr" ucd="stat.error;pos.pm;pos.eq.ra"
			tablehead="Err. PM(RA)"
			description="Expected uncertainty in proper motion in RA
				(mu_alpha*cos(Dec)), at mean epoch"
			verbLevel="15"/>
		<column name="e_pmde"
			unit="deg/yr" ucd="stat.error;pos.pm;pos.eq.dec"
			tablehead="Err. PM(Dec)"
			description="Expected uncertainty in proper motion in Declination,
				at mean epoch."
			verbLevel="15"/>
		<column name="magB"
			unit="mag" ucd="phot.mag;em.opt.B"
			tablehead="B"
			description="B magnitude"
			note="m"
			verbLevel="15"/>
		<column name="magV"
			unit="mag" ucd="phot.mag;em.opt.V"
			tablehead="V"
			description="V magnitude"
			note="m"
			verbLevel="15">
			<values min="0.0" max="30.0"/>
		</column>
		<column name="i_magB" type="char" required="True"
			ucd="meta.code;phot.mag;em.opt.B"
			tablehead="src. B"
			description="source flag for B magnitude"
			verbLevel="25"/>
		<column name="i_magV" type="char" required="True"
			ucd="meta.code;phot.mag;em.opt.V"
			tablehead="src. V"
			description="source flag for V magnitude"
			verbLevel="25"/>
		<column name="meanep"
			unit="yr" ucd="time.epoch"
			tablehead="Mean Ep."
			description="Weighted mean epoch"
			verbLevel="15"/>
		<column name="ep1"
			unit="yr" ucd="time.epoch"
			tablehead="1st Ep."
			description="Weighted mean epoch of first observation"
			verbLevel="25"/>
		<column name="ep2"
			unit="yr" ucd="time.epoch"
			tablehead="2nd Ep."
			description="Weighted mean epoch of second observation"
			verbLevel="25"/>
		<column name="nplates1" type="smallint" required="True"
			ucd="meta.number;instr.plate"
			tablehead="N(Plates1)"
			description="Number of 1st epoch plates used"
			verbLevel="29"/>
		<column name="nplates2" type="smallint" required="True"
			ucd="meta.number;instr.plate"
			tablehead="N(Plates2)"
			description="Number of 2nd epoch plates used"
			verbLevel="29"/>
		<column name="nccd2" type="smallint" required="True"
			ucd="meta.number"
			tablehead="N(CCD2)"
			description="Number of 2nd epoch ccd frames used"
			note="c"
			verbLevel="29"/>
		<column name="i_gal" type="smallint" required="True"
			ucd="src.class.starGalaxy"
			tablehead="S/G?"
			description="Galaxy/extended-source flag"
			note="g"
			verbLevel="25"/>
		<column name="i_cat" type="smallint" required="True"
			ucd="meta.code"
			tablehead="From"
			description="Code for the input catalog"
			note="s"
			verbLevel="25"/>
		<column name="magJ"
			unit="mag" ucd="phot.mag;em.IR.J"
			tablehead="m_J"
			description="J selected default magnitude from 2MASS"
			verbLevel="15"/>
		<column name="magH"
			unit="mag" ucd="phot.mag;em.IR.H"
			tablehead="m_H"
			description="H selected default magnitude from 2MASS"
			verbLevel="15"/>
		<column name="magK"
			unit="mag" ucd="phot.mag;em.IR.K"
			tablehead="m_K_s"
			description="K_s selected default magnitude from 2MASS"
			verbLevel="15"/>
		
		<meta name="note" tag="m">
			These flags indicate the source of the magnitude given:

			=== ======================================================
			 1  magnitude came from the compiled input catalog
			 2  magnitude was based on 1st-epoch SPM plates
			 3  magnitude was based on 2nd-epoch SPM CCD observations
			=== ======================================================
		</meta>

		<meta name="note" tag="c">
			If the number of CCD frames used in the second epoch is larger
			than 9, this column still contains 9.
			Note that if both the number of plates and the number of CCDs
			for second epoch are zero, the 2nd-epoch position used to calculate
			the proper motion was adopted from the input source catalog.
		</meta>

		<meta name="note" tag="g">
		=== =======================================================
		 0  no indication the object is non-stellar.
		 1  the object is a 2MASS extended source.
		 2  the object is a LEDA confirmed galaxy.
		 3  the object is from the Veron-Cetty &amp; Veron QSO catalog.
		=== =======================================================
		</meta>

		<meta name="note" tag="s">
			The catalog the input object was taken from is encoded as follows
			(for objects in multiple catalogs, the first (lowest number)
			catalog identification is retained):

			== ==========================================
			1  Hipparcos.
			2  Tycho-2.
			3  UCAC2.
			4  the 2MASS point source catalog (psc).
			5  the 2MASS extended source catalog (xsc).
			6  the LEDA galaxy catalog.
			7  the Veron-Cetty &amp; Veron QSO catalog.
			== ==========================================
		</meta>
	</table>

	<coverage>
		<updater spaceTable="main" mocOrder="4"/>
		<temporal>2000-01-01 2000-01-01</temporal>
		<spatial>1/32-34,36-38,40-42,44-46 2/64,80,96,112,140,156,172,188 3/260,264,324,328,388,392,452,456,564,568,628,632,692,696,756,760 4/1044-1046,1048-1050,1060-1062,1064-1066,1300-1302,1304-1306,1316-1318,1320-1322,1556-1558,1560-1562,1572-1574,1576-1578,1812-1814,1816-1818,1828-1830,1832-1834,2260-2262,2264-2266,2276-2278,2280-2282,2516-2518,2520-2522,2532-2534,2536-2538,2772-2774,2776-2778,2788-2790,2792-2794,3028-3030,3032-3034,3044-3046,3048-3050</spatial>
	</coverage>

	<data id="import">
<!-- (fallback; replaced by a directGrammar <columnGrammar preFilter="bzcat">
			<colDefs>
				raj2000: 001-012
				dej2000: 013-024
				e_raj2000: 025-030
				e_dej2000: 031-036
				pmra: 037-045
				pmde: 046-054
				e_pmra: 055-061
				e_pmde: 062-068
				magB: 069-074
				magV: 075-080
				i_magB: 081-081
				i_magV: 082-082
				meanep: 084-089
				ep1: 090-095
				ep2: 096-101
				nplates1: 102-104
				nplates2: 105-106
				nccd2: 107-108
				spmid: 109-119
				i_gal: 120-121
				i_cat: 122-122
				magJ: 123-129
				magH: 130-136
				magK: 137-143
			</colDefs>
		</columnGrammar> -->

		<sources pattern="data/*.asc.bz2"/>
		<directGrammar preFilter="bzcat" cBooster="res/booster.c"/>

		<make table="main">
			<rowmaker idmaps="*">
				<LOOP listItems="e_raj2000 e_dej2000 pmra pmde e_pmra e_pmde">
					<events>
						<map key="\item">float(@\item)*DEG_MAS</map>
					</events>
				</LOOP>

				<LOOP listItems="meanep ep1 ep2">
					<events>
						<map key="\item">float(@\item)+1950</map>
					</events>
				</LOOP>
			</rowmaker>
		</make>
	</data>

	<service id="cone" allowed="scs.xml,form">
		<meta name="shortName">SPM4 CS</meta>
		<meta name="_intro" format="rst">
		For advanced queries on this catalogue use ADQL_ possibly via TAP_ .

		.. _ADQL: /adql
		.. _TAP: /tap
		</meta>

		<publish render="form" sets="local,ivo_managed"/>
		<publish render="scs.xml" sets="ivo_managed"/>

  	<meta name="testQuery.ra">10</meta>
  	<meta name="testQuery.dec">-30</meta>
  	<meta name="testQuery.sr">0.01</meta>

		<scsCore queriedTable="main">
			<FEED source="//scs#coreDescs"/>
			<condDesc buildFrom="magV"/>
			<condDesc>
				<inputKey original="i_gal">
					<values>
						<LOOP>
							<csvItems>
								label, item
								no indication the object is non-stellar, 0
								2MASS extended source, 1
								LEDA confirmed galaxy, 2
								from Veron-Cetty &amp; Veron QSO catalog, 3
							</csvItems>
							<events>
								<option title="\label">\item</option>
							</events>
						</LOOP>
					</values>
				</inputKey>
			</condDesc>
			<condDesc buildFrom="spmid"/>
		</scsCore>
	</service>
</resource>
