Commit bd70af5b authored by Tom Dwelly's avatar Tom Dwelly
Browse files

interface tweaks, back end refactoring

parent 275f199f
......@@ -1179,11 +1179,6 @@ function submitVIinfo(){
function writeVIinfo(){
var outbox = document.getElementById("resultBox");
var str = "";
var plate = "-";
var mjd = "-";
var fiberid = "-";
var ra = "-";
var dec = "-";
var z_conf_person = $("input[type='radio'][name='z_conf_person']:checked").val();
var class_person = $("input[type='radio'][name='class_person']:checked").val();
var issue = document.getElementById("issueSelect").value;
......@@ -1192,33 +1187,24 @@ function writeVIinfo(){
var is_interesting = $('#isInteresting').is(":checked");
var str_is_blagn = "";
var str_is_interesting = "";
var field = -1; // new for SDSS-V
var designid = 0;
var catalogid = 0;
// console.log(is_blagn);
// console.log(is_interesting);
var plate = keyvals[keynames.indexOf("PLATE")] || 'NaN';
var field = keyvals[keynames.indexOf("FIELD")] || 'NaN';
var mjd = keyvals[keynames.indexOf("MJD")] || 'NaN';
var fiberid = keyvals[keynames.indexOf("FIBERID")] || 'NaN';
var ra = keyvals[keynames.indexOf("PLUG_RA")] || 'NaN';
var dec = keyvals[keynames.indexOf("PLUG_DEC")] || 'NaN';
var zpipe = keyvals[keynames.indexOf("Z")] || 'NaN';
var catalogid = keyvals[keynames.indexOf("CATALOGID")] || 'NaN';
var field = keyvals[keynames.indexOf("FIELD")] || 'NaN';
var designid = keyvals[keynames.indexOf("DESIGNID")] || 'NaN';
for(var i=0;i<nkeys;i++)
{
switch (keynames[i]) {
case "PLATE": plate = keyvals[i]; break;
case "MJD": mjd = keyvals[i]; break;
case "FIBERID": fiberid = keyvals[i]; break;
case "PLUG_RA": ra = keyvals[i]; break;
case "PLUG_DEC": dec = keyvals[i]; break;
case "Z": zpipe = keyvals[i]; break;
case "CATALOGID": catalogid = keyvals[i]; break;
case "FIELD": field = keyvals[i]; break;
case "DESIGNID": designid = keyvals[i]; break;
}
}
if ( is_blagn == true ) { str_is_blagn = " BLAGN!";}
if ( is_interesting == true ) { str_is_interesting = " Interesting!";}
str = sprintf("SDSSOBJECT %5d %5d %4d %12.7f %12.7f %10s %.7g %3s \"%8s\" \"%s\" \"%s\"%s%s\n %011d %d %d ",
str = sprintf("SDSSOBJECT %5d %5d %4d %12.7f %12.7f %10s %.7g %3s \"%8s\" \"%s\" \"%s\" %011d %d %d %s%s\n",
plate, mjd, fiberid, ra, dec, zpipe, znow, z_conf_person,
class_person, issue, comments, str_is_blagn, str_is_interesting,
catalogid, field, designid);
class_person, issue, comments,
catalogid, field, designid,
str_is_blagn, str_is_interesting);
outbox.value = str;
}
......@@ -1227,53 +1213,51 @@ function precise(val, n=5) {
}
function writePipeInfo(){
var ra = -99.9;
var dec = -99.9;
for(var i=0;i<nkeys;i++)
{
switch (keynames[i]) {
case "PLATE": if (mode == "SDSS4") { document.getElementById("pipeParams_PLATE" ).innerHTML = keyvals[i];} break;
case "MJD":
var el = document.getElementById("pipeParams_MJD");
el.innerHTML = keyvals[i];
el.title = convertMJDtoDate(keyvals[i]).toISOString().split('T')[0];
break;
case "FIBERID": if (mode == "SDSS4") { document.getElementById("pipeParams_FIBERID" ).innerHTML = keyvals[i];} break;
case "RUN2D": document.getElementById("pipeParams_RUN2D" ).innerHTML = keyvals[i]; break;
case "PLUG_RA": ra = Number.parseFloat(keyvals[i]); document.getElementById("pipeParams_PLUG_RA" ).innerHTML = ra.toFixed(7); break;
case "PLUG_DEC": dec = Number.parseFloat(keyvals[i]); document.getElementById("pipeParams_PLUG_DEC" ).innerHTML = dec.toFixed(6); break;
case "Z": document.getElementById("pipeParams_Z" ).innerHTML = precise(keyvals[i],7); break;
case "Z_ERR": document.getElementById("pipeParams_Z_ERR" ).innerHTML = precise(keyvals[i],3); break;
case "CLASS": document.getElementById("pipeParams_CLASS" ).innerHTML = keyvals[i]; break;
case "SUBCLASS": document.getElementById("pipeParams_SUBCLASS" ).innerHTML = keyvals[i]; break;
case "SN_MEDIAN_ALL": document.getElementById("pipeParams_SN_MEDIAN_ALL").innerHTML = precise(keyvals[i],4); break;
case "ZWARNING":
var str = sprintf("<a href='../bitmask_decoder/sdss_bitmask_decoder.html?ZWARNING=%s' target=_blank title='decode the ZWARNING flag'>%s</a>",
keyvals[i],keyvals[i]);
document.getElementById("pipeParams_ZWARNING" ).innerHTML = str; break;
case "EBOSS_TARGET1":
if (mode == "SDSS4") {
var str = sprintf("<a href='../bitmask_decoder/sdss_bitmask_decoder.html?EBOSS_TARGET1=%s' target=_blank title='decode the EBOSS_TARGET1 flag'>%s</a>",
keyvals[i],keyvals[i]);
document.getElementById("pipeParams_TARGET_BITMASK" ).innerHTML = str;
} break;
case "SDSSV_BOSS_TARGET0":
if (mode == "SDSS5") {
var str = sprintf("<a href='../bitmask_decoder/sdss_bitmask_decoder.html?SDSSV_BOSS_TARGET0=%s' target=_blank title='decode the SDSSV_BOSS_TARGET0 flag'>%s</a>",
keyvals[i],keyvals[i]);
document.getElementById("pipeParams_TARGET_BITMASK" ).innerHTML = str;
} break;
case "CATALOGID": if (mode == "SDSS5") {document.getElementById("pipeParams_FIBERID").innerHTML = keyvals[i]}; break;
case "FIELD": if (mode == "SDSS5") {document.getElementById("pipeParams_PLATE").innerHTML = keyvals[i]}; break;
}
}
var ra = Number.parseFloat(keyvals[keynames.indexOf("PLUG_RA")]) || 'NaN';
var dec = Number.parseFloat(keyvals[keynames.indexOf("PLUG_DEC")]) || 'NaN';
var el = document.getElementById("pipeParams_PLATE");
if (mode == "SDSS4") { el.innerHTML = keyvals[keynames.indexOf("PLATE")] || 'NaN';}
if (mode == "SDSS5") { el.innerHTML = keyvals[keynames.indexOf("FIELD")] || 'NaN';}
var el = document.getElementById("pipeParams_FIBERID");
if (mode == "SDSS4") { el.innerHTML = keyvals[keynames.indexOf("FIBERID")] || 'NaN';}
if (mode == "SDSS5") { el.innerHTML = keyvals[keynames.indexOf("CATALOGID")] || 'NaN';}
document.getElementById("pipeParams_RUN2D").innerHTML = keyvals[keynames.indexOf("RUN2D")] || 'NaN';
document.getElementById("pipeParams_PLUG_RA").innerHTML = ra.toFixed(7);
document.getElementById("pipeParams_PLUG_DEC").innerHTML = dec.toFixed(6);
document.getElementById("pipeParams_Z").innerHTML = precise(keyvals[keynames.indexOf("Z")],7) || 'NaN';
document.getElementById("pipeParams_Z_ERR").innerHTML = precise(keyvals[keynames.indexOf("Z_ERR")],3) || 'NaN';
document.getElementById("pipeParams_CLASS").innerHTML = keyvals[keynames.indexOf("CLASS")] || 'NaN';
document.getElementById("pipeParams_SUBCLASS").innerHTML = keyvals[keynames.indexOf("SUBCLASS")] || '';
document.getElementById("pipeParams_SN_MEDIAN_ALL").innerHTML = precise(keyvals[keynames.indexOf("SN_MEDIAN_ALL")],4) || 'NaN';
var el = document.getElementById("pipeParams_MJD");
var mjd = keyvals[keynames.indexOf("MJD")] || 'NaN';
el.innerHTML = mjd;
el.title = convertMJDtoDate(mjd).toISOString().split('T')[0];
var zwarning = keyvals[keynames.indexOf("ZWARNING")] || 'NaN';
document.getElementById("pipeParams_ZWARNING").innerHTML =
sprintf("<a href='../bitmask_decoder/sdss_bitmask_decoder.html?ZWARNING=%s' target=_blank title='decode the ZWARNING flag'>%s</a>", zwarning, zwarning);
var el = document.getElementById("pipeParams_TARGET_BITMASK");
if (mode == "SDSS4") {
var bitmask = keyvals[keynames.indexOf("EBOSS_TARGET1")] || 'NaN';
el.innerHTML = sprintf("<a href='../bitmask_decoder/sdss_bitmask_decoder.html?EBOSS_TARGET1=%s' target=_blank title='decode the EBOSS_TARGET1 flag'>%s</a>",
bitmask, bitmask);
};
if (mode == "SDSS5") {
var bitmask = keyvals[keynames.indexOf("SDSSV_BOSS_TARGET0")] || 'NaN';
el.innerHTML = sprintf("<a href='../bitmask_decoder/sdss_bitmask_decoder.html?SDSSV_BOSS_TARGET0=%s' target=_blank title='decode the SDSSV_BOSS_TARGET0 flag'>%s</a>",
bitmask, bitmask);
};
var str = "";
if ( ra > -99. && dec > -99.) {
var str1 = sprintf("<a href='http://skyserver.sdss.org/dr16/en/tools/explore/summary.aspx?ra=%g&dec=%g' target='_blank' title='View imaging for this object in the SDSS Explore service'>Explore</a>", ra, dec);
// var str2 = sprintf("<a href='http://irsa.ipac.caltech.edu/applications/finderchart/#id=Hydra_finderchart_finder_chart&RequestClass=ServerRequest&DoSearch=true&subsize=0.0166667&thumbnail_size=medium&sources=DSS,SDSS,twomass,WISE&UserTargetWorldPt=%s;%s;EQ_J2000&SimpleTargetPanel.field.resolvedBy=nedthensimbad&projectId=finderchart&searchName=finder_chart&isDrillDownRoot=true&isSearchResult=true' target='_blank' title='View imaging for this object in the IRSA Hydra finder chart service'>IRSA</a>", ra, dec);
var str2 = sprintf("<a href='http://simbad.u-strasbg.fr/simbad/sim-coo?output.format=HTML&Coord=%s+%s&Radius=10&Radius.unit=arcsec' target='_blank' title='Search around this position in the Simbad service'>Simbad</a>", ra, dec);
// var str3 = sprintf("<a href='http://legacysurvey.org/viewer/?ra=%g&dec=%g&zoom=16&layer=ls-dr8&mark=%g,%g' target='_blank' title='View optical imaging for this object on the legacysurvey.org site'>ls-dr8</a>", ra, dec, ra, dec);
var str3 = sprintf("<a href='http://legacysurvey.org/viewer/?ra=%g&dec=%g&zoom=16&layer=ls-dr9&mark=%g,%g' target='_blank' title='View optical imaging for this object on the legacysurvey.org site'>ls-dr9</a>", ra, dec, ra, dec);
var str4 = sprintf("<a href='http://legacysurvey.org/viewer/?ra=%g&dec=%g&zoom=16&layer=unwise-neo6&mark=%g,%g' target='_blank' title='View unWISE imaging for this object on the legacysurvey.org site'>unWISE</a>", ra, dec, ra, dec);
var str5 = sprintf("<a href='http://vizier.u-strasbg.fr/viz-bin/VizieR-5?-ref=VIZ60fed5911f70ac&-out.add=.&-source=I/350/gaiaedr3&-c=%.8g%20%s%.8g,eq=ICRS,rs=3&-out.orig=o' target='_blank' title='Search for nearest Gaia EDR3 catalogue entry to this location (within 3arcsec)'>GaiaEDR3</a>", ra, (dec<0.0?"":"+"),dec);
......@@ -1313,6 +1297,10 @@ function smoothArray(original, smoothed, boxsize)
}
}
function scaleModel(factor){
renorm *= factor;
plotData();
}
//deal with key presses
canvas.addEventListener('keydown',doKeyDown,true);
......@@ -1321,12 +1309,10 @@ function doKeyDown(evt){
// console.log(evt.keyCode);
switch (evt.keyCode) {
case 38: /* Up arrow was pressed */
renorm *= drenorm;
plotData();
scaleModel(drenorm);
break;
case 40: /* Down arrow was pressed */
renorm /= drenorm;
plotData();
scaleModel(1./drenorm);
break;
case 37: /* Left arrow was pressed */
decrementRedshift(dznow_fine);
......
......@@ -117,13 +117,13 @@
</td>
<td rowspan="1">
Zoom: Out:
<input type="button" onclick="applyZoom(1.25,1.00)" value="X" title="zoom outwards in X">
<input type="button" onclick="applyZoom(1.00,1.25)" value="Y" title="zoom outwards in Y">
<input type="button" onclick="applyZoom(1.25,1.25)" value="X+Y" title="zoom outwards in X and Y">
<input type="button" onclick="applyZoom(1.25,1.00)" value="X" style="min-width:2em;" title="zoom outwards in X">
<input type="button" onclick="applyZoom(1.00,1.25)" value="Y" style="min-width:2em;" title="zoom outwards in Y">
<input type="button" onclick="applyZoom(1.25,1.25)" value="X+Y" style="min-width:2em;" title="zoom outwards in X and Y">
In:
<input type="button" onclick="applyZoom(0.80,1.00)" value="X" title="zoom inwards in X">
<input type="button" onclick="applyZoom(1.00,0.80)" value="Y" title="zoom inwards in Y">
<input type="button" onclick="applyZoom(0.80,0.80)" value="X+Y" title="zoom inwards in X and Y">
<input type="button" onclick="applyZoom(0.80,1.00)" value="X" style="min-width:2em;" title="zoom inwards in X">
<input type="button" onclick="applyZoom(1.00,0.80)" value="Y" style="min-width:2em;" title="zoom inwards in Y">
<input type="button" onclick="applyZoom(0.80,0.80)" value="X+Y" style="min-width:2em;" title="zoom inwards in X and Y">
<br>
<input type="button" onclick="previousZoom()" value="Previous view">
<input type="button" onclick="resetZoom()" value="Reset view">
......@@ -142,14 +142,14 @@
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adjust redshift:
<input type="button" onclick="decrementRedshift(dznow_vcoarse)" value="<<<" title="large decrement">
<input type="button" onclick="decrementRedshift(dznow_coarse)" value="<<" title="coarse decrement">
<input type="button" onclick="decrementRedshift(dznow_fine)" value="<" title="fine decrement">
<input type="button" onclick="incrementRedshift(dznow_fine)" value=">" title="fine increment">
<input type="button" onclick="decrementRedshift(dznow_fine)" value="<" style="min-width:2em;" title="fine decrement">
<input type="button" onclick="incrementRedshift(dznow_fine)" value=">" style="min-width:2em;" title="fine increment">
<input type="button" onclick="incrementRedshift(dznow_coarse)" value=">>" title="coarse increment">
<input type="button" onclick="incrementRedshift(dznow_vcoarse)" value=">>>" title="large increment">
</td>
<td rowspan="2">
Scroll window:
<table style="float:right;">
<span style="float:left; margin-right:20px;"> Scroll<br>window</span>
<table style="float:left;">
<tr>
<td><input type="button" onclick="applyOffset(-0.2,+0.1)" value="&#8598;" title="Scroll view up and left"></td>
<td><input type="button" onclick="applyOffset(+0.0,+0.1)" value="&#8593;" title="Scroll view up"></td>
......@@ -217,6 +217,10 @@
</select>
URL:
<input id="templateURL" type="text" value="" onchange="changeTemplate();" size="70" title="URL of template file" />
<span style="float:right;margin-right:2em;"> rescale model:
<input type="button" onclick="scaleModel(1.01)" value="^" title="Increase model normalisation">
<input type="button" onclick="scaleModel(0.99)" value="v" title="Decrease model normalisation">
</span>
</td>
</tr>
......@@ -246,7 +250,8 @@
<span style="color: #008800;">Lines</span></label>
<label><input type="checkbox" onclick="plotData();" value="ToggleSky" id="ToggleSky" >
<span style="color: #00dddd;">Sky</span>&nbsp;&#215;</label>
<input id="skyMult" type="text" value="0.05" onchange="plotData();" size="5" width="6" title="Sky flux multiplier">
<input id="skyMult" type="number" value="0.05" min="-99" max="99" step="0.01" onchange="plotData();" size="4" width="3" title="Sky flux multiplier">
<label><input type="checkbox" onclick="plotData();" value="ToggleTrans" id="ToggleTrans" title="Show a generic model of the sky transmission vector (ESO skycalc, AM=1.3, Paranal)">
<span style="color: #0000aa;">Sky Trans.</span></label>
</td>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment