Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A possibility to create Coo and Footprint objects #130

Merged
merged 1 commit into from
Nov 29, 2023
Merged
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
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;