srg/Templates/monthplan/show_monthplan_aladin.html
2024-06-05 11:33:02 +03:00

103 lines
5.1 KiB
HTML

{% extends "monthplan/base.html" %}
{% load monthplan_templates %}
{% block content %}
<!-- insert this snippet where you want Aladin Lite viewer to appear and after the loading of jQuery -->
<div id="aladin-lite-div" style="width:800px;height:800px;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">
/* survey: "P/DSS2/color", */
var aladin = A.aladin('#aladin-lite-div', {
cooFrame: "GAL",
survey: "P/DSS2/color",
fov: 197, target: "0. 0.",
showShareControl: true,
showCooGrid: false});
/*
see http://aladin.u-strasbg.fr/hips/list for more
*/
aladin.createImageSurvey("DIRBE_4","DIRBE_4", "http://cade.irap.omp.eu/documents/Ancillary/4Aladin/DIRBE_4",'galactic',8, {imgFormat: 'jpg'});
/* aladin.createImageSurvey("XMMrgb","XMMrgb", "http://skies.esac.esa.int/XMM-Newton/EPIC-RGB",'equatorial',8, {imgFormat: 'jpg'}) */
aladin.getBaseImageLayer().getColorMap().update('rainbow');
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("DIRBE_4");
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 cat1 = A.catalog({shape: 'circle', name: 'SRG Targets', color: 'white', sourceSize: 30, displayLabel: true, labelColumn: "name",onClick: 'showPopup'});
{% if observations %}
{% for obs in observations %}
{% if obs.ra_obj > 0.0 %}
cat1.addSources(A.source({{ obs.ra_obj|safe }}, {{ obs.dec_obj|safe }}, {obsid: '<a href="{{ obs.get_absolute_url }}">{{ obs.experiment }}</a>', name: '{{ obs.target }}', info: '{{ obs.target }}'}));
{% endif %}
{% endfor %}
{% endif %}
var cat2 = A.catalog({shape: 'cross', name: 'SRG Offsets', color: 'green', sourceSize: 15, displayLabel:true, labelColumn: "name",onClick: 'showPopup'});
{% if observations %}
{% for obs in observations %}
cat2.addSources(A.source({{ obs.ra|safe }}, {{ obs.dec|safe }}, {name: ' Offset', info: '{{ obs.target }}'}));
{% endfor %}
{% endif %}
aladin.addCatalog(cat2);
aladin.addCatalog(cat1);
var cat3 = A.catalog({shape: 'circle', name: 'Survey Path', color: 'white', sourceSize: 10, displayLabel: false,onClick: 'showPopup'});
{% if surveypaths %}
var overlay = A.graphicOverlay({color: '#ee2345', lineWidth: 1});
aladin.addOverlay(overlay);
{% for path in surveypaths %}
{% with next_element=surveypaths|next:forloop.counter0 %}
{% with previous_element=surveypaths|previous:forloop.counter0 %}
cat3.addSources(A.source({{ path.ra|safe }}, {{ path.dec|safe }},
{obsid: '{{ path.survey.experiment }}',
eroday: '{{ path.eroday|floatformat:4 }}',date: '{{ path.dtime|date:"d.m.y H:i" }}',
RA: '{{ path.ra|floatformat:3 }}',Dec: '{{ path.dec|floatformat:3 }}', Roll: '{{ path.roll|floatformat:3 }}',}));
{% if next_element %}
overlay.add(A.polyline([ [{{ path.ra|safe }}, {{ path.dec|safe }}], [{{ next_element.ra|safe }}, {{ next_element.dec|safe }}], ]));
{% endif %}
{% endwith %}
{% endwith %}
{% endfor %}
{% endif %}
aladin.addCatalog(cat3);
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>
{% endblock %}