Commit d6619aab authored by Caillat Michel's avatar Caillat Michel
Browse files

Merge branch 'master' of https://gitlab.obspm.fr/caillat/yafits

parents be1824d3 6d2a2ccb
......@@ -125,3 +125,4 @@ RUN ls -l /home/partemix/anaconda3/pkgs/matplotlib-3.0.3-py37h5429711_0/lib/
# ./yafitss/serverWsgi.michel will be listening at 4251
EXPOSE 4251
......@@ -80,3 +80,4 @@ COPY --chown=partemix:partemix . /home/partemix/yafitsv
RUN ls -l /home/partemix/yafitsv
EXPOSE 3000
......@@ -181,6 +181,9 @@ function unitRescale(unit) {
** and returns the sum multiplied by a coefficient coeff.
*/
function sumArr(arr, i0, i1, coeff) {
console.log("SumArr");
console.log(arr);
console.log("i0 : "+i0 + " , i1 : " + i1 + " coeff : "+ coeff);
i0 = Math.max(0, i0);
i1 = Math.min(arr.length-1, i1);
......
/*
** A set of classes and function definitions utilized by the
** differents flavours of OLQV viewers.
**
** Author : M. Caillat
** Date : 06th December 2018
*/
/*
** Converts a decimal number expected to represent an angle in degree
** into a string expressing a right ascension ( H:M:S)
*/
let DecDeg2HMS = function(deg,sep=':'){
//if(any(deg< 0 | deg>360)){stop('All deg values should be 0<=d<=360')}
//if (deg < 0)
//deg[deg < 0] = deg[deg < 0] + 360
HRS = Math.floor(deg/15);
MIN = Math.floor((deg/15 - HRS) * 60);
SEC = (deg/15 - HRS - MIN/60) * 3600;
SEC = Math.floor(SEC*1000) / 1000.;
return HRS+sep+MIN+sep+SEC;
};
/*
** Converts a decimal number expected to represent an angle in degree
** into a string expressing a declination ( D:M:S)
*/
let DecDeg2DMS = function(deg,sep=':'){
let sign = deg < 0 ? '-':'+';
deg = Math.abs(deg)
let DEG = Math.floor(deg)
let MIN = Math.floor((deg - DEG) * 60)
let SEC = (deg - DEG - MIN/60) * 3600
SEC = Math.floor(SEC*1000.) / 1000.;
if (SEC < 0.) SEC = 0.; if (SEC > 60) SEC = 60.;
return(sign + DEG + ':' + MIN + ':' + SEC );
};
/*
** A class to convert pixels into a string expressing a right ascension.
**
** The constructor establishes the transformation pixels -> HMS
** with the given parameter ra0pix, ra1pix ( interval in pixels )
** and ra0, ra1 ( the same interval in decimal degrees)
*/
function raLabelFormatter (ra0pix, ra1pix, ra0, ra1) {
let _ra0pix = ra0pix;
let _ra1pix = ra1pix;
let _ra0 = ra0;
let _ra1 = ra1;
let _slope = ((_ra1 - _ra0) / (_ra1pix - _ra0pix))
/*
** Returns the string representation of a RA in HMS given its input value in pixels.
*/
this.format = function(rapix) {
let res = _ra0 + (rapix - _ra0pix) * _slope;
return DecDeg2HMS(res);
}
};
/*
** A class to convert pixels into a string expressing a declination.
**
** The constructor establishes the transformation pixels -> DMS
** with the given parameter dec0pix, dec1pix ( interval in pixels )
** and dec0, dec1 ( the same interval in decimal degrees)
*/
function decLabelFormatter (dec0pix, dec1pix, dec0, dec1) {
let _dec0pix = dec0pix;
let _dec1pix = dec1pix;
let _dec0 = dec0;
let _dec1 = dec1;
let _slope = ((_dec1 - _dec0) / (_dec1pix - _dec0pix))
this.format = function(decpix) {
let res = _dec0 + (decpix - _dec0pix) * _slope;
return DecDeg2DMS(res);
}
};
body{
width : 1440px;
}
h1, h2, h3, h4, h5 {color: #272727;text-align: left;}
h1 {font-size: 2.25em;}
h2 {font-size: 1.75em; margin: 30px 0 15px 0;}
h3 {font-size: 1.25em;margin: 30px 0 15px 0;}
h4 {font-size: 1em; margin: 30px 0 15px 0;}
.map {
height: 512px;
width: 512px;
}
#loading {
display: block;
position: absolute;
top: 0;
left: 0;
z-index: 100;
/*width: 100vw;
height: 100vh;*/
width: 100vw;
height: 1200px;
background-color: rgba(192, 192, 192, 0.5);
background-image: url("../MnyxU.gif");
background-repeat: no-repeat;
background-position: center;
}
#info {
z-index: 1;
opacity: 0;
position: absolute;
top: 100%;
left: 0;
margin: 0;
background: rgba(0,60,136,0.7);
color: white;
border: 0;
transition: opacity 100ms ease-in;
}
.marker {
width: 16px;
height: 16px;
border: 1px solid #088;
border-radius: 8px;
background-color: #0FF;
opacity: 0.5;
}
.ol-popup {
position: absolute;
background-color: white;
-webkit-filter: drop-shadow(0 1px 4px rgba(0,0,0,0.2));
filter: drop-shadow(0 1px 4px rgba(0,0,0,0.2));
padding: 10px;
border-radius: 10px;
border: 1px solid #cccccc;
bottom: 12px;
left: -50px;
min-width: 150px;
font-size: 10px;
}
.ol-popup:after, .ol-popup:before {
top: 100%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
}
.ol-popup:after {
border-top-color: white;
border-width: 10px;
left: 48px;
margin-left: -10px;
}
.ol-popup:before {
border-top-color: #cccccc;
border-width: 11px;
left: 48px;
margin-left: -11px;
}
.ol-popup-closer {
text-decoration: none;
position: absolute;
top: 2px;
right: 8px;
}
.ol-popup-closer:after {
content: "x";
}
th, td {
padding: 0px;
margin: 0px;
font-size: 16px;
height: 20px;
}
.list-group{
flex-direction: row;
}
.map:-moz-full-screen {
height: 100%;
}
.map:-webkit-full-screen {
height: 100%;
}
.map:-ms-fullscreen {
height: 100%;
}
.map:fullscreen {
height: 100%;
}
.samp-publish-png {
top: 65px;
left: .5em;
display:none;
}
.ol-touch .samp-publish-png {
top: 80px
}
.chart-container{
max-width:100%;
}
/*
.chart-container > .row{
padding-top : 0.5em;
}*/
.chart-container > .row > .chart-img{
max-width : 550px;
padding-left : 5px;
padding-right : 0px;
}
.chart-container > .row > .chart-plot{
max-width : 100%;
padding-left : 0;
/*padding-top : 5em;*/
}
.col .chart-title{
padding-left : 750px;
margin-bottom : 2em;
}
.hidden{
display : none;
}
.highcharts-graph.zone-0 {
stroke: #f7a35c;
}
.highcharts-area.zone-0 {
fill: #f7a35c;
}
.btn-control:hover{
background-color: #dadcdd;
}
.btn-control{
width : 90px;
}
.external_mouse_position{
height : 1.5em;
}
#sampRegistry button{
display: inline-block;
font-weight: 400;
text-align: center;
white-space: nowrap;
vertical-align: middle;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
border: 1px solid
transparent;
padding: .375rem .75rem;
font-size: 1rem;
line-height: 1.5;
border-radius: .25rem;
transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}
.samp-img{
width:30px;
height:30px;
cursor: pointer;
}
.cube-infos{
font-size:15px;
color: black;
}
.img-configuration select{
display : inline-block;
width : auto;
}
.img-configuration .list-group-item:last-child{
margin-bottom: auto;
border-bottom-right-radius: 0%;
border-bottom-left-radius: 0%;
}
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title><%= title %></title>
......@@ -7,149 +8,33 @@
<!--script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script> -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js" type="text/javascript"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"
integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49"
crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"
integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.full.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css"
integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
<script src="https://code.highcharts.com/highcharts.src.js"></script>
<script src="https://code.highcharts.com/modules/boost.js"></script>
<script src="https://cdn.rawgit.com/openlayers/openlayers.github.io/master/en/v5.3.0/build/ol.js"></script>
<link rel="stylesheet" href="https://cdn.rawgit.com/openlayers/openlayers.github.io/master/en/v5.3.0/css/ol.css">
<link rel="stylesheet" type="text/css" href="/stylesheets/overlay.css">
<link rel="stylesheet" type="text/css" href="/stylesheets/olqv.css">
<script src="../javascript/FITSHeaderTable.js"></script>
<script src="../javascript/olqv_utils.js"></script>
<!-- <script src="https://openlayers.org/en/v4.6.4/build/ol.js" type="text/javascript"></script> -->
<!-- <script src="https://openlayers.org/en/v4.6.4/build/ol.js" type="text/javascript"></script> -->
<!-- Conditional code generation -->
<%if(useSAMP){%>
<%if(useSAMP){%>
<script src="../javascript/samp.js"></script>
<script src="../javascript/samp_utils.js"></script>
<%}%>
<%}%>
<!-- End of conditional code generation -->
<style>
.map {
height: 512px;
width: 512px;
}
#loading {
display: block;
position: absolute;
top: 0;
left: 0;
z-index: 100;
width: 100vw;
height: 100vh;
background-color: rgba(192, 192, 192, 0.5);
background-image: url("../MnyxU.gif");
background-repeat: no-repeat;
background-position: center;
}
#info {
z-index: 1;
opacity: 0;
position: absolute;
top: 100%;
left: 0;
margin: 0;
background: rgba(0,60,136,0.7);
color: white;
border: 0;
transition: opacity 100ms ease-in;
}
.marker {
width: 16px;
height: 16px;
border: 1px solid #088;
border-radius: 8px;
background-color: #0FF;
opacity: 0.5;
}
.ol-popup {
position: absolute;
background-color: white;
-webkit-filter: drop-shadow(0 1px 4px rgba(0,0,0,0.2));
filter: drop-shadow(0 1px 4px rgba(0,0,0,0.2));
padding: 10px;
border-radius: 10px;
border: 1px solid #cccccc;
bottom: 12px;
left: -50px;
min-width: 150px;
font-size: 10px;
}
.ol-popup:after, .ol-popup:before {
top: 100%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
}
.ol-popup:after {
border-top-color: white;
border-width: 10px;
left: 48px;
margin-left: -10px;
}
.ol-popup:before {
border-top-color: #cccccc;
border-width: 11px;
left: 48px;
margin-left: -11px;
}
.ol-popup-closer {
text-decoration: none;
position: absolute;
top: 2px;
right: 8px;
}
.ol-popup-closer:after {
content: "x";
}
th, td {
padding: 0px;
margin: 0px;
font-size: 16px;
height: 20px;
}
.list-group{
flex-direction: row;
}
.map:-moz-full-screen {
height: 100%;
}
.map:-webkit-full-screen {
height: 100%;
}
.map:-ms-fullscreen {
height: 100%;
}
.map:fullscreen {
height: 100%;
}
.samp-publish-png {
top: 65px;
left: .5em;
display:none;
}
.ol-touch .samp-publish-png {
top: 80px
}
</style>
</head>
<body>
......@@ -159,103 +44,127 @@
<div class="pos-f-t">
<div class="collapse" id="sampRegistry"></div>
<div class="collapse" id="navbarToggleExternalContent">
<div class="bg-dark p-4">
<div class="p-4">
<% if (renderingCapabilities) { %>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<ul class="list-group list-group-horizontal">
<li class="list-group-item ">
<label for="LUTSelector">LUTs</label>
<select name="LUTs" class="form-control" id="LUTSelector">
<% renderingCapabilities["luts"].forEach(function(lut) { %>
<option> <%=lut%></option>
<% }) %>
</select>
</li>
<li class="list-group-item ">
<label for="ITTSelector">ITTs</label>
<select class="form-control" id="ITTSelector">
<% renderingCapabilities["itts"].forEach(function(itt) { %>
<option> <%=itt%></option>
<% }) %>
</select>
</li>
<li class="list-group-item ">
<label for="VideoModeSelector">Video mode</label>
<select class="form-control" id="VideoModeSelector">
<nav class="navbar navbar-light bg-light">
<ul class="list-group list-group-horizontal img-configuration">
<li class="list-group-item ">
<label for="LUTSelector">LUTs</label>
<select name="LUTs" class="form-control" id="LUTSelector">
<% renderingCapabilities["luts"].forEach(function(lut) { %>
<option> <%=lut%></option>
<% }) %>
</select>
</li>
<li class="list-group-item ">
<label for="ITTSelector">ITTs</label>
<select class="form-control" id="ITTSelector">
<% renderingCapabilities["itts"].forEach(function(itt) { %>
<option> <%=itt%></option>
<% }) %>
</select>
</li>
<li class="list-group-item ">
<label for="VideoModeSelector">Video mode</label>
<select class="form-control" id="VideoModeSelector">
<% renderingCapabilities["vmodes"].forEach(function(vmode) { %>
<option> <%=vmode%></option>
<option> <%=vmode%></option>
<% }) %>
</select>
</li>
<li class="list-group-item">
<a class="form-control" id="rccap" class="btn btn-primary" href="#" role="button">Apply</a>
</li>
</ul>
</nav>
</div>
</select>
</li>
<li class="list-group-item">
<button id="rccap" class="btn btn-default btn-control">Apply</button>
</li>
</ul>
</nav>
</div>
<%}%>
<%}%>
</div>
</div>
<nav class="navbar navbar-dark bg-dark">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarToggleExternalContent" aria-controls="navbarToggleExternalContent" aria-expanded="false" aria-label="Toggle navigation">
<nav class="navbar navbar-light" style="background-color: #FFFFFF;">
<button class="navbar-toggler" type="button"
data-toggle="collapse" data-target="#navbarToggleExternalContent"
aria-controls="navbarToggleExternalContent" aria-expanded="false"
aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<img src="../samphub.png" style="width:30px; height:30px" data-toggle="collapse" data-target="#sampRegistry" aria-controls="sampRegistry" aria-expanded="false" aria-label="Toggle navigation"/>
<!--<div><a id="jupyter" href="#" target="_blank"><img src="../jupyter.png" style="width:30px; height:30px" title="jupyter"/></a></div>-->
<a href="#" class="btn btn-link btn-sm" onclick="viewIn3D(); return false;"> 3D representation </a>
<div><a href="http://artemix.obspm.fr/fits/browse" target="_blank" class="btn btn-link btn-sm">See more FITS files...</a></div>
<div id="cubeInfos" style="font-size:15px; color: white"></div>
<a href="#" class="btn btn-link btn-sm" onclick="viewIn3D(); return false;"> Show 3D model </a>
<div><a href="http://artemix.obspm.fr/fits/browse" target="_blank" class="btn btn-link btn-sm">Show Fits file browser</a></div>
<div id="cubeInfos" class="cube-infos"></div>
<img src="../samphub.png" class="samp-img"
data-toggle="collapse" data-target="#sampRegistry" title="Transfer data to another application with SAMP protocol"
aria-controls="sampRegistry" aria-expanded="false" aria-label="Toggle navigation"/>
</nav>
</div>
<div>
<table style="width: 100%">
<tr>
<td style= "background-color: lightgray">
<div id="external_mouse_position_1"></div>
</td>
<td align="middle" style= "background-color: lightgray">
<div id="publish_spectrum"></div>
</td>
</tr>
<tr>
<td style="width: 25%">
<div id="slice" class="map" style="background-color:darkblue"></div>
</td>
<td>
<div id="spectrum"></div>
</td>
</tr>
<tr>
<td style="background-color: lightgray">
<div id="external_mouse_position_2"></div>
</td>
<td align="middle" style="background-color: lightgray">