149 lines
7.1 KiB
HTML
149 lines
7.1 KiB
HTML
|
|
{% extends "base.html" %}
|
|
{% load heasarc_templates %}
|
|
|
|
{% block header %}{% endblock %}
|
|
|
|
{% block content %}
|
|
<h2>Lookup target position during SRG survey</h2>
|
|
<form action="/target/" method="post">
|
|
{% csrf_token %}
|
|
{{ form }}
|
|
<input type="submit" value="Submit">
|
|
</form>
|
|
|
|
{% if plate %}<!--h3>{{ plate }}</h3-->
|
|
<!--h4>SkyMap: {% for skymap in plate.skymaps_set.all %}<a href="{{ skymap.get_absolute_url }}">{{ skymap }}</a> {% endfor %}</h4-->
|
|
<h4>SkyMap (offset in arcmin): {% for skymap in skymaps %}<a href="/srgcat/{{ skymap.pk }}/skymap_radec/{{ form.ra.value }}/{{ form.dec.value }}/">{{ skymap }} ({{ skymap.separation|floatformat:1 }})</a> {% endfor %}</h4>
|
|
|
|
{% endif %}
|
|
|
|
|
|
<table class="table table-hover">
|
|
{% if surveys %}
|
|
<thead>
|
|
<tr><th scope="col" colspan="4">List of close SRG passages</th></tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for survey in surveys %}
|
|
<tr class="{% if survey.is_past_due %}bg-success{% endif %}{% if survey.is_future %} bg-info{% endif %}{% if survey.is_current %} bg-danger{% endif %}">
|
|
<td><span class="glyphicon glyphicon-repeat"></span></td>
|
|
<td>{{ survey.start|date:"d M Y H:i" }}</td>
|
|
<td>{{ survey.stop|date:"d M Y H:i" }}</td>
|
|
<td><a href="{{ survey.get_absolute_url }}">{{ survey.experiment }}</a></td>
|
|
<td>{% if user.is_authenticated %}<a href="{{ survey.head.get_absolute_url }}">{{ survey.head.get_datetime_middle|date:"F Y" }}</a>{% endif %}</td>
|
|
<td></td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
{% endif %}
|
|
</table>
|
|
|
|
|
|
{% if surveys and load_surveypath %}
|
|
|
|
|
|
<!-- insert this snippet where you want Aladin Lite viewer to appear and after the loading of jQuery -->
|
|
<div id="aladin-lite-div" style="width:1000px;height:600px;align=center"></div>
|
|
<!--input id="allwise" type="radio" name="survey" value="P/allWISE/color"><label for="allwise">AllWISE<label-->
|
|
<script type="text/javascript" src="//aladin.u-strasbg.fr/AladinLite/api/v2/latest/aladin.min.js" charset="utf-8"></script>
|
|
|
|
<script type="text/javascript">
|
|
|
|
function getRandomColor() {
|
|
var letters = '0123456789ABCDEF';
|
|
var color = '#';
|
|
for (var i = 0; i < 6; i++) {
|
|
color += letters[Math.floor(Math.random() * 16)];
|
|
}
|
|
return color;
|
|
}
|
|
|
|
/* survey: "P/DSS2/color", */
|
|
var aladin = A.aladin('#aladin-lite-div', {
|
|
cooFrame: "J2000d",
|
|
survey: "P/DSS2/color",
|
|
fov: 4, target: "{{ ra_cen }} {{ dec_cen }}",
|
|
showShareControl: true,
|
|
showCooGrid: false});
|
|
aladin.createImageSurvey("DIRBE_4","DIRBE_4", "http://cade.irap.omp.eu/documents/Ancillary/4Aladin/DIRBE_4",'galactic',8, {imgFormat: 'jpg'});
|
|
aladin.getBaseImageLayer().getColorMap().update('rainbow');
|
|
aladin.createImageSurvey("INTEGRAL_14y_17_60", "INTEGRAL_14y_17_60", "http://cade.irap.omp.eu/documents/Ancillary/4Aladin/INTEGRAL_14y_17_60/", 'galactic', 3)
|
|
aladin.createImageSurvey("RASS-soft", "RASS-soft", "http://cade.irap.omp.eu/documents/Ancillary/4Aladin/RASS_IM3", 'galactic', 12, {imgFormat: 'jpg'})
|
|
aladin.setImageSurvey(aladin.createImageSurvey("RASS", "RASS", "http://alasky.u-strasbg.fr/RASS", 'equatorial', 12, {imgFormat: 'jpg'}));
|
|
aladin.getBaseImageLayer().getColorMap().update('cubehelix');
|
|
aladin.getBaseImageLayer().getColorMap().reverse('true');
|
|
aladin.setImageSurvey(aladin.createImageSurvey("LAB-NH", "LAB-NH", "http://cade.irap.omp.eu/documents/Ancillary/4Aladin/LAB_NH", 'galactic', 12, {imgFormat: 'jpg'}));
|
|
aladin.setOverlayImageLayer(aladin.createImageSurvey("Planck-HFI", "Planck-HFI", "http://alasky.u-strasbg.fr/PLANCK/R2/HFI_Color_353_545_857", 'galactic', 12, {imgFormat: 'jpg'}));
|
|
aladin.getOverlayImageLayer().setAlpha(0.35);
|
|
aladin.getOverlayImageLayer().getColorMap().reverse('true');
|
|
|
|
aladin.setImageSurvey("P/DSS2/color");
|
|
aladin.setOverlayImageLayer("");
|
|
|
|
aladin.addCatalog(A.catalogFromURL('http://193.232.10.38/static/aladin/pvlabs.vot',
|
|
{name: 'Labels', sourceSize:5, color: 'red', shape: 'circle',
|
|
raField: "col3", decField: "col4",
|
|
displayLabel: true,labelColumn: "col8", labelColor: "red", labelFont: "12px sans-serif",
|
|
onClick: 'showPopup'}));
|
|
|
|
var overlay = A.graphicOverlay({color: '#ee2345', lineWidth: 1});
|
|
aladin.addOverlay(overlay);
|
|
|
|
{% for survey in surveys %}
|
|
var col=getRandomColor();
|
|
var cat1 = A.catalog({shape: 'circle', name: 'Survey '+{{ survey.experiment }}, color: col, sourceSize: 10, displayLabel: false,onClick: 'showPopup'});
|
|
console.log({{ survey.experiment }});
|
|
var poly_ra = [];
|
|
var poly_dec = [];
|
|
{% for path in survey.get_path_filtered %}
|
|
poly_ra.push({{ path.ra|safe }})
|
|
poly_dec.push({{ path.dec|safe }})
|
|
|
|
cat1.addSources(A.source({{ path.ra|safe }}, {{ path.dec|safe }},
|
|
{obsid: '<a href={{ survey.get_absolute_url }}>{{ survey.experiment }}</a>',
|
|
eroday: '{{ path.eroday|floatformat:3 }}',start: '{{ survey.start|date:"d M Y H:i:s" }}',stop: '{{ survey.stop|date:"d M Y H:i:s" }}',
|
|
RA: '{{ path.ra|floatformat:3 }}',Dec: '{{ path.dec|floatformat:3 }}', Roll: '{{ path.roll|floatformat:3 }}',}));
|
|
|
|
{% endfor %}
|
|
aladin.addCatalog(cat1);
|
|
|
|
for (var i = 0; i < poly_ra.length-1; i++) {
|
|
overlay.add(A.polyline([ [poly_ra[i], poly_dec[i]], [poly_ra[i+1], poly_dec[i+1]], ]));
|
|
}
|
|
|
|
var cat2 = A.catalog({shape: 'circle', name: 'Healpix Plates {{ survey }}', color: 'green', sourceSize: 10, displayLabel: false,onClick: 'showPopup'});
|
|
var cat3 = A.catalog({shape: 'square', name: 'SkyMap Plates {{ survey }}', color: 'cyan', sourceSize: 10, displayLabel: false,onClick: 'showPopup'});
|
|
{% for plate in survey.surveyhealpixplate_set.all %}
|
|
|
|
cat2.addSources(A.source({{ plate.ra|safe }}, {{ plate.dec|safe }},
|
|
{RA: '{{ plate.ra|floatformat:3 }}',Dec: '{{ plate.dec|floatformat:3 }}', Healpix: '{{ plate.healpix }}',}));
|
|
|
|
{% for skymap in plate.skymaps_set.all %}
|
|
cat3.addSources(A.source({{ skymap.RA_CEN|safe }}, {{ skymap.DE_CEN|safe }}, {SkyMap: '<a href="{{ skymap.get_absolute_url }}">{{ skymap }}', RA: '{{ skymap.RA_CEN|floatformat:4 }}', Dec: '{{ skymap.DE_CEN|floatformat:4 }}',}));
|
|
{% endfor %}
|
|
{% endfor %}
|
|
cat2.hide()
|
|
aladin.addCatalog(cat2);
|
|
aladin.addCatalog(cat3);
|
|
|
|
|
|
{% endfor %}
|
|
|
|
|
|
overlay.add(A.circle({{ ra_cen }}, {{ dec_cen }}, 0.5, {color: 'cyan'}));
|
|
overlay.add(A.circle({{ ra_cen }}, {{ dec_cen }}, 0.3, {color: 'yellow'}));
|
|
overlay.add(A.circle({{ ra_cen }}, {{ dec_cen }}, 0.8, {color: 'white',}));
|
|
|
|
aladin.addCatalog(A.catalogFromURL('http://193.232.10.38/static/aladin/bound_radec.csv.xml',
|
|
{name: 'boundary', sourceSize:10, color: 'red', shape: 'cross' }));
|
|
|
|
var simbadhips = A.catalogHiPS('http://axel.u-strasbg.fr/HiPSCatService/Simbad', {color: "#2F4F4F", onClick: 'showPopup', name: 'Simbad'}, null, true);
|
|
aladin.addCatalog(simbadhips);
|
|
simbadhips.hide();
|
|
</script>
|
|
{% endif %}
|
|
|
|
{% endblock %}
|
|
|