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
1b4f46f9
Commit
1b4f46f9
authored
Jul 19, 2021
by
Tom Dwelly
Browse files
add thumbnails
parent
96c687e1
Changes
2
Hide whitespace changes
Inline
Side-by-side
js/speccy.js
View file @
1b4f46f9
...
...
@@ -90,6 +90,9 @@ var prev_x1;
var
prev_y0
;
var
prev_y1
;
var
stamp_numpix
=
80
;
var
stamp_scale
=
0.2
;
var
mousePos_old
;
var
leftclick
=
0
,
middleclick
=
1
,
rightclick
=
2
;
var
nkeys
=
0
;
...
...
@@ -166,6 +169,8 @@ linelist.push( {name:"CaII " , lambda: 8664.52 , emmabs:"Abs."
writeLineListTable
(
linelist
);
canvas
.
oncontextmenu
=
function
()
{
return
false
;
}
...
...
@@ -411,6 +416,7 @@ function readSpecFileASCII()
plotData
();
writePipeInfo
();
setupStamps
(
keyvals
[
keynames
.
indexOf
(
"
PLUG_RA
"
)],
keyvals
[
keynames
.
indexOf
(
"
PLUG_DEC
"
)]);
}
});
...
...
@@ -1434,4 +1440,42 @@ function convertMJDtoDate(mjd) {
return
new
Date
((
Number
(
mjd
)
+
MJD_TO_JD
-
UNIX_EPOCH_JULIAN_DATE
)
*
DAY_IN_MS
);
};
function
zoomStamps
(
inout
){
if
(
inout
==
"
in
"
)
{
stamp_numpix
=
stamp_numpix
*
0.8
;
}
else
if
(
inout
==
"
out
"
)
{
stamp_numpix
=
stamp_numpix
*
1.25
;
}
setupStamps
(
keyvals
[
keynames
.
indexOf
(
"
PLUG_RA
"
)],
keyvals
[
keynames
.
indexOf
(
"
PLUG_DEC
"
)]);
}
function
setupStamps
(
ra
,
dec
){
var
_url_img_format
=
'
http://www.legacysurvey.org/viewer/jpeg-cutout/?ra=${ra}&dec=${dec}&pixscale=${scale}&layer=${layer}&size=${numpix}
'
;
var
_url_link_format
=
'
http://www.legacysurvey.org/viewer?ra=${ra}&dec=${dec}&layer=${layer}&mark=${ra},${dec}&zoom=18
'
;
var
_inner_format
=
"
<a href='${url_link}'><img class='picture' title='${title}' src='${url_img}' width='150px'></a>
"
;
var
td
=
document
.
getElementById
(
"
thumb_panel_info
"
);
td
.
innerHTML
=
"
Image size:<br>
"
+
(
Math
.
floor
(
stamp_numpix
)
*
stamp_scale
).
toFixed
(
1
)
+
"
arcsec
"
;
var
layers
=
[
"
galex
"
,
"
sdssco
"
,
"
ls-dr9
"
,
"
hsc2
"
,
"
unwise-neo6
"
,
"
vlass
"
];
for
(
l
=
0
;
l
<
layers
.
length
;
l
++
){
var
layer
=
layers
[
l
];
var
td
=
document
.
getElementById
(
"
thumb_panel_
"
+
layer
);
var
_url_img
=
_url_img_format
.
replace
(
/
\$
{ra}/g
,
ra
);
_url_img
=
_url_img
.
replace
(
/
\$
{dec}/g
,
dec
);
_url_img
=
_url_img
.
replace
(
/
\$
{layer}/g
,
layer
);
_url_img
=
_url_img
.
replace
(
/
\$
{scale}/g
,
stamp_scale
);
_url_img
=
_url_img
.
replace
(
/
\$
{numpix}/g
,
Math
.
floor
(
stamp_numpix
));
var
_url_link
=
_url_link_format
.
replace
(
/
\$
{ra}/g
,
ra
);
_url_link
=
_url_link
.
replace
(
/
\$
{dec}/g
,
dec
);
_url_link
=
_url_link
.
replace
(
/
\$
{layer}/g
,
layer
);
var
_inner
=
_inner_format
.
replace
(
/
\$
{title}/g
,
'
Cutout:
'
+
layer
);
_inner
=
_inner
.
replace
(
/
\$
{url_img}/g
,
_url_img
);
_inner
=
_inner
.
replace
(
/
\$
{url_link}/g
,
_url_link
);
td
.
innerHTML
=
_inner
;
}
}
speccy.html
View file @
1b4f46f9
...
...
@@ -309,6 +309,35 @@
<input
type=
"hidden"
onclick=
"submitVIinfo()"
value=
"Submit Inspection Results"
id=
"submitButton"
title=
"Submit your visual inspection results to the server"
/>
</td>
</tr>
<tr>
<td
colspan=
"5"
>
<table>
<tr>
<td>
Cutouts
</td>
<td>
GALEX
</td>
<td>
SDSS gri
</td>
<td>
ls dr9 grz
</td>
<td>
HSC dr2 gri
</td>
<td>
unWISE W1W2
</td>
<td>
VLASS 1.4GHz
</td>
<td>
Zoom
</td>
</tr>
<tr>
<td
id=
"thumb_panel_info"
style=
"min-width:50px"
></td>
<td
id=
"thumb_panel_galex"
style=
"min-width:50px"
></td>
<td
id=
"thumb_panel_sdssco"
style=
"min-width:50px"
></td>
<td
id=
"thumb_panel_ls-dr9"
style=
"min-width:50px"
></td>
<td
id=
"thumb_panel_hsc2"
style=
"min-width:50px"
></td>
<td
id=
"thumb_panel_unwise-neo6"
style=
"min-width:50px"
></td>
<td
id=
"thumb_panel_vlass"
style=
"min-width:50px"
></td>
<td
id=
"thumb_panel_zoom"
style=
"min-width:50px"
>
<input
type=
"button"
onclick=
"zoomStamps('in')"
value=
"Zoom in"
/>
<input
type=
"button"
onclick=
"zoomStamps('out')"
value=
"Zoom out"
/>
</td>
</tr>
</table>
</td>
</tr>
</table>
<p
id=
"inspectInBrowser"
></p>
...
...
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