From d9cd2b5bd6183f4b0e51a49d6c272f497cbf33b5 Mon Sep 17 00:00:00 2001 From: Philippe Hamy Date: Wed, 18 Nov 2020 17:08:56 +0100 Subject: [PATCH] modifie q.rd de planets --- services/planets/q.rd | 99 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 94 insertions(+), 5 deletions(-) diff --git a/services/planets/q.rd b/services/planets/q.rd index bf3674c..3c8d4b7 100644 --- a/services/planets/q.rd +++ b/services/planets/q.rd @@ -1,5 +1,7 @@ Characteristics of Planets (demo) + Planets + Planets Demonstration service of EPN-TAP v1: main characteristics of planets. Data are included in the table, therefore most relevant parameters are non-standard in EPN-TAP. Data are retrieved from Archinal et al 2009 (IAU report, 2011CeMDA.109..101A) [radii] and Cox et al 2000 (Allen's astrophysical quantities, 2000asqu.book.....C) [masses, heliocentric distances, and rotation periods]. 2015-08-16T09:42:00Z @@ -126,7 +128,7 @@ Demonstration service of EPN-TAP v1: main characteristics of planets. Data are i "ci" - "celestial" + "none" @@ -145,8 +147,14 @@ Demonstration service of EPN-TAP v1: main characteristics of planets. Data are i "planets" "2011CeMDA.109..101A#2000asqu.book.....C" "LESIA" - "planet" + "planet" + + @target_class+"/"+@target_name + ("\getConfig{web}{serverURL}/\rdId/epdl/dlmeta" + +"?ID="+urllib.parse.quote(@ds_id)) @granule_gid @@ -154,12 +162,18 @@ Demonstration service of EPN-TAP v1: main characteristics of planets. Data are i @obs_id @target_class "UTC" + @target_name "" "" + + 5 + @dataproduct_type "phys.mass#phys.size.radius" + + @service_title @creation_date @modification_date @@ -171,8 +185,83 @@ Demonstration service of EPN-TAP v1: main characteristics of planets. Data are i - - - + + + + + yield MS(InputKey, name="epoch", + type="double precision", + unit="d", ucd="meta.epoch", + description="Time the ephemeris is to be computed for, JD", + multiplicity="forced-single", + values=MS(Values, + min=2400000, + max=3000000)) + + + + + + with base.getTableConn() as conn: + url = list(conn.query("SELECT thumbnail_url from \schema.epn_core where" + " target_class=%(targetClass)s and target_name=%(targetName)s", { + "targetClass": descriptor.targetClass, + "targetName": descriptor.targetName}))[0][0] + yield LinkDef(descriptor.pubDID, + url, + description="A preview of the planet", + semantics="#preview", + contentType="image/jpeg") + + + + + + + class PlanetDescriptor(object): + def __init__(self, pubDID): + self.pubDID = pubDID + self.targetClass, self.targetName = self.pubDID.split("/", 1) + self.computeEphemerisId() + + def computeEphemerisId(self): + shortClass = { + 'planet': 'p', + 'satellite': 's', + }[self.targetClass] + self.ephId = "{}:{}".format( + shortClass, self.targetName) + description="computed ephemeris of the planet", + + + + return PlanetDescriptor(pubDID) + + + + + + "http://vo.imcce.fr/webservices/miriade/ephemcc_query.php?-from=vespa&" + + + from urllib.parse import urlencode + from gavo.svcs import WebRedirect + import urllib.parse + + + + parameters = { + "-name": descriptor.ephId, + "-ep": args["epoch"], + } + raise WebRedirect(upstream_service_url+urlencode(parameters)) + + + + + + + -- libgit2 0.21.2