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

228 lines
7.2 KiB
HTML

{% extends "artsurvey/base.html" %}
{% load heasarc_templates %}
{% load simbadescape %}
{% block header %}
<script>
var xhr = new XMLHttpRequest();
xhr.open("POST", "https://vizier.u-strasbg.fr/vizier/", true);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.send(JSON.stringify({
"keywordSearchPosition": "10.0 , 10.0"
}));
function ToggleWise() {
var x = document.getElementById("ToggleWise");
if (x.style.display === "none") {
x.style.display = "block";
} else {
x.style.display = "none";
}
}
</script>
<div class="container-fluid">
<div class="row">
<div class="col-sm-12">
<h3>
MetaSource <a href="{{ src.get_absolute_url }}">{{ src }}</a> {{ band }}</h3>
<big>
<p>Lookup radius = {{ src.radec_error|floatformat:1 }}''</p>
{% if src.catalog %}
<p>
Linked to <b>{{ src.catalog }}</b>
<a class="btn btn-danger btn-sm" role="button" href="{{ src.get_delete_paper_url }}"><span class="glyphicon glyphicon-remove"></span> Remove</a>
</p>
{% endif %}
</big>
<p>
{{ src.ra|floatformat:4 }}<sup>RA</sup> {{ src.dec|floatformat:4 }}<sup>Dec</sup> <a data-toggle="tooltip" data-placement="top" title="Lookup target position in survey" href="{% url 'target survey GET' %}?ra={{ src.ra|safe }}&dec={{ src.dec|safe }}"><span class="glyphicon glyphicon-flag"></span></a> |
<strong><a href=http://simbad.u-strasbg.fr/simbad/sim-coo?Coord={{src.ra|stringformat:"+.6f"}}{{src.dec|stringformat:"+.6f"|escape}}&CooFrame=FK5&CooEpoch=2000&CooEqui=2000&CooDefinedFrames=none&Radius=40&Radius.unit=arcsec&submit=submit+query&CoordList=>SIMBAD</a></strong> |
<strong><a href=https://ned.ipac.caltech.edu/conesearch?search_type=Near%20Position%20Search&coordinates={{src.ra|stringformat:"+.6f"|escape}}d,{{src.dec|stringformat:"+.6f"|escape}}d&radius=0.666667&in_csys=Equatorial&in_equinox=J2000&out_csys=Equatorial&out_equinox=Same%20as%20Input&hconst=67.8&omegam=0.308&omegav=0.692&wmap=4&corr_z=1&iau_style=liberal&in_csys_IAU=Equatorial&in_equinox_IAU=B1950&z_constraint=Unconstrained&z_unit=z&ot_include=ANY&nmp_op=ANY&out_csys_nearname=Equatorial&out_equinox_nearname=J2000&obj_sort=Distance%20to%20search%20center>NED</a></strong>
</p>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="card">
<div class="card-body">
<div class="alert alert-warning">
<p class="card-text">
<h3 class="card-title">Filter by energy band:
{% for band in bands %}
<a href="{{ src.get_absolute_url }}/{{ band.pk }}">{{ band }}</a> |
{% endfor %}
</h3>
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
{% block content %}
<div class="container-fluid">
<div class="col-sm-12">
<table class="table">
<thead>
<tr>
<th class="th-sm"></th>
<th class="th-sm">Name</th>
<th class="th-sm">Survey</th>
<th class="th-sm">RA</th>
<th class="th-sm">Dec</th>
<th class="th-sm">Band</th>
<th class="th-sm">Sep ('')</th>
<th class="th-sm">Flux</th>
<th class="th-sm">Error</th>
<th class="th-sm">Sign.</th>
<th class="th-sm">log_nFalse</th>
<th class="th-sm">Band</th>
<th class="th-sm">CNAME</th>
<th class="th-sm">Class</th>
<th class="th-sm">Catalog</th>
<th class="th-sm">Files</th>
<th class="th-sm">ADS</th>
<th class="th-sm">Notes</th>
<th class="th-sm">Modified</th>
</tr>
</thead>
<tbody>
{% for m in srcs %}
<tr>
<td>{{ forloop.counter }}</td>
<td>
<a href="{{ m.get_absolute_url }}">{{ m.name }}</a>
{% if m.metasource_primary %}<span title="Primary"><b>P</span></span>{% endif %}
</td>
<td>{{ m.survey }}</td>
<td>{{ m.ra|floatformat:5 }}</td>
<td>{{ m.dec|floatformat:5 }}</td>
<td>{{ m.band }}</td>
<td>{{ m.metasource_sep|floatformat:1 }}</td>
<td>{{ m.flux|stringformat:"1.2e" }}</td>
<td>{{ m.flux_err|stringformat:"1.2e" }}</td>
<td>{{ m.sig|floatformat:1 }}</td>
<td>{{ m.log_nfalse|floatformat:4 }}</td>
<td>{{ m.band }}</td>
<td>{% if m.cname %}{{ m.cname }}{% endif %}</td>
<td>{% if m.object_class %}{{ m.object_class }}{% endif %}</td>
<td>
{% for paper in m.catalog.all %}
{{ paper }},
{% endfor %}
</td><td>
{% for upload in m.uploads.all %}
<a title="{{ upload }}" href="{{ upload.get_download_url }}"><big><span class="glyphicon glyphicon-save-file"></span></big></a>
{% endfor %}
</td>
<td>
{% if m.ads.all.count %}
<b>{{ m.ads.all.count }}</b>
{% endif %}
</td>
<td>
{% if m.turksh %}
<a title="Turkish Date set: {{ m.turkish_date|date:"d.m.Y" }}" class="btn btn-danger btn-xs" role="button" href="">T</a>
{% endif %}
{% if m.marshall %}
<a title="MSFC source in NEP" class="btn btn-danger btn-xs" role="button" href="">MSFC</a>
{% endif %}
</td>
<td>
{{ m.modified|date:"d.m.y H:i" }}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
<div class="container-fluid">
<div class="col-sm-8 text-left">
{% for comment in comments %}
<div class="comments" style="padding: 10px;">
<p class="font-weight-bold">
<span class="glyphicon glyphicon-user"></span> <strong>{{ comment.owner.first_name }} {{ comment.owner.last_name }}</strong> {{ comment.name }}
<span class=" text-muted font-weight-normal">
{{ comment.created|date:"d.m.y H:i" }}
</span>
<span style="float:right;">
<a href="{{ comment.get_delete_url }}"><span class="glyphicon glyphicon-remove"></span> delete</a>
</span>
</p>
<p style="text-align:left;">
{{ comment.body | linebreaks }}
</p>
</div>
{% endfor %}
<div class="card-body">
<h3>Leave a comment</h3>
<form method="post" style="margin-top: 1.3em;">
{{ comment_form.as_p }}
{% csrf_token %}
<button type="submit" class="btn btn-primary btn-lg">Submit</button>
</form>
</div>
</div>
<div class="col-sm-4 text-right">
<p>
<h3>Attached files [<a href="{{ src.get_upload_url }}">+</a>]</h3>
<table class="table">
{% for upload in src.uploads.all %}
<tr>
<td><a title="{{ upload.title }}" href="{{ upload.get_download_url }}">{{ upload.title|truncatechars:20 }}</a>
<span title="{{ upload.notes }}"><span class="glyphicon glyphicon-comment"></span></span>
</td><td>[<a href="{{ src.get_edit_upload_url }}/{{ upload.pk }}">edit</a>, <a href="{{ src.get_delete_upload_url }}/{{ upload.pk }}">del</a>]</td>
</tr>
{% endfor %}
</table>
</p>
</div>
</div>
<div class="container">
<div class="col-sm-12 text-right">
<hr>
<p>
<a class="btn btn-danger btn-lg disabled" role="button" href="{{ src.get_delete_url_dead }}"><span class="glyphicon glyphicon-remove"></span> Delete this MetaSource only</a>
</p>
</div>
</div>
{% endblock %}