2017-02-08T11:00:00
Definitions dealing with the EPN-TAP2 table
schema used to describe solar system observations.
solar-system-astronomy
Generates a pair of minimum/maximum column pairs. You must
fill out basename, baseucd, basedescr, unit.
11
Generates a pair of minimum/maximum column pairs. You must
fill out basename, baseucd, basedescr, unit.
11
1common1common1common1common1common1common1common1common1common1common1common1common1common1common1common1common1common1common1common1common1common1common1common1common1common1common1common1common1common1common1common1common1common1common1common1common1common1common1common1common1common1common1common1common1common1common1common1common1common1common1common1common1common1common1common1common1common1common1solar system objects1solar system objects1solar system objects1solar system objects1solar system objects1solar system objects1solar system objects1solar system objects1solar system objects1maps1maps1maps1maps1maps1maps1contributive works1contributive works1contributive works1contributive works1contributive works1contributive works1contributive works1contributive works1contributive works1contributive works1contributive works1common1common1common1particle spectroscopy1particle spectroscopy1particle spectroscopy1particle spectroscopy1particle spectroscopy1particle spectroscopy1particle spectroscopy1experimental spectroscopy1experimental spectroscopy1experimental spectroscopy1experimental spectroscopy1experimental spectroscopy1experimental spectroscopy1experimental spectroscopy1experimental spectroscopy1experimental spectroscopy1experimental spectroscopy1experimental spectroscopy1experimental spectroscopy1experimental spectroscopy1experimental spectroscopy1experimental spectroscopy1APIS1APIS1APIS1APIS1APIS1APIS1APIS1APIS1APIS1events1events1events1orbital elements1orbital elements1orbital elements1orbital elements1orbital elements1orbital elements1orbital elements
__EMPTY__
from gavo import base
from gavo import rscdef
from gavo.protocols import sdm
META_BY_FRAME_TYPE = {
# (units, ucds, descriptions)
"celestial": (
("deg", "deg", "AU"),
("pos.eq.ra", "pos.eq.dec", "pos.distance"),
( "Right Ascension (ICRS)",
"Declination (ICRS)",
"Distance from coordinate origin")),
"body": (
("deg", "deg", "km"),
("pos.bodyrc.lon", "pos.bodyrc.lat", "pos.bodyrc.alt"),
( "Longitude on body",
"Latitude on body",
"Altitude from reference surface")),
"cartesian": (
("km", "km", "km"),
("pos.cartesian.x", "pos.cartesian.y", "pos.cartesian.z"),
( "Cartesian coordinate in x direction",
"Cartesian coordinate in y direction",
"Cartesian coordinate in z direction")),
"spherical": (
("m", "deg", "deg"),
("pos.distance", "pos.az.zd", "pos.az.azi"),
( "Radial distance in spherical coordinates",
"Polar angle or colatitude in spherical coordinates",
"Azimuth in spherical coordinates")),
"cylindrical": (
("km", "deg", "km"),
("pos.distance", "pos.az.azi", "pos.distance"),
( "Radial distance in cylindrical coordinates",
"Azimuth in cylindrical coordinates",
"Height in cylindrical coordinates")),
"none": (
("", "", ""),
("", "", ""),
("", "", "")),
}
# maps coordinate UCDs to resolution UCDs as per table note 2
RESOLUTION_UCD = {
"pos": "pos.resolution",
"pos.az.ai": "pos.angResolution",
"pos.distance": "pos.resolution",
"pos.az.zd": "pos.angResolution",
"pos.az.azi": "pos.angResolution",
"pos.eq.ra": "pos.angResolution",
"pos.eq.dec": "pos.angResolution",
"pos.bodyrc.lon": "pos.angResolution",
"pos.bodyrc.lat": "pos.angResolution",
"pos.bodyrc.alt": "pos.resolution",
"pos.cartesian.x": "pos.resolution",
"pos.cartesian.y": "pos.resolution",
"pos.cartesian.z": "pos.resolution",
}
def setFrameMeta(tableDef, spatialFrameType):
if spatialFrameType not in META_BY_FRAME_TYPE:
raise base.StructureError("Unknown EPN-TAP frame type: %s."%
spatialFrameType,
hint="Known frame types are: %s"%(
", ".join(META_BY_FRAME_TYPE)))
units, ucds, descriptions = META_BY_FRAME_TYPE[spatialFrameType]
for cooIndex in range(3):
prefix = "c%d"%(cooIndex+1)
for postfix in ["min", "max",
"_resol_min", "_resol_max"]:
col = tableDef.getColumnByName(prefix+postfix)
if units[cooIndex]:
col.unit = col.unit.replace(
"__replace_framed__", units[cooIndex])
else:
col.unit = ""
if ucds[cooIndex]:
col.ucd = col.ucd.replace(
"__replace_framed__", ucds[cooIndex])
col.ucd = col.ucd.replace(
"__replace_resolution_ucd__",
RESOLUTION_UCD[ucds[cooIndex]])
else:
col.ucd = ""
if descriptions[cooIndex]:
col.description = col.description.replace(
"__replace_framed__", descriptions[cooIndex])
else:
col.description = ("(This data collection does not give"
" coordinates)")
def addOptionalColumns(tableDef, columnNames):
sourceTable = base.resolveCrossId("//epntap2#optional_columns")
for columnName in columnNames.split():
tableDef.columns.append(
sourceTable.getColumnByName(columnName))
setFrameMeta(substrate, mixinPars["spatial_frame_type"])
substrate.setProperty("spatial_frame_type",
mixinPars["spatial_frame_type"])
if mixinPars["optional_columns"]:
addOptionalColumns(substrate, mixinPars["optional_columns"])
TrueTrue
ivo://ivoa.net/std/epntap#table-2.0
EPN-TAP
(votable:Coords) {
time: {
frame: {
timescale: @time_scale | UTC
refPosition: @time_refposition | TOPOCENTER
time0: 0
}
location: @time_min
}
}
(votable:Coords) {
time: {
frame: {
timescale: @time_scale | UTC
refPosition: @time_refposition | TOPOCENTER
time0: 0
}
location: @time_max
}
}
1111111111111111
The following values are defined for this field:
im -- image
associated scalar fields with two spatial axes, e.g., images with
multiple color planes like from multichannel or filter cameras.
Preview images (e.g. map with axis and caption) also belong here.
Conversely, all vectorial 2D fields are described as catalogue
(see below).
ma -- map
scalar field/rasters with two spatial axes covering a large
area and projected either on the sky or on a planetary body,
associated to a Projection parameter (with a short enumerated
list of possible values). This is mostly intended to identify
complete coverages that can be used as reference basemaps.
sp-- spectrum
measurements organized primarily along a spectral axis, e.g.,
radiance spectra. This includes spectral aggregates (series
of related spectra with non-connected spectral ranges, e.g.,
from several channels of the same instrument
ds -- dynamic spectrum
consecutive spectral measurements through time, organized
as a time series. This typically implies successive spectra of
the same target or field of view.
sc -- spectral cube
sets of spectral measurements with 1 or 2 D spatial coverage, e.g.,
imaging spectroscopy. The choice between Image and spectral_cube is
related to the characteristics of the instrument (which dimension
is most resolved and which dimensions are acquired simultaneously).
The choice between dynamic_spectrum and spectral_cube is related
to the uniformity of the field of view.
pr -- profile
scalar or vectorial measurements along 1 spatial dimension, e.g.,
atmospheric profiles, atmospheric paths, sub-surface profiles,
traverses…
pf -- photometric profile
scalar or vectorial measurements along 1 angular dimension, e.g.,
phase or polarization curves, phase functions, emission-phase
function sequences… typically associated to variations in
illumination angle parameters.
vo -- volume
other measurements with 3 spatial dimensions, e.g., internal or
atmospheric structures, including shells/shape models (3D surfaces).
mo -- movie
sets of chronological 2 D spatial measurements.
cu -- cube
multidimensional data with 3 or more axes, e.g., all that is not
described by other 3 D data types such as spectral cubes or volume.
This is mostly intended to accommodate unusual data with multiple
dimensions.
ts -- time series
measurements organized primarily as a function of time (with
exception of dynamical spectra and movies, i.e. usually a scalar
quantity). Typical examples of time series include space-borne
dust detector measurements, daily or seasonal curves measured at
a given location (e.g., a lander), and light curves.
ca -- catalog
applies to a single granule providing a list of events, a catalog
of object parameters, a list of features… It is good practice to
describe the type of data included in the catalogue using a
hash-separated-list (e.g., a table of spectra should be described
by ca#sp, so that it will respond to a query for spectra).
ci -- catalogue item
applies when the service itself provides a catalogue, with entries
described as individual granules. The service can be, e.g., a list
of asteroid properties or spectral lines. Catalogue_item can be
limited to scalar quantities (including strings), and possibly to
a single element. This organization allows the user to search inside
the catalogue from the TAP query interface.
sv -- spatial vector
vector information associated to localization, such as spatial
footprints or a GIS-related element. This could contain a kml
or geojson file (STC-S strings are provided though the s_region
parameter, though). This includes maps of vectors, e.g., wind maps.
ev -- event
individual events, typically formatted in VOEvent. Characteristics
are provided via the event_* parameters.
CODMAC levels are:
1 -- raw
2 -- edited
3 -- calibrated
4 -- resampled
5 -- derived
6 -- ancillary
Use this mixin if your epntap table is filled with local products
(i.e., sources matches files on your hard disk that DaCHS should
hand out itself). This will arrange for your products to be
entered into the products table, and it will automatically
compute file size, etc.
This wants a `//products#define`_ rowfilter in your grammar
and a `//epntap2#populate-localfile-2_0`_ apply in your rowmaker.
\rowsMade"UTC""TOPOCENTER"NoneNone"UNKNOWN"NoneNone
# overridden is a set of column names for which the parameters
# are manually defined above or which are set in some other way.
overridden = set(["index_",
"target_name", "time_scale", "time_refposition",
"instrument_host_name", "instrument_name",
"target_region", "target_class",
"spatial_frame_type", "s_region", "processing_level"])
mixin = context.getById("table-2_0")
colDict = {}
for type, name, content, pos in mixin.events.events_:
if type=="value":
colDict[name] = content
elif type=="end":
if name=="column":
if colDict.get("name") not in overridden:
if colDict.get("required", False):
colDict["default"] = ''
else:
colDict["default"] = 'None'
yield colDict
colDict = {}
\default
# find myself to get the list of my parameters
for app in parent.apps:
if app.procDef and app.procDef.id=='populate-2_0':
break
else:
raise base.Error("Internal: epntap#populate-2_0 cannot find itself")
EPNTAP_KEYS = [p.key for p in app.procDef.setups[0].pars]
del app
l = locals()
for key in EPNTAP_KEYS:
vars[key] = l[key]
vars["spatial_frame_type"] = targetTable.tableDef.getProperty(
"spatial_frame_type", None)
"\schema.epn_core"
(and more if what you have isn't FITS files). If you have that, this
will work without further configuration.
]]>\sourceCDate
# map things from products#define
vars["access_estsize"] = vars["prodtblFsize"]/1024
vars["access_url"] = makeProductLink(vars["prodtblAccref"])
if @prodtblPreview:
vars["thumbnail"] = @prodtblPreview
vars["accref"] = vars["prodtblAccref"]
vars["creation_date"] = creation_date