Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion argus/VERSION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## deployable containers have a semantic and build tag
# semantic version tag: major.minor
# build version tag: timestamp
VER=1.0.25
VER=1.0.27
TAGS="${VER} ${VER}-$(date -u +"%Y%m%dT%H%M%S")"
unset VER
2 changes: 1 addition & 1 deletion argus/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ dependencies {
implementation 'org.opencadc:cadc-adql:[1.1.5,)'
implementation 'org.opencadc:cadc-uws:[1.1.0,2.0)'
implementation 'org.opencadc:cadc-uws-server:[1.3.1,)'
implementation 'org.opencadc:caom2-tap-server:[1.2.23,)'
implementation 'org.opencadc:caom2-tap-server:[1.2.24,)'

implementation 'org.opencadc:cadc-access-control:[1.0,2.0)'
implementation 'org.opencadc:cadc-access-control-identity:[1.1.0,2.0)'
Expand Down
7 changes: 7 additions & 0 deletions argus/src/main/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,15 @@
<display-name>argus</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.xhtml</welcome-file>
</welcome-file-list>

<!-- for DALI examples -->
<mime-mapping>
<extension>xhtml</extension>
<mime-type>application/xhtml+xml</mime-type>
</mime-mapping>

<servlet>
<servlet-name>logControl</servlet-name>
<servlet-class>ca.nrc.cadc.log.LogControlServlet</servlet-class>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<!DOCTYPE html>
<html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.1//EN" "http://w3.org">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:schema="http://schema.org"
xml:lang="en" lang="en">
<head>
<title>Query Examples</title>
</head>
Expand Down Expand Up @@ -28,8 +30,7 @@ <h2 property="name">Standard CAOM Discovery Query with Spatial Constraint</h2>
</div>

<div property="generic-parameter" typeof="keyval">
<span property="key">QUERY</span> =
<pre property="value">
<span property="key">QUERY</span> = <pre property="value">
SELECT p.publisherID, o.telescope_name, o.instrument_name,
p.calibrationLevel, p.dataProductType,
p.position_bounds, p.energy_bounds, p.time_bounds, p.polarization_states
Expand Down Expand Up @@ -70,8 +71,7 @@ <h2 property="name">Standard CAOM Query with Primary Artifact</h2>
</div>

<div property="generic-parameter" typeof="keyval">
<span property="key">QUERY</span> =
<pre property="value">
<span property="key">QUERY</span> = <pre property="value">
SELECT p.publisherID, o.telescope_name, o.instrument_name,
p.calibrationLevel, p.dataProductType,
p.position_bounds, p.energy_bounds, p.time_bounds, p.polarization_states,
Expand Down
2 changes: 1 addition & 1 deletion argus/src/main/webapp/service.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"info": {
"version": "1.0",
"title": "Argus Web Service",
"description": "The Common Archive Observation Model (CAOM) table access protocol (TAP) web service.\n<a href=\"http://www.ivoa.net/documents/TAP/\" target=\"_blank\">IVOA TAP Specification</a>\n\nThe synchronous and asynchronous service endpoints conform the the IVOA UWS (Universal Worker Service) Framework.\n<a href=\"http://www.ivoa.net/documents/UWS/\" target=\"_blank\">IVOA UWS Specification</a>\n\nThis service implements the IVOA TAP-1.1 proposed recommendation and exposes the Common Archive Observation Model (CAOM-2.3) content at CADC. The CAOM tables are all part of a schema called caom2. The main tables are:\n- caom2.Observation: these are simple observations (the exposures taken at the telescope) or composite observations (a group of simple observations where a new data product has been or can be made, e.g. a stack of images) collected together in a single table (type = S or C)\n- caom2.Plane: a plane is one of the data products of an observation, including the raw data, the calibrated data (standard data reduction applied), advanced data products (non-standard processing), and source catalogues derived from the data\n- caom2.Artifact: an artifact describes a single persistent data object; this is usually a file in the CADC archive storage system but could be a file stored in VOSpace or an external site\n### IVOA Data Models\nIn addition to the CAOM, this TAP service also provides access to some standard data models via the following database tables:\n- caom2.SIAv1: a view on CAOM that provides access to calibrated images; VOTable output is compatible with the Simple Image Access (SIA) version 1.0 specification\n- ivoa.ObsCore: supports <a href=\"http://www.ivoa.net/documents/ObsCore/index.html\" target=\"_blank\">ObsCore-1.1</a> physical model from the ObsTAP project\n### Downloading Data\nThe planeURI column in the caom2.Plane table can be used to query the related DataLink service to get details about files that can be downloaded and related services that can operate on a product.\nThe obs_publisher_did column in the ivoa.ObsCore table contains the same identifiers for use with the DataLink service.\n### Authentication\nSome of the observations and planes in CAOM have proprietary metadata (metaRelease is null or in the future). Users may authenticate in order to see both public metadata and proprietary metadata they are authorized to view.\nThe async and sync endpoints described below support anonymous access, cookie authentication, and client-certificate authentication. To authenticate with username and password (HTTP Basic Auth), users must prepend \"auth-\" to endpoint name (e.g. /tap/auth-sync for synchronous query execution and /tap/auth-async for asynchronous query execution). \nFor anonymous queries, the service will automatically restrict access to public metadata only.\n### Unsupported ADQL Constructs\nThe following ADQL Functions are not currently supported: ALL and DISTINCT within an aggregate function (AVG, COUNT, MIN, MAX, COUNT) PI RAND TRUNCATE\n"
"description": "The Common Archive Observation Model (CAOM) table access protocol (TAP) web service.\n<a href=\"http://www.ivoa.net/documents/TAP/\" target=\"_blank\">IVOA TAP Specification</a>\n\nThe synchronous and asynchronous service endpoints conform the the IVOA UWS (Universal Worker Service) Framework.\n<a href=\"http://www.ivoa.net/documents/UWS/\" target=\"_blank\">IVOA UWS Specification</a>\n\nThis service implements the IVOA TAP-1.1 proposed recommendation and exposes the Common Archive Observation Model (CAOM-2.4) content at CADC. The CAOM tables are all part of a schema called caom2. The main tables are:\n- caom2.Observation: these are simple observations (the exposures taken at the telescope) or derived observations (a group of simple observations where a new data product has been or can be made, e.g. a stack of images) collected together in a single table\n- caom2.Plane: a plane is one of the data products of an observation, including the raw data, the calibrated data (standard data reduction applied), advanced data products (non-standard processing), and source catalogues derived from the data\n- caom2.Artifact: an artifact describes a single persistent data object; this is usually a file in the CADC archive storage system but could be a file stored in VOSpace or an external site\n### IVOA Data Models\nIn addition to the CAOM, this TAP service also provides access to some standard data models via the following database tables:\n- caom2.SIAv1: a view on CAOM that provides access to calibrated images; VOTable output is compatible with the Simple Image Access (SIA) version 1.0 specification\n- ivoa.ObsCore: supports <a href=\"http://www.ivoa.net/documents/ObsCore/index.html\" target=\"_blank\">ObsCore-1.1</a> physical model from the ObsTAP project\n### Downloading Data\nThe publisherID column in the caom2.Plane table can be used to query the related DataLink service to get details about files that can be downloaded and related services that can operate on a product.\nThe obs_publisher_did column in the ivoa.ObsCore table contains the same identifiers for use with the DataLink service.\n### Authentication\nSome of the observations and planes in CAOM have proprietary metadata (metaRelease is null or in the future). Users may authenticate in order to see both public metadata and proprietary metadata they are authorized to view.\nThe async and sync endpoints described below support anonymous access, cookie authentication, and client-certificate authentication. To authenticate with username and password (HTTP Basic Auth), users must prepend \"auth-\" to endpoint name (e.g. /tap/auth-sync for synchronous query execution and /tap/auth-async for asynchronous query execution). \nFor anonymous queries, the service will automatically restrict access to public metadata only.\n### Unsupported ADQL Constructs\nThe following ADQL Functions are not currently supported: ALL and DISTINCT within an aggregate function (AVG, COUNT, MIN, MAX, COUNT) PI RAND TRUNCATE\n"
},
"schemes": [
"https"
Expand Down
2 changes: 1 addition & 1 deletion caom2-tap-server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ sourceCompatibility = 11

group = 'org.opencadc'

version = '1.2.23'
version = '1.2.24'

description = 'OpenCADC CAOM2 TAP server library'
def git_url = 'https://github.com/opencadc/caom2'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
/*
************************************************************************
******************* CANADIAN ASTRONOMY DATA CENTRE *******************
************** CENTRE CANADIEN DE DONNÉES ASTRONOMIQUES **************
*
* (c) 2026. (c) 2026.
* Government of Canada Gouvernement du Canada
* National Research Council Conseil national de recherches
* Ottawa, Canada, K1A 0R6 Ottawa, Canada, K1A 0R6
* All rights reserved Tous droits réservés
*
* NRC disclaims any warranties, Le CNRC dénie toute garantie
* expressed, implied, or énoncée, implicite ou légale,
* statutory, of any kind with de quelque nature que ce
* respect to the software, soit, concernant le logiciel,
* including without limitation y compris sans restriction
* any warranty of merchantability toute garantie de valeur
* or fitness for a particular marchande ou de pertinence
* purpose. NRC shall not be pour un usage particulier.
* liable in any event for any Le CNRC ne pourra en aucun cas
* damages, whether direct or être tenu responsable de tout
* indirect, special or general, dommage, direct ou indirect,
* consequential or incidental, particulier ou général,
* arising from the use of the accessoire ou fortuit, résultant
* software. Neither the name de l'utilisation du logiciel. Ni
* of the National Research le nom du Conseil National de
* Council of Canada nor the Recherches du Canada ni les noms
* names of its contributors may de ses participants ne peuvent
* be used to endorse or promote être utilisés pour approuver ou
* products derived from this promouvoir les produits dérivés
* software without specific prior de ce logiciel sans autorisation
* written permission. préalable et particulière
* par écrit.
*
* This file is part of the Ce fichier fait partie du projet
* OpenCADC project. OpenCADC.
*
* OpenCADC is free software: OpenCADC est un logiciel libre ;
* you can redistribute it and/or vous pouvez le redistribuer ou le
* modify it under the terms of modifier suivant les termes de
* the GNU Affero General Public la “GNU Affero General Public
* License as published by the License” telle que publiée
* Free Software Foundation, par la Free Software Foundation
* either version 3 of the : soit la version 3 de cette
* License, or (at your option) licence, soit (à votre gré)
* any later version. toute version ultérieure.
*
* OpenCADC is distributed in the OpenCADC est distribué
* hope that it will be useful, dans l’espoir qu’il vous
* but WITHOUT ANY WARRANTY; sera utile, mais SANS AUCUNE
* without even the implied GARANTIE : sans même la garantie
* warranty of MERCHANTABILITY implicite de COMMERCIALISABILITÉ
* or FITNESS FOR A PARTICULAR ni d’ADÉQUATION À UN OBJECTIF
* PURPOSE. See the GNU Affero PARTICULIER. Consultez la Licence
* General Public License for Générale Publique GNU Affero
* more details. pour plus de détails.
*
* You should have received Vous devriez avoir reçu une
* a copy of the GNU Affero copie de la Licence Générale
* General Public License along Publique GNU Affero avec
* with OpenCADC. If not, see OpenCADC ; si ce n’est
* <http://www.gnu.org/licenses/>. pas le cas, consultez :
* <http://www.gnu.org/licenses/>.
*
************************************************************************
*/

package ca.nrc.cadc.tap.caom2;

import ca.nrc.cadc.caom2.types.SegmentType;
import ca.nrc.cadc.dali.MultiShape;
import ca.nrc.cadc.dali.Point;
import ca.nrc.cadc.dali.Polygon;
import ca.nrc.cadc.dali.util.MultiShapeFormat;
import ca.nrc.cadc.tap.writer.format.AbstractResultSetFormat;
import ca.nrc.cadc.tap.writer.format.DoubleArrayFormat;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.apache.log4j.Logger;

/**
* Format position_bounds_samples as a xtype="multishape".
* @author pdowler
*/
public class CaomMultiShapeFormat extends AbstractResultSetFormat {
private static final Logger log = Logger.getLogger(CaomMultiShapeFormat.class);

private DoubleArrayFormat daf = new DoubleArrayFormat();
private static final MultiShapeFormat fmt = new MultiShapeFormat();

public CaomMultiShapeFormat() {
}

@Override
public Object extract(ResultSet resultSet, int columnIndex) throws SQLException {
double[] arr = (double[]) daf.extract(resultSet, columnIndex);
if (arr == null) {
return null;
}

MultiShape ret = new MultiShape();
Polygon poly = new Polygon();
for (int i = 0; i < arr.length; i += 3) {
double cv1 = arr[i];
double cv2 = arr[i + 1];
SegmentType st = SegmentType.toValue((int) arr[i + 2]);
if (SegmentType.CLOSE.equals(st)) {
ret.getShapes().add(poly);
poly = new Polygon();
} else {
poly.getVertices().add(new Point(cv1, cv2));
}
}
return ret;
}

@Override
public String format(Object o) {
if (o == null) {
return "";
}
if (o instanceof MultiShape) {
MultiShape v = (MultiShape) o;
return fmt.format(v);
}

throw new RuntimeException("invalid type (expected: MultiShape): " + o.getClass().getName());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
*
* @author pdowler
*/
@Deprecated
public class PositionBoundsSamplesFormat extends AbstractResultSetFormat {
private static final Logger log = Logger.getLogger(PositionBoundsSamplesFormat.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@

import ca.nrc.cadc.dali.util.Format;
import ca.nrc.cadc.tap.TapSelectItem;
import ca.nrc.cadc.tap.caom2.CaomMultiShapeFormat;
import ca.nrc.cadc.tap.caom2.DataLinkURLFormat;
import ca.nrc.cadc.tap.caom2.IntervalFormat;
import ca.nrc.cadc.tap.caom2.PositionBoundsRegionFormat;
Expand Down Expand Up @@ -110,6 +111,15 @@ protected Format<Object> getShapeFormat(TapSelectItem columnDesc) {
return super.getShapeFormat(columnDesc);
}

@Override
protected Format<Object> getMultiShapeFormat(TapSelectItem columnDesc) {
if (columnDesc.utype != null && columnDesc.utype.equals("caom2:Plane.position.bounds.samples")) {
return new CaomMultiShapeFormat();
}
return super.getMultiShapeFormat(columnDesc);
}


@Override
protected Format<Object> getMultiPolygonFormat(TapSelectItem columnDesc) {
if (columnDesc.utype != null && columnDesc.utype.equals("caom2:Plane.position.bounds.samples")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public class InitCaomTapSchemaContent extends InitDatabase {
private static final Logger log = Logger.getLogger(InitCaomTapSchemaContent.class);

public static final String MODEL_NAME = "caom-schema";
public static final String MODEL_VERSION = "1.2.23";
public static final String MODEL_VERSION = "1.2.24";

// the SQL is tightly coupled to cadc-tap-schema table names (for TAP-1.1)
static String[] BASE_SQL = new String[] {
Expand Down
Loading
Loading