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
d68d06a3
Commit
d68d06a3
authored
Dec 17, 2019
by
Caillat Michel
Browse files
Code cleanup
parent
7d72fb76
Changes
1
Hide whitespace changes
Inline
Side-by-side
yafitsv/views/olqv_2d.ejs
View file @
d68d06a3
...
...
@@ -265,23 +265,15 @@ var settings;
var
boxTool
;
var
keyCodeProcessor
;
var
format
=
function
(
floatValue
)
{
let
result
=
floatValue
;
if
(
typeof
result
===
"
number
"
&&
!
Number
.
isInteger
(
result
)){
result
=
result
.
toExponential
(
4
);
}
return
result
;
};
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
"
);
...
...
@@ -343,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
"
])];
...
...
@@ -372,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;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment