Skip to content
GitLab
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
598c01df
Commit
598c01df
authored
Jan 17, 2020
by
Caillat Michel
Browse files
correction in forula used to display summed graph title
parent
99cfd200
Changes
1
Hide whitespace changes
Inline
Side-by-side
yafitsv/views/olqv.ejs
View file @
598c01df
...
...
@@ -372,7 +372,6 @@
*/
function
getSummedSpectrumTitle
(
avgSpectrum
,
imin
,
imax
,
cdelt3prim
){
let
result
=
0
;
console
.
log
(
"
###getSummedSpectrumTitle
"
);
if
(
_ctype3
===
'
VRAD
'
&&
_cdelt3
<
0
){
let
copy
=
(
x
)
=>
x
;
let
arraycopy
=
avgSpectrum
.
map
(
copy
);
...
...
@@ -380,13 +379,20 @@
}
else
{
result
=
sumArr
(
avgSpectrum
,
imin
,
imax
,
cdelt3prim
);
}
return
result
/
unitRescale
(
summedPixelsSpectrumUnit
(
_bunit
));
}
function
getCalculatedIndex
(
value
){
let
val1
=
(
unitFactor
[
defaultOutputUnit
[
_ctype3
]]
/
unitFactor
[
getCunit3
()])
/
_cdelt3
;
let
result
=
Math
.
abs
(
value
*
val1
)
-
_crval3
+
_crpix3
-
1
;
function
getCalculatedIndex
(
value
){
let
result
=
0
;
if
(
_ctype3
===
'
VRAD
'
){
let
step1
=
(
unitFactor
[
defaultOutputUnit
[
_ctype3
]]
/
unitFactor
[
getCunit3
()])
/
_cdelt3
;
result
=
Math
.
abs
(
value
*
step1
)
-
_crval3
+
_crpix3
-
1
;
}
else
if
(
_ctype3
===
'
FREQ
'
){
// if ctype is FREQ we have to read defaultOutputUnit['VRAD']
let
step1
=
v2f
(
value
*
unitFactor
[
defaultOutputUnit
[
'
VRAD
'
]]
,
_restfreq
);
let
step2
=
(
step1
-
_crval3
)
/
_cdelt3
;
result
=
step2
+
_crpix3
-
1
;
}
return
Math
.
round
(
result
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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