return {"fieldKey": os.path.basename(sourceToken).split("_")[0],
"fieldBandKey": os.path.basename(sourceToken).split(".")[0]}
for c in nullableColumns:
if vars[c]=='-99.0000' or vars[c]=='99.0000':
vars[c] = None
_linksByExt = {
"truecol.jpg": {
"contentType": "image/jpeg", "semantics": "#preview-image",
"description": "Color preview"},
"obj.jpg": {
"contentType": "image/jpeg", "semantics": "#preview-image",
"description": "Preview of the object mask"},
"reg.gz": {
"contentType": "application/octet-stream",
"description": "DS9 masks for unusable regions",
"semantics": "#auxiliary"},
"asc.gz": {
"contentType": "text/plain", "semantics": "#source-list",
"description": "Extracted sources."},
}
root = "cars/q/dl/static/"
stem = descriptor.accref.split("/")[-1][:-15]
dir = descriptor.accref.split("/")[-2]
catDir = os.path.join(base.getConfig("inputsDir"),
"cars/data/catalogues", dir)
yield descriptor.makeLink(makeAbsoluteURL(root+
"images/%s/%s.swarp.cut.weight.fits.gz"%(dir, stem)),
contentType="image/fits", description="Weights",
semantics="#weight")
for fName in os.listdir(catDir):
try:
yield descriptor.makeLink(makeAbsoluteURL(root+
"catalogues/%s/%s"%(dir, fName)),
**_linksByExt[".".join(fName.split(".")[-2:])])
except KeyError:
# unknown extension, ignore
pass
yield descriptor.makeLink("http://dc.g-vo.org/tap",
description="TAP service with this data in obscore")
CARS image cutouts',
'Metadata for CARS')
]]>
/getproduct/cars/data/catalogues/W1p1p1/
W1p1p1_izrgu.V1.7A.masks.obj.jpg
self.assertHasStrings("JFIF", "22222222222222222222222")
# it would be good if we could remove the cache generated
# so we don't just test locating the preview cache. but
# that'd need some special trick as that's server side
# But just in case we're running on the box tested:
try:
os.unlink(os.path.join(base.getConfig("web", "previewCache"),
getFlatName(re.sub(".*getproduct/", "", self.url.httpURL))))
except os.error:
pass
prod/form
W1p1p1",
'title="Mask preview as JPEG"',
"/cars/data/images/W1p1p1/W1p1p1_g.V1.7A.swarp.cut.weight.fits.gz",
"Download 54.0MiB",
'onmouseover="insertPreview(this, null)"',
"W1p1p1_izrgu.V1.7A.masks.obj.jpg")
]]>
cat/scs.xml
row = self.getFirstVOTableRow()
self.assertAlmostEqual(row["magaprG"], 24.427299499512)
self.assertEqual(row["carsid"], 'W1m0p1:154')
self.assertEqual(row["SeqNr"], 154)
self.assertEqual(row["magisoR"], None)
self.assertEqual(row["magaprErrR"], None)
cat/form
self.assertHasStrings(
"$(renderTemplate('aladinScriptWindow', {'RA': 35.99848722, 'DEC': -5.993341385})))"
)
dl/dlmeta
self.assertHasStrings("#weight",
"cars/q/dl/static/"
"images/W1m0p1/W1m0p1_g.V1.7A.swarp.cut.weight.fits.gz",
"#preview-image",
"/cars/q/dl/static/"
"catalogues/W1m0p1/W1m0p1_irg.V1.7A.truecol.jpg",
'value="34.5', "-6.066", "0.76")
dl/dlget
self.assertHasStrings(
"NAXIS1 = 39",
b"\\x3d\\x40\\xb4\\xc1\\xbc\\x5b")