\now
\commonmeta
%one of survey, pointed, theory, custom, artificial)%
%one of archival, cutout, filtered, mosaic, projection, spectralExtraction, catalogExtraction%
timeseries
MAXREC=1
//products#table
//ssap#plainlocation
//ssap#simpleCoverage
application/x-votable+xml;content=datalink
Datalink
%add further custom columns if necessary here%
previews
"\\schema.raw_data"
"fullDLURL{sdl}"
%typical size of an SDM VOTable in bytes%
"application/x-votable+xml"
\\standardPreviewPath
"image/png"
%where to get the RA from%
%where to get the Dec from%
%the aperture (a constant estimate may just do it)%
//ssap#view
//obscore#publishSSAPMIXC
The \\metaString{source} light curve
for {ssa_targname} in the {ssa_bandpass} filter.
//timeseries#phot-0
# Example: three-column lines (you could use an reGrammar
# here, but we need a custom pargetter)
with open(self.sourceToken.src_name) as f:
for ln in f:
parts = ln.split()
yield {
'obs_time': float(parts[0]),
'phot': float(parts[1]),
'err_phot': float(parts[2]),}
return self.sourceToken.ssa_row
\\schema Datalink Service
descriptor = ProductDescriptor.fromAccref(
pubDID, pubDID.split("?")[-1])
with base.getTableConn() as conn:
descriptor.ssa_row = next(conn.queryToDicts(
"SELECT * FROM \\schema.data"
" WHERE ssa_pubdid=%(pubDID)s",
{"pubDID": pubDID}))
return descriptor
descriptor.data = rsc.makeData(
rd.getById("build-ts"),
forceSource=descriptor)
# sample code for how to change various pieces of metadata of
# the generated table. The tableDef you see is a copy,
# so edit with impunity.
tab = descriptor.data.getPrimaryTable()
tab.setMeta("description",
base.getMetaText(tab, "description").format(**descriptor.ssa_row))
mag_ucd = "phot.mag;em.opt.V"
if descriptor.ssa_row["ssa_bandpass"]=="Bessell R":
mag_ucd = "phot.mag;em.opt.R"
tab.tableDef.getColumnByName("phot").ucd = mag_ucd
tab.tableDef.getColumnByName("err_phot").ucd = "stat.error;"+mag_ucd
return ("application/x-votable+xml;version=1.5",
votablewrite.getAsVOTable(descriptor.data, version=(1,5)))
\\schema Web
accref, ssa_targname, t_min, t_max, ssa_bandpass,
datalink
\\schema SSAP
full
auto%delete this line if you have no previews; else delete just this.%
ssa/ssap.xml
self.assertHasStrings(
"%some characteristic string returned by the query%",
"%another characteristic string returned by the query%")
sdl/dlmeta
by_sem = self.datalinkBySemantics()
print(by_sem)
self.fail("Fill this in")
sdl/dlget
self.assertHasStrings(
"%some characteristic string in the datalink meta%")