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

179 lines
6.7 KiB
HTML

{% extends "base.html" %}
{% load heasarc_templates %}
{% block content %}
<a class="btn btn-success" role="button" href="{% url 'art-xc survey index' %}">ART-XC Survey</a>
<a class="btn btn-success" role="button" href="{% url 'srg data dumps' %}">Daily data dumps</a>
<a class="btn btn-success" role="button" href="{% url 'show sky map form' %}">Show SkyMap</a>
{% if ddumps %}
<table class="table">
<thead>
<tr>
<th class="th-sm">Name</th>
<th class="th-sm">Date</th>
<th class="th-sm">Sources</th>
<th class="th-sm">Plates</th>
<th class="th-sm"></th>
</tr>
</thead>
<tbody>
{% for dump in ddumps %}
<tr>
<td>
<a href="{{ dump.get_absolute_url }}"><b>{{ dump.name }}</b></a>
</td>
<td>{{ dump.date|date:"d M Y H:i:s" }}</b></td>
<td>{{ dump.skymapsource_set.count }}</td>
<td>{{ dump.skymap.count }}</td>
<td>
{% if user.is_authenticated and user|has_group:"srg-iki-admin" %}
{% if dump.catalog_loaded %}<a class="btn btn-danger btn-size-xs" role="button" href="{{ dump.get_update_catalog_url }}">Reload catalog</a>
{% endif %}
{% endif %}
{% if not dump.catalog_loaded %}<b>In progress</b>{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
</tfoot>
</table>
{% endif %}
{% if dump %}
<table class="table">
<thead>
<tr>
<th class="th-sm">Name</th>
<th class="th-sm">Date</th>
<th class="th-sm">Survey</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="{{ dump.get_absolute_url }}"><b>{{ dump.name }}</b></a>
</td>
<td>{{ dump.date|date:"d M Y H:i:s" }}</b></td>
<td><a href="{{ survey.get_absolute_url }}">{{ survey }}</a></td>
</tr>
</tbody>
<tfoot>
</tfoot>
</table>
<!-- 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("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("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: 'showTable'}));
var cat0 = A.catalog({shape: 'square', name: 'SkyMaps plates', color: 'green', sourceSize: 10, displayLabel: false,onClick: 'showPopup'});
{% for skymap in dump.skymap.all %}
cat0.addSources(A.source({{ skymap.RA_CEN|safe }}, {{ skymap.DE_CEN|safe }}, {Plate: '<a href="/srgcat/{{ dump.pk }}/{{ skymap.pk }}/skymap">{{ skymap }}', RA: '{{ skymap.RA_CEN|floatformat:4 }}', Dec: '{{ skymap.DE_CEN|floatformat:4 }}', Dump: '<a href="{{ dump.get_absolute_url }}">{{ dump }}</a>',}));
{% endfor %}
aladin.addCatalog(cat0);
var cat1 = A.catalog({shape: 'circle', name: 'Survey Path', color: 'white', sourceSize: 10, displayLabel: false,onClick: 'showTable'});
{% if surveypaths %}
var overlay = A.graphicOverlay({color: '#ee2345', lineWidth: 1});
aladin.addOverlay(overlay);
var poly_ra = [];
var poly_dec = [];
{% for path in surveypaths %}
poly_ra.push({{ path.ra|safe }})
poly_dec.push({{ path.dec|safe }})
{% endfor %}
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]], ]));
}
{% for path in surveypaths %}
{% with next_element=surveypaths|next:forloop.counter0 %}
{% with previous_element=surveypaths|previous:forloop.counter0 %}
cat1.addSources(A.source({{ path.ra|safe }}, {{ path.dec|safe }},
{obsid: '{{ path.survey.experiment }}',
eroday: '{{ path.eroday|floatformat:4 }}',
RA: '{{ path.ra|floatformat:4 }}',Dec: '{{ path.dec|floatformat:4 }}',}));
{% if next_element %}
{% endif %}
{% endwith %}
{% endwith %}
{% endfor %}
{% endif %}
aladin.addCatalog(cat1);
cat1.hide()
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 %}