package votable /** * lmsource.groovy * Laurent Michel - 04/2017 */ import cfa.vo.vodml.io.VodmlReader def location = { path -> VodmlReader.getResource("/${path}") } /* * Model imports */ def remote = "http://volute.g-vo.org/svn/trunk/projects/dm/vo-dml/models" def ivoaRemoteLocation = new URL("$remote/ivoa/IVOA.vo-dml.xml") def coordsys_tessel_location = new URL("$remote/tesselation/coordsys_tessel.vo-dml.xml") def coords_tessel_location = new URL("$remote/tesselation/coords_tessel.vo-dml.xml") def lmsource_location = new URL("$remote/tesselation/lmsource.vo-dml.xml") def reader = new VodmlReader() ivoaSpec = reader.read(ivoaRemoteLocation.openStream()) coordsys_tessel_spec = reader.read(coordsys_tessel_location.openStream()) coords_tessel_spec = reader.read(coords_tessel_location.openStream()) lmsources_spec = reader.read(lmsource_location.openStream()) /* * element building * The actual output is a VOTable */ dmInstance { /* * Model imports */ model(spec: ivoaSpec , vodmlURL: ivoaRemoteLocation) model(spec: coordsys_tessel_spec, vodmlURL: coordsys_tessel_location, identifier: "ivo://ivoa.org/dm/sample/CoordSysTessel/0.1") model(spec: coords_tessel_spec , vodmlURL: coords_tessel_location , identifier: "ivo://ivoa.org/dm/sample/CoordsTessel/0.1") model(spec: lmsources_spec , vodmlURL: lmsource_location , identifier: "ivo://ivoa.org/dm/sample/LMSource/0.1") /* * GLobals: Some of the values should be read in {PARAMS}, but as long as this is not featured win Jovail they are hard coded. */ globals(id: "_MyFirstGlobal") { /* * SpaceFrame of the source position */ instance(type: "coordsys_tessel:domain.spatial.SpaceFrame", id: "_coordspaceframe") { instance(type: "coordsys_tessel:domain.spatial.SpatialLocation", role: "coordsys_tessel:domain.spatial.SpaceFrame.origin" , value: "TOPOCENTER") instance(type: "coordsys_tessel:domain.spatial.StdRefFrame", role: "coordsys_tessel:domain.spatial.SpaceFrame.orientation", value: "ICRS") instance(type: "coordsys_tessel:domain.spatial.Epoch", role: "coordsys_tessel:domain.spatial.SpaceFrame.equinox" , value: "2015") } /* * SpaceFrame of the healpix indexation */ instance(type: "coordsys_tessel:domain.spatial.SpaceFrame", id: "_healpixspaceframe") { instance(type: "coordsys_tessel:domain.spatial.SpatialLocation", role: "coordsys_tessel:domain.spatial.SpaceFrame.origin" , value: "TOPOCENTER") instance(type: "coordsys_tessel:domain.spatial.StdRefFrame", role: "coordsys_tessel:domain.spatial.SpaceFrame.orientation", value: "ICRS") instance(type: "coordsys_tessel:domain.spatial.Epoch", role: "coordsys_tessel:domain.spatial.SpaceFrame.equinox" , value: "2000") reference(role: "coordSpace") { idref("_healpixframe") } } /* * Healpix parameters */ instance(type: "coordsys_tessel:domain.spatial.Healpix", id: "_healpixframe") { instance(type: "coordsys_tessel:domain.spatial.HealpixSchema", role: "coordsys_tessel:domain.spatial.Healpix.Schema", value: "NESTED") instance(type: "ivoa:integer", role: "coordsys_tessel:domain.spatial.Healpix.norder", value: "13") } } /* * Pseudo table necessarly to generatea VODML annotation */ resource(id: "table_objects") { table(id: "_table1") { def nameesaada = [] def pos_ra_csa = [] def pos_dec_csa = [] def error_maj_csa = [] def healpix_csa = [] def parallax_csa = [] /* * One Source instance per data row */ instance(type: "lmsource:source.Source", id: "_source") { // taking the name as primary key (works for this example) pk() { column(role: "lmsource:source.Source.name", id: "namesaada_100", data: nameesaada) } column(role: "lmsource:source.Source.name", id: "namesaada_100", data: nameesaada) // Position2D component: RA/DEC + error instance(role: "coords_tessel:domain.spatial.Position.tile", type:"coords_tessel:domain.spatial.Tile"){ instance(role: "coord_tessel:domain.spatial.Tile.skyindex", type: "coordsys_tessel:domain.spatial.Tile.skyindex"){ column(role: "coord_tessel:domain.spatial.SkyIndex.loc", id: "healpix_csa_100", data: healpix_csa) } } instance(role: "lmsource:source.Source.position", type: "coords_tessel:domain.spatial.Position2D") { // Position2D.coord is an attribute with a multiplicity of 2 instance(role: "coords_tessel:domain.spatial.Position2D.coord", type: "coordsys_tessel:domain.spatial.SpatialCoord") { column(role: "coordsys_tessel:domain.spatial.SpatialCoord.loc", id: "pos_ra_csa_100", data: pos_ra_csa) instance(role: "coordsys_tessel:domain.spatial.SpatialCoord.axis", type: "coordsys_tessel:domain.spatial.CoordAxis"){ instance(type: "ivoa:String", role: "name", value: "ra") } //} //instance(role: "coords_tessel:domain.spatial.Position2D.coord", type: "coordsys_tessel:domain.spatial.SpatialCoord") { column(role: "coordsys_tessel:domain.spatial.SpatialCoord.loc", id: "pos_dec_csa_100", data: pos_dec_csa) instance(role: "coordsys_tessel:domain.spatial.SpatialCoord.axis", type: "coordsys_tessel:domain.spatial.CoordAxis"){ instance(type: "ivoa:String", role: "name", value: "dec") } } instance(role: "coords_tessel:domain.spatial.Position2D.error", type: "coords_tessel:domain.spatial.StatisticalError2D") { instance(role: "coords_tessel:domain.spatial.StatisticalError2D.statError", type: "coords_tessel:dtypes.dtypes.Ellipse") { column(role: "coords_tessel:dtypes.Ellipse.semiAxis", id: "error_maj_csa_100", data: error_maj_csa) instance(role: "coords_tessel:dtypes.Ellipse.posAngle",type: "ivoa:Quantity", value: "0") } } } // Just to look a little bit like Gaia column(role: "lmsource:source.Source.parallax", id: "parallax_csa_100", data: parallax_csa) // Association with both space frame (don't know how to tell Jovial to make an association) reference(role: "coordsys_tessel:domain.spatial.spaceFrame") { idref("_coordspaceframe") } reference(role: "coordsys_tessel:domain.spatial.tesselation") { idref("_healpixspaceframe") } } } } }