Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Caillat Michel
yafits
Commits
2e92f510
Commit
2e92f510
authored
Jan 09, 2020
by
Moreau Nicolas
Browse files
Merge branch 'master' into highcharts
parents
11bfdcc4
5328a223
Changes
13
Hide whitespace changes
Inline
Side-by-side
docker-compose.yml
View file @
2e92f510
...
...
@@ -6,7 +6,6 @@ services:
ports
:
-
"
${YAFITSV_PORT}:3000"
volumes
:
-
"
${YAFITS_FITSDIR}:/home/partemix/dataroot/FITS"
-
"
${YAFITS_PNGDIR}:/home/partemix/dataroot/PNG"
-
"
${YAFITS_OBJDIR}:/home/partemix/dataroot/OBJ"
-
"
${YAFITS_SAMPDIR}:/home/partemix/dataroot/SAMP"
...
...
@@ -22,16 +21,25 @@ services:
-
yafitss
yafitss
:
build
:
./yafitss
build
:
context
:
./yafitss
args
:
YAFITS_FITSDIR
:
${YAFITS_FITSDIR}
YAFITS_FITSDIR2
:
${YAFITS_FITSDIR2}
image
:
yafitss:${USER}
ports
:
-
"
${YAFITSS_PORT}:4251"
volumes
:
-
"
${YAFITS_FITSDIR}:/home/partemix/dataroot/FITS"
-
"
${YAFITS_FITSDIR}:${YAFITS_FITSDIR}"
-
"
${YAFITS_FITSDIR2}:${YAFITS_FITSDIR2}"
-
"
${YAFITS_PNGDIR}:/home/partemix/dataroot/PNG"
-
"
${YAFITS_OBJDIR}:/home/partemix/dataroot/OBJ"
-
"
${YAFITS_LOGDIR}:/home/partemix/log"
environment
:
-
YAFITS_FITSDIR
-
YAFITS_FITSDIR2
-
YAFITSS_PORT=${YAFITSS_PORT}
-
YAFITSS_MAXIDLE=${YAFITSS_MAXIDLE}
command
:
python /home/partemix/yafitss/serverWsgi.py --port
4251
yafits.bashrc.dist
View file @
2e92f510
...
...
@@ -13,6 +13,13 @@
#
export YAFITS_FITSDIR=/datartemix/ALMA/FITS
#
# A way to extend the disk space allocated to FITS files
# by using symbolic links defined in YAFITS_FITSDIR towards files
# or directories located in YAFITS_FITSDIR2
#
export YAFITS_FITSDIR2=/datartemix2/ALMA/FITS
#
# Where will the temporary PNG files and log files be written.
# Ensure that the directories are writable by anybody or at least
...
...
yafitss/DataBlock.py
View file @
2e92f510
...
...
@@ -1229,6 +1229,7 @@ class DataBlock:
result
[
"stdev"
]
=
{
"value"
:
np
.
nanstd
(
box
).
item
()
,
"unit"
:
bunit
}
result
[
"numpix"
]
=
{
"value"
:
np
.
count_nonzero
(
~
np
.
isnan
(
box
)),
"unit"
:
"pixels (!=Nan)"
}
result
[
"percentage of total number of pixels"
]
=
{
"value"
:
(
box
.
shape
[
0
]
*
box
.
shape
[
1
])
/
(
self
.
__header
[
"NAXIS1"
]
*
self
.
__header
[
"NAXIS2"
])
*
100
,
"unit"
:
"%"
}
result
[
"boundingRect"
]
=
{
"value"
:[
iRA0
,
iDEC0
,
iRA1
-
iRA0
,
iDEC1
-
iDEC0
],
"unit"
:
"pixels"
}
result
=
{
"status"
:
True
,
"message"
:
""
,
"result"
:
result
}
self
.
__logger
.
debug
(
"measureBox : exiting"
)
...
...
yafitss/Dockerfile
View file @
2e92f510
...
...
@@ -72,9 +72,20 @@ RUN echo "PATH=$PATH"
#------------------------------------------------------------#
# Create some directories expected by the application.
ARG
YAFITS_FITSDIR
ARG
YAFITS_FITSDIR2
ENV
YAFITS_FITSDIR=$YAFITS_FITSDIR
ENV
YAFITS_FITSDIR2=$YAFITS_FITSDIR2
# The root directory of the FITS files location (readonly). It'll have to be bound to an host directory.
RUN
mkdir
-p
/home/partemix/dataroot/FITS
RUN
printenv
RUN
sudo mkdir
-p
${
YAFITS_FITSDIR
}
RUN
sudo chown
partemix:partemix
${
YAFITS_FITSDIR
}
# The first extension to the root directory of FITS files location (readonly). It'll have to be bound to an host directory.
RUN
sudo mkdir
-p
${
YAFITS_FITSDIR2
}
RUN
sudo chown
partemix:partemix
${
YAFITS_FITSDIR2
}
# The root directory of the PNG files (read/write). It'll have to be bound to an host directory.
RUN
mkdir
-p
/home/partemix/dataroot/PNG
...
...
yafitss/dataManager_michel.py
View file @
2e92f510
...
...
@@ -15,8 +15,9 @@ from datetime import datetime
from
DataBlock
import
DataBlock
DataRoot
=
"dataroot"
FITSFilePrefix
=
DataRoot
+
'/FITS/'
FITSFilePrefix
=
os
.
getenv
(
"YAFITS_FITSDIR"
)
DataRoot
=
"/home/partemix/dataroot"
PNGFilePrefix
=
DataRoot
+
'/PNG/'
OBJFilePrefix
=
DataRoot
+
'/OBJ/'
ApiDocPrefix
=
DataRoot
+
'/apidoc/'
...
...
@@ -62,19 +63,29 @@ class DataManagerImpl :
try
:
absFITSFilePrefix
=
FITSFilePrefix
+
relKey
entries
=
(
os
.
listdir
(
absFITSFilePrefix
))
self
.
__logger
.
debug
(
"
type of entries %s"
%
(
type
(
entries
)
))
self
.
__logger
.
debug
(
"
%r"
%
entries
)
sortedEntries
=
entries
.
sort
()
children
=
[]
for
entry
in
entries
:
p
=
absFITSFilePrefix
+
'/'
+
entry
if
entry
.
startswith
(
"."
)
or
(
not
os
.
path
.
isdir
(
p
)
and
not
p
.
endswith
(
".fits"
))
:
condition
=
(
os
.
path
.
isfile
(
p
)
and
p
.
endswith
(
".fits"
))
if
not
condition
:
self
.
__logger
.
debug
(
"%s link %r"
%
(
p
,
os
.
path
.
islink
(
p
)))
if
os
.
path
.
islink
(
p
):
target
=
os
.
path
.
realpath
(
p
)
self
.
__logger
.
debug
(
"%s is dir %r"
%
(
target
,
os
.
path
.
isdir
(
target
)))
condition
=
os
.
path
.
islink
(
p
)
# and os.path.isdir(target)
else
:
condition
=
(
os
.
path
.
isdir
(
p
))
if
not
condition
:
continue
elif
entry
in
[
"log"
,
"NOFITS"
,
"IGNORE"
]:
continue
else
:
d
=
dict
()
d
[
"key"
]
=
relKey
+
'/'
+
entry
d
[
"folder"
]
=
os
.
path
.
is
dir
(
p
)
d
[
"folder"
]
=
not
os
.
path
.
is
file
(
p
)
d
[
"lazy"
]
=
d
[
"folder"
]
if
entry
.
endswith
(
".fits"
)
:
size
=
DataBlock
.
convert_size
(
os
.
path
.
getsize
(
p
))
...
...
@@ -86,6 +97,7 @@ class DataManagerImpl :
except
Exception
as
e
:
result
=
{
"status"
:
False
,
"message"
:
"Problem while looking for entries under '%s'. Error message was '%s'"
%
(
relKey
,
e
)}
self
.
__logger
.
debug
(
"%r"
%
result
)
self
.
__logger
.
debug
(
"%r"
%
result
)
self
.
__logger
.
debug
(
"__getEntries_0: exiting"
)
return
result
...
...
yafitsv/public/javascript/olqv_utils.js
View file @
2e92f510
...
...
@@ -116,7 +116,7 @@ function decLabelFormatter (dec0pix, dec1pix, dec0, dec1) {
function
summedPixelsSpectrumUnit
(
unit
)
{
switch
(
unit
)
{
case
"
Jy/beam
"
:
return
"
Jy
/beam * km/s
"
;
return
"
Jy
"
;
break
;
case
"
erg/s/cm^2/A/arcsec^2
"
:
...
...
yafitsv/views/olqv_2d.ejs
View file @
2e92f510
...
...
@@ -179,10 +179,16 @@ th, td {
<div
id=
"FITSHDR"
class=
"overlay"
style=
"overflow:scroll"
></div>
<
%
include
olqv_infosblock
%
>
<
%
include
olqv_navbar_external_content
%
>
<
%
include
olqv_settings
%
>
<
%
include
olqv_customcontrols
%
>
<
%
include
olqv_reset
%
>
<
%
include
olqv_samp_publisher
%
>
<
%
include
olqv_shapes
%
>
<
%
include
olqv_contours
%
>
<
%
include
olqv_boxes
%
>
<
%
include
olqv_markers
%
>
<
%
include
olqv_keyboardevents
%
>
<div
id=
"fullscreen"
class=
"fullscreen"
>
<div
class=
"sidepanel"
>
<nav
class=
"navbar navbar-dark bg-dark"
>
...
...
@@ -251,30 +257,23 @@ var _imageLoadFunction_1 = function(image, src) {
** one image built from the content of a 2D FITS file
*/
var
_canvasContext
=
null
;
var
yAFITSContoursViewer
;
var
yaFITSContours
GUI
;
var
contoursFactory
;
var
contoursFactory
GUI
;
var
reset
;
var
settings
;
var
boxTool
;
var
format
=
function
(
floatValue
)
{
let
result
=
floatValue
;
if
(
typeof
result
===
"
number
"
&&
!
Number
.
isInteger
(
result
)){
result
=
result
.
toExponential
(
4
);
}
return
result
;
};
var
keyCodeProcessor
;
var
infos_line
=
document
.
getElementById
(
'
infos-line
'
);
var
infos_block
=
document
.
getElementById
(
'
ModalInfosBlockBody
'
);
var
populateInfosBlock
=
function
(
title
,
collection
)
{
infos_block
.
innerHTML
=
"
<b>
"
+
title
+
"
<br><br>
"
;
for
(
var
k
in
collection
)
{
infos_block
.
innerHTML
+=
k
+
"
:
"
+
format
(
collection
[
k
][
"
value
"
])
+
"
"
+
collection
[
k
][
"
unit
"
]
+
"
<br>
"
;
}
}
//
var populateInfosBlock = function(title, collection) {
//
infos_block.innerHTML = "
<
b
>
"
+title+
"
<
br
><
br
>
"
;
//
for (var k in collection) {
//
infos_block.innerHTML += k +
"
:
"
+ format(collection[k][
"
value
"
]) +
"
"
+ collection[k][
"
unit
"
] +
"
<
br
>
"
;
//
}
//
}
function SliceViewer (relFITSFilePath, width, height, RADECRangeInDegrees, FITSHeader, divSlice) {
console.log(
"
SliceViewer
:
entering
"
);
...
...
@@ -336,6 +335,9 @@ function SliceViewer (relFITSFilePath, width, height, RADECRangeInDegrees, FITSH
let _naxis = parseInt(header[
"
NAXIS
"
]);
let _naxis1 = parseInt(header[
"
NAXIS1
"
]);
let _naxis2 = parseInt(header[
"
NAXIS2
"
]);
if (_naxis > 2) _naxis3 = parseInt(header[
"
NAXIS3
"
]);
if (_naxis > 4) _naxis4 = parseInt(header[
"
NAXIS4
"
]);
let _crpix = [parseFloat(header[
"
CRPIX1
"
]), parseFloat(header[
"
CRPIX2
"
])];
let _crval = [parseFloat(header[
"
CRVAL1
"
]), parseFloat(header[
"
CRVAL2
"
])];
let _cdelt = [parseFloat(header[
"
CDELT1
"
]), parseFloat(header[
"
CDELT2
"
])];
...
...
@@ -365,6 +367,10 @@ function SliceViewer (relFITSFilePath, width, height, RADECRangeInDegrees, FITSH
return result;
};
this.is3D = function() {
return (_naxis==3 && _naxis3>1) || (_naxis==4 && _naxis3>1 && _naxis4==1);
}
this.getSliceIndex = function () {
return _sliceIndex;
}
...
...
@@ -609,7 +615,7 @@ var _marker_styles_f = function(feature) {
let properties = selectedFeature.get(
"
properties
"
);
let level = properties[
"
level
"
][
"
value
"
].toExponential(3);
if (
"
measurements
"
in properties) {
yAFITSContoursViewer
.
selected
(
selectedFeature
);
contoursFactory
.selected(selectedFeature);
}
else {
document.getElementById('loading').style.display=
"
block
"
;
...
...
@@ -624,7 +630,7 @@ var _marker_styles_f = function(feature) {
console.log(resp[
"
result
"
]);
properties[
"
measurements
"
]=resp[
"
result
"
];
selectedFeature.set(
"
properties
"
,properties);
yAFITSContoursViewer
.
selected
(
selectedFeature
);
contoursFactory
.selected(selectedFeature);
}
console.log('measureContour callback : exiting');
});
...
...
@@ -1115,7 +1121,10 @@ $( document ).ready(function() {
sliceViewer
=
new
SliceViewer
(
relFITSFilePath
,
width
,
height
,
RADECRangeInDegrees
,
header
,
"
slice
"
);
sliceViewer
.
display
();
document
.
addEventListener
(
'
keydown
'
,
sliceViewer
.
processKeyCode
,
false
);
//document.addEventListener('keydown', sliceViewer.processKeyCode, false);
keyCodeProcessor
=
new
KeyCodeProcessor
(
sliceViewer
);
keyCodeProcessor
.
open
();
infosBlock
=
new
InfosBlock
(
sliceViewer
);
...
...
@@ -1135,11 +1144,11 @@ $( document ).ready(function() {
markerFactory
=
new
MarkerFactory
(
sliceViewer
);
customControls
.
addButton
(
markerFactory
.
getButton
());
yAFITSContoursViewer
=
new
Contours
Viewer
(
sliceViewer
,
infosBlock
);
customControls
.
addButton
(
yAFITSContoursViewer
.
getButton
());
contoursFactory
=
new
Contours
Factory
(
sliceViewer
,
infosBlock
);
customControls
.
addButton
(
contoursFactory
.
getButton
());
yAFITSContours
GUI
=
new
ContoursGUI
();
yAFITSContoursGUI
.
connect
(
yAFITSContoursViewer
,
sliceViewer
);
contoursFactory
GUI
=
new
Contours
Factory
GUI
();
contoursFactoryGUI
.
connect
(
contoursFactory
,
sliceViewer
);
boxFactory
=
new
BoxFactory
(
sliceViewer
,
infosBlock
);
customControls
.
addButton
(
boxFactory
.
getButton
());
...
...
yafitsv/views/olqv_boxes.ejs
View file @
2e92f510
<script>
class BoxFactory {
class BoxFactory
extends ShapesFactory
{
constructor (sliceViewer, infosBlock) {
super(sliceViewer, infosBlock);
ShapesFactory.enter(this.constructor.name);
console.log("BoxFactory ctor: entering");
this.source;
...
...
@@ -13,53 +15,8 @@ class BoxFactory {
let target = this.map.getTarget();
this.jTarget = typeof target === "string" ? $("#" + target) : $(target);
this.lastSelectedBox = null;
this.highlightStyle = new ol.style.Style({
fill: new ol.style.Fill({
color: 'rgba(255,255,255,0.7)'
}),
stroke: new ol.style.Stroke({
color: '#3399CC',
width: 3
})
});
this.style = {
'LineString': new ol.style.Style({
stroke: new ol.style.Stroke({
color: 'lightblue',
//lineDash: [2],
width: 2
}),
fill: new ol.style.Fill({
color: 'rgba(0, 0, 255, 0.6)'
})
}),
'Polygon': new ol.style.Style({
stroke: new ol.style.Stroke({
color: 'lightblue',
//lineDash: [2],
width: 2
}),
fill: new ol.style.Fill({
color: 'rgba(0, 0, 255, 0.1)'
})
})
};
this.style_f = (feature) => {
return this.style[feature.getGeometry().getType()];
};
this.source = new ol.source.Vector();
this.layer = new ol.layer.Vector({source: this.source, style: this.style_f});
this.map.addLayer(this.layer);
this.layer.setZIndex(12);
this.visible = true;
this.overlay = null;
this.container = document.getElementById('popup');
this.content = document.getElementById('popup-content');
this.closer = document.getElementById('popup-closer');
this.lastSelectedContour = null;
...
...
@@ -73,77 +30,46 @@ class BoxFactory {
this.button.onclick = f.bind(this);
this.isOpened = false;
this.infosBlock = infosBlock;
/*
** This is our dragbox interaction
*/
this.dragBox = new ol.interaction.DragBox({condition: ol.events.condition.platformModifierKeyOnly});
this.dragBox.on('boxend', () => {
console.log
("this.dragBox.on('boxend', function() { : entering");
ShapesFactory.enter
("this.dragBox.on('boxend', function() { : entering");
var extent = this.dragBox.getGeometry().getExtent();
// The real work when a drag box interaction reach its end is done below ( saynchronously )
//this.createAndMeasureBox(this.relFITSFilePath, this.sliceIndex, extent[0], extent[2], extent[1], extent[3]);
let box = this.prepareBox(extent[0], extent[2], extent[1], extent[3]);
this.measure(box);
console.log("this.dragBox.on('boxend', function() { : exiting"
);
ShapesFactory.exit(
);
});
console.log("BoxFactory ctor: exiting"
);
ShapesFactory.exit(
);
}
getButton() {
return this.button;
}
highlight(feature) {
console.log("highlight : entering");
if (this.lastSelectedBox !== null) {
this.lastSelectedBox.setStyle(undefined);
}
feature.setStyle(this.highlightStyle);
this.lastSelectedBox = feature;
console.log("highlight : exiting");
}
open() {
console.log('open: entering'
);
this.map.addInteraction(this.dragBox);
this.jTarget.css('cursor','nwse-resize');
this.isOpened = true;
console.log('open: exiting'
);
ShapesFactory.enter(this.open.name
);
this.map.addInteraction(this.dragBox);
this.jTarget.css('cursor','nwse-resize');
this.isOpened = true;
ShapesFactory.exit(
);
}
close() {
console.log('close: open'
);
ShapesFactory.enter(this.close.name
);
this.map.removeInteraction(this.dragBox);
this.jTarget.css('cursor','pointer');
this.isOpened = false;
console.log('close: exiting'
);
ShapesFactory.exit(
);
}
hide() {
console.log("hide : entering");
this.layer.setVisible(false);
console.log("hide : exiting");
};
show() {
console.log("show : entering");
this.layer.setVisible(true);
console.log("show : exiting");
};
clear() {
console.log("clear : entering");
if (this.lastSelectedBox) this.lastSelectedBox.setStyle(undefined);
this.lastSelectedBox = null;
this.source.clear();
console.log("clear : exiting");
};
prepareBox(iRA0, iRA1, iDEC0, iDEC1){
console.log("createBox: entering"
);
ShapesFactory.enter(this.prepareBox.name
);
document.getElementById('loading').style.display='block';
var tl = [iRA0, iDEC1];
var tr = [iRA1, iDEC1];
...
...
@@ -157,12 +83,12 @@ class BoxFactory {
let properties = {};
properties["type"]="box";
feature.set("properties",properties);
console.log("createBox: exiting"
);
ShapesFactory.exit(
);
return feature;
}
measure(feature, addFeature=true) {
console.log("measure: entering"
);
ShapesFactory.enter(this.measure.name
);
let properties = feature.get("properties");
if (properties.hasOwnProperty("type") && properties["type"] === "box") {
document.getElementById('loading').style.display="block";
...
...
@@ -180,7 +106,7 @@ class BoxFactory {
'iDEC0': iDEC0,
'iDEC1': iDEC1 },
(resp) => {
console.log
('measure callback: entering');
ShapesFactory.enter
('measure callback: entering');
document.getElementById('loading').style.display="none";
if ( resp["status"] == false ){
alert ("Something went wrong with the measurements of contour. The message was '" + resp["message"]+"'");
...
...
@@ -193,23 +119,24 @@ class BoxFactory {
this.selected(feature);
}
}
console.log('measureBox callback: exiting'
);
ShapesFactory.exit(
);
} );
}
else {
console.log("Unable to measure such a feature") ;
}
console.log("measure : exiting"
);
ShapesFactory.exit(
);
}
selected(
feature
) {
console.log("selected : entering"
);
let properties =
feature
.get("properties");
selected(
box
) {
ShapesFactory.enter(this.selected.name
);
let properties =
box
.get("properties");
let title = "Flux in box : " + properties["measurements"]["sum"]["value"].toExponential(4) + " " + properties["measurements"]["sum"]["unit"];
this.infosBlock.headline(title)
this.infosBlock.populate(title, properties["measurements"]);
this.highlight(feature);
console.log("selected : exiting");
this.highlight(box);
ShapesFactory.selection = box;
ShapesFactory.exit();
}
}
</script>
yafitsv/views/olqv_contours.ejs
View file @
2e92f510
<script>
class ContoursViewer {
class ContoursFactory extends ShapesFactory {
constructor (sliceViewer, infosBlock) {
console.log("ContoursViewer ctor: entering");console.trace();
this.infosBlock = infosBlock;
super(sliceViewer, infosBlock);
ShapesFactory.enter(this.constructor.name);
this.source;
this.layer;
this.sliceViewer = sliceViewer;
this.relFITSFilePath = this.sliceViewer.getRelFITSFilePath();
this.sliceIndex = this.sliceViewer.getSliceIndex();
this.map = sliceViewer.getMap();
this.infosBlock = infosBlock;
this.highlightStyle = new ol.style.Style({
fill: new ol.style.Fill({
color: 'rgba(255,255,255,0.7)'
}),
stroke: new ol.style.Stroke({
color: '#3399CC',
width: 3
})
});
this.style = {
'LineString': new ol.style.Style({
stroke: new ol.style.Stroke({
color: 'blue',
lineDash: [2],
width: 1
}),
fill: new ol.style.Fill({
color: 'rgba(0, 0, 255, 0.6)'
})
}),
'Polygon': new ol.style.Style({
stroke: new ol.style.Stroke({
color: 'green',
lineDash: [2],
width: 1
}),
fill: new ol.style.Fill({
color: 'rgba(0, 0, 255, 0.1)'
})
})
};
this.style_f = (feature) => {
return this.style[feature.getGeometry().getType()];
};
this.source = new ol.source.Vector();
this.layer = new ol.layer.Vector({source: this.source, style: this.style_f});
this.map.addLayer(this.layer);
this.layer.setZIndex(10);
this.visible = true;
this.overlay = null;
this.container = document.getElementById('popup');
this.content = document.getElementById('popup-content');
this.closer = document.getElementById('popup-closer');
this.lastSelectedContour = null;
this.lastBox = null;
$(this.map.getTargetElement()).append($("#ModalContoursForm"));
...
...
@@ -74,37 +24,21 @@ class ContoursViewer {
this.button.setAttribute("title", "Draw contours");
this.button.append("C");
console.log("ContoursViewer
ctor
:
exit
ing");console.trace
();
ShapesFa
ctor
y.
exit();
}
getButton() {
return this.button;
}
highlight(feature) {
console.log("highlight : entering");
if (this.lastSelectedContour !== null) {
this.lastSelectedContour.setStyle(undefined);
if (this.lastBox !== null) {
this.source.removeFeature(this.lastBox);
this.lastBox = null;
}
}
feature.setStyle(this.highlightStyle);
this.box(feature);
//this.grid(feature);
this.lastSelectedContour = feature;
console.log("highlight : exiting");
}
box(feature) {
console.log("box : entering");
let br = feature.get("properties")["measurements"]["boundingRect"]["value"];
let corners=[[br[0], br[1]],
[br[0]+br[2]-1, br[1]],
[br[0]+br[2]-1, br[1]+br[3]-1],
[br[0], br[1]+br[3]-1],
[br[0], br[1]]];
[br[0]+br[2]-1, br[1]],
[br[0]+br[2]-1, br[1]+br[3]-1],
[br[0], br[1]+br[3]-1],
[br[0], br[1]]];
this.lastBox = new ol.Feature({geometry: new ol.geom.Polygon([corners])});
this.source.addFeature(this.lastBox);
...
...
@@ -126,54 +60,47 @@ class ContoursViewer {
}
importYAFITSContours(yAFITSContours) {
ShapesFactory.enter(this.importYAFITSContours.name);
console.log("importYAFITSContours: entering");
this.clear();
var features = new Array();
yAFITSContours.forEach((contour) => {
let coordinates = contour["coordinates"];
coordinates.push(coordinates[0]);
coordinates.push(coordinates[0]);;
let properties = contour["properties"];
properties["type"] = "contour"
features.push(new ol.Feature( { geometry : new ol.geom.LineString(coordinates),
properties : contour["properties"]}))});
properties : properties}))}
);
this.source.addFeatures(features);
this.show();
console.log("importYAFITSContours: exiting");
ShapesFactory.exit()
}
hide() {
console.log("hide : entering");
this.layer.setVisible(false);
console.log("hide : exiting");
selected(contour) {
ShapesFactory.enter(this.selected.name);
let properties = contour.get("properties");
let level = properties["level"]["value"].toExponential(3);
let levelUnit = properties["level"]["unit"];
let title = 'Contour level at ' + level + ' ' + levelUnit;
this.infosBlock.headline(title)
this.infosBlock.populate(title, properties["measurements"]);
this.highlight(contour);
ShapesFactory.selection = contour;
ShapesFactory.exit()
}
}; // End of class ContoursFactory
show() {
console.log("show : entering");
this.layer.setVisible(true);
console.log("show : exiting");
class ContoursFactoryGUI {