Skip to content

Commit

Permalink
Allow to create coo and footprint object
Browse files Browse the repository at this point in the history
  • Loading branch information
szpetny authored and bmatthieu3 committed Nov 29, 2023
1 parent c475669 commit ede4822
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/js/A.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ import { Coo } from "./libs/astro/coo.js";
import { URLBuilder } from "./URLBuilder.js";
import { HiPSDefinition } from "./HiPSDefinition.js";
import { ColorCfg } from './ColorCfg.js';

import { Footprint } from './Footprint.js';
import { ObsCore } from "./vo/ObsCore.js";
import { Aladin } from "./Aladin.js";
// Wasm top level import
Expand Down Expand Up @@ -141,6 +143,16 @@ A.catalogHiPS = function (rootURL, options) {
return new ProgressiveCat(rootURL, null, null, options);
};

// API
A.coo = function (longitude, latitude, prec) {
return new Coo(longitude, latitude, prec);
};

// API
A.footprint = function(shapes, source) {
return new Footprint(shapes, source);
};

// API
A.footprintsFromSTCS = function (stcs, options) {
var footprints = Overlay.parseSTCS(stcs, options);
Expand Down Expand Up @@ -171,7 +183,7 @@ A.catalogFromURL = function (url, options, successCallback, errorCallback, usePr
const processVOTable = function (sources, footprints, fields) {
catalog.setFields(fields);

if (catalog.isObsCore()) {
if (catalog.isObsCore()) {
// The fields corresponds to obscore ones
// Set the name of the catalog to be ObsCore:<catalog name>
catalog.name = "ObsCore:" + url;
Expand Down Expand Up @@ -305,4 +317,4 @@ A.init = (async () => {
}
})();

export default A;
export default A;

0 comments on commit ede4822

Please sign in to comment.