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
Tom Dwelly
speccy
Commits
858bb76e
Commit
858bb76e
authored
Mar 17, 2016
by
Tom Dwelly
Browse files
added calculation of AB mag at cursor position
parent
ffe45b23
Changes
1
Hide whitespace changes
Inline
Side-by-side
speccy.js
View file @
858bb76e
...
...
@@ -1141,13 +1141,16 @@ document.body.addEventListener('mousedown', function (evt){
var
dflux_dy
=
(
y1
-
y0
)
/
(
ysize
-
2
.
*
pady
);
var
lobs
=
(
mousePos
.
x
-
padx1
)
*
dl_dx
+
x0
;
var
flux
=
(
ysize
-
mousePos
.
y
-
pady
)
*
dflux_dy
+
y0
;
//https://en.wikipedia.org/wiki/AB_magnitude
var
Jy
=
3.34e4
*
(
lobs
*
lobs
)
*
flux
*
1
e
-
17
;
var
AB
=
-
2.5
*
Math
.
log10
(
Jy
/
3631
.);
var
lrest
=
lobs
/
(
znow
+
1
.);
var
str
=
sprintf
(
"
(%s,%s,F%s)=(%.2f%s, %.2f%s, %.2f%s)
"
,
var
str
=
sprintf
(
"
(%s,%s,F%s
,AB
)=(%.2f%s, %.2f%s, %.2f%s
, %.2f
)
"
,
String
.
fromCharCode
(
955
,
8338
),
String
.
fromCharCode
(
955
,
7523
),
String
.
fromCharCode
(
955
),
lobs
,
String
.
fromCharCode
(
8491
),
lrest
,
String
.
fromCharCode
(
8491
),
flux
,
String
.
fromCharCode
(
215
)
+
"
10
"
+
String
.
fromCharCode
(
8315
,
185
,
8311
)
+
"
erg cm
"
+
String
.
fromCharCode
(
8315
,
178
)
+
"
s
"
+
String
.
fromCharCode
(
8315
,
185
)
+
"
"
+
String
.
fromCharCode
(
8491
,
8315
,
185
));
ctx
.
clearRect
(
xsize
-
4
4
.
*
padx2
,
ysize
-
0.6
*
pady
,
xsize
,
ysize
);
ctx
.
fillText
(
str
,
xsize
-
2
2
.
*
padx2
,
ysize
-
0.2
*
pady
);
String
.
fromCharCode
(
215
)
+
"
10
"
+
String
.
fromCharCode
(
8315
,
185
,
8311
)
+
"
erg cm
"
+
String
.
fromCharCode
(
8315
,
178
)
+
"
s
"
+
String
.
fromCharCode
(
8315
,
185
)
+
"
"
+
String
.
fromCharCode
(
8491
,
8315
,
185
)
,
AB
);
ctx
.
clearRect
(
xsize
-
4
7
.
*
padx2
,
ysize
-
0.6
*
pady
,
xsize
,
ysize
);
ctx
.
fillText
(
str
,
xsize
-
2
3
.
*
padx2
,
ysize
-
0.2
*
pady
);
}
}
else
...
...
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