Commit 53b029d8 authored by Moreau Nicolas's avatar Moreau Nicolas
Browse files

RadioProjection was not exported

parent bb7d8d16
import { FITS_HEADER } from "./fitsheader.js";
import {DecDeg2DMS, DecDeg2HMS, degToRad} from "./utils.js";
var ProjEnum = new Enum(['AZP', 'SZP', 'TAN', 'STG', 'SIN', 'ARC', 'ZPN', 'ZEA', 'AIR', 'CYP', 'CEA', 'CAR', 'MER', 'COP', 'COE', 'COD', 'COO', 'SFL', 'PAR', 'MOL', 'AIT', 'BON', 'PCO', 'TSC', 'CSC', 'QSC', 'HPX', 'XPH', 'GLS']);
let ProjEnum = new Enum(['AZP', 'SZP', 'TAN', 'STG', 'SIN', 'ARC', 'ZPN', 'ZEA', 'AIR'
, 'CYP', 'CEA', 'CAR', 'MER', 'COP', 'COE', 'COD', 'COO', 'SFL', 'PAR'
, 'MOL', 'AIT', 'BON', 'PCO', 'TSC', 'CSC', 'QSC', 'HPX', 'XPH', 'GLS']);
//p_azimutal pour RA--ARC : cl.fits, p_radio RA--GLS : m33, p_ortho RA--SIN (mrc.fits), p_gnomonic RA--TAN (nenufar.fits)
......@@ -53,8 +55,12 @@ class Projection {
static precision = 1e-10;
static create(a0, d0, angle, type) {
//Projection.enter(this.create.name);
let result = null;;
let result = null;
if(!ProjEnum.isDefined(type)){
throw('Undefined projection type');
}
switch (type) {
case ProjEnum.TAN:
result = new GnomonicProjection(a0, d0, angle);
......@@ -75,11 +81,11 @@ class Projection {
return result;
}
/*
** a0 : real - radians
** d0 : real - radians
** angle : real - radians
**
/**
* a0 : real - radians
* d0 : real - radians
* angle : real - radians
*
*/
constructor(a0, d0, angle) {
this._a0 = a0;
......@@ -197,8 +203,9 @@ class RadioProjection extends Projection {
constructor(a0, d0, angle) {
super(a0, d0, angle);
if (angle != 0.0) {
alert("RADIO does not support a projection angle, angle is set to 0.");
angle = 0.0;
//alert("RADIO does not support a projection angle, angle is set to 0.");
//angle = 0.0;
throw("RadioProjection does not support a projection angle, value must be 0");
}
this._npole = Math.PI * 0.5 - this._d0;
......@@ -782,5 +789,5 @@ function getProjection(type) {
export {
ProjUtils, Projection, GnomonicProjection, OrthoGraphicProjection,
AzimutalProjection, getProjection
AzimutalProjection, RadioProjection, getProjection, ProjEnum
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment