Commit 86733526 authored by Moreau Nicolas's avatar Moreau Nicolas
Browse files

all relations between graphs implemented

parent fb78b848
......@@ -835,7 +835,6 @@ var SAMPPNGPublishControl = (function (Control) {
if (e.selected.length) {
_selected_box_2 = e.selected[0];
var extent = e.selected[0].getGeometry().getExtent();
console.log(JSON.stringify(e.selected[0].getGeometry().getExtent()));
summedPixelsSpectrumViewer.plot(extent[0], extent[2], extent[1], extent[3]);
ROI.iRA0 = Math.round(extent[0]);
ROI.iRA1 = Math.round(extent[2]);
......@@ -1182,7 +1181,7 @@ var SAMPPNGPublishControl = (function (Control) {
var toptitle_unit = "";
console.log("_instrume="+_instrume+", _origin="+_origin);
if (_instrume == "SITELLE") {
xtitle = _ctype3 + " (" + _cunit3 + ")";
xtitle = _ctype3 + " (" + getCunit3() + ")";
ytitle = "FLUX (" + _bunit + ")" ;
toptitle = "";
}
......@@ -1198,7 +1197,7 @@ var SAMPPNGPublishControl = (function (Control) {
toptitle = "";
}
else if (_instrume == "MUSE") {
xtitle = _ctype3 + " (" + _cunit3 + ")";
xtitle = _ctype3 + " (" + getCunit3() + ")";
ytitle = "FLUX (" + _bunit + ")";
toptitle = "";
}
......@@ -1377,28 +1376,28 @@ var SAMPPNGPublishControl = (function (Control) {
// Draw x-axis in Frequencies (plot on top right)
if ((_origin === "GILDAS Consortium") && (_ctype3 === "VRAD")){
_cunit3 = "M/S"
}
//~ if ((_origin === "GILDAS Consortium") && (_ctype3 === "VRAD")){
//~ _cunit3 = "M/S"
//~ }
let rlen = xData.length;
var plotData = JSON.parse(JSON.stringify(_frequencyPlot));
for (var i = 0; i < rlen; i++) {
let tmp = linearTabulator(_crval3, _cdelt3, _crpix3, i+1);
if (_cunit3 in unitFactor) {
if (getCunit3() in unitFactor) {
switch (_ctype3) {
case 'FREQ' :
if (_cdelt3 > 0) {
xData[rlen-i-1] = tmp * unitFactor[_cunit3] / unitFactor[defaultOutputUnit[_ctype3]];
xData[rlen-i-1] = tmp * unitFactor[getCunit3()] / unitFactor[defaultOutputUnit[_ctype3]];
}
else {
xData[i] = tmp * unitFactor[_cunit3] / unitFactor[defaultOutputUnit[_ctype3]];
xData[i] = tmp * unitFactor[getCunit3()] / unitFactor[defaultOutputUnit[_ctype3]];
}
break;
case 'VRAD':
let tmp1 = v2f(tmp * unitFactor[_cunit3] , _restfreq) / unitFactor[defaultOutputUnit['FREQ']];
let tmp1 = v2f(tmp * unitFactor[getCunit3()] , _restfreq) / unitFactor[defaultOutputUnit['FREQ']];
if (_cdelt3 > 0) {
xData[i] = tmp1;
}
......@@ -1572,8 +1571,14 @@ var SAMPPNGPublishControl = (function (Control) {
reversed : true,
events: {
setExtremes : function(event){
summedPixelsSpectrumChart.xAxis[0].setExtremes(event.min,event.max);
//this.showResetZoom();
if(event.min === undefined || event.max === undefined){
summedPixelsSpectrumChart.xAxis[0].setExtremes( summedPixelsSpectrumChart.xAxis[0].dataMin,
summedPixelsSpectrumChart.xAxis[0].dataMax);
}else{
let minval = f2v(event.min * 1e9, _restfreq)/1e3;
let maxval = f2v(event.max * 1e9, _restfreq)/1e3;
summedPixelsSpectrumChart.xAxis[0].setExtremes(minval,maxval);
}
},
}
},
......@@ -1583,9 +1588,9 @@ var SAMPPNGPublishControl = (function (Control) {
}
},
tooltip:{
formatter : function(){
/*formatter : function(){
return '( ' + this.x.toFixed(4) + ', ' + this.y.toFixed(4); + ')';
}
}*/
},
series: [
{
......@@ -1622,7 +1627,7 @@ var SAMPPNGPublishControl = (function (Control) {
var toptitle_unit = "";
if (_instrume == "SITELLE") {
xtitle = _ctype3 + " (" + _cunit3 + ")";
xtitle = _ctype3 + " (" + getCunit3() + ")";
ytitle = "FLUX (" + summedPixelsSpectrumUnit(header["BUNIT"]) + ")";
toptitle_unit = "ergs / s / cm^2";;
}
......@@ -1637,7 +1642,7 @@ var SAMPPNGPublishControl = (function (Control) {
toptitle_unit = "Jy . km / s";
}
else if (_instrume == "MUSE") {
xtitle = _ctype3 + " (" + _cunit3 + ")";
xtitle = _ctype3 + " (" + getCunit3() + ")";
ytitle = "Int. flux)";
toptitle_unit = "";
}
......@@ -1723,7 +1728,6 @@ var SAMPPNGPublishControl = (function (Control) {
panKey: 'shift',
events:{
selection: function(event){
console.log("### selection");
this.xAxis[0].update({
plotBands : [{ // visualize the weekend
from: event.xAxis[0].min,
......@@ -1735,7 +1739,7 @@ var SAMPPNGPublishControl = (function (Control) {
var imin = Math.round((event.xAxis[0].min - plotData2.x[0]) / (plotData2.x[1]-plotData2.x[0]));
var imax = Math.round((event.xAxis[0].max - plotData2.x[0]) / (plotData2.x[1]-plotData2.x[0]));
if (_cunit3 in unitFactor) {
if (getCunit3() in unitFactor) {
switch (_ctype3) {
case 'FREQ':
if (_cdelt3 > 0) {
......@@ -1824,15 +1828,15 @@ var SAMPPNGPublishControl = (function (Control) {
let coeff = 1;
if ((_origin === "GILDAS Consortium") && (_ctype3 === "VRAD")){
_cunit3 = "M/S";
cdelt3prim = Math.abs(_cdelt3) * unitFactor[_cunit3] / unitFactor[defaultOutputUnit[_ctype3]];
//~ _cunit3 = "M/S";
cdelt3prim = Math.abs(_cdelt3) * unitFactor[getCunit3()] / unitFactor[defaultOutputUnit[_ctype3]];
}
else if (_origin.startsWith("CASA")) {
if (_ctype3 == "FREQ"){
cdelt3prim = speedOfLight /1000. * Math.abs(_cdelt3) / _restfreq;
}
else{
cdelt3prim = Math.abs(_cdelt3) * unitFactor[_cunit3] / unitFactor[defaultOutputUnit[_ctype3]];
cdelt3prim = Math.abs(_cdelt3) * unitFactor[getCunit3()] / unitFactor[defaultOutputUnit[_ctype3]];
}
}
else if (_instrume == "SITELLE") {
......@@ -1851,11 +1855,11 @@ var SAMPPNGPublishControl = (function (Control) {
for (var i = 0; i < rlen; i++) {
let tmp = linearTabulator(_crval3, _cdelt3, _crpix3, i+1);
if (_cunit3 in unitFactor) {
if (getCunit3() in unitFactor) {
switch (_ctype3) {
case 'FREQ':
let tmp1 = f2v(tmp * unitFactor[_cunit3], _restfreq) / unitFactor[defaultOutputUnit['VRAD']];
let tmp1 = f2v(tmp * unitFactor[getCunit3()], _restfreq) / unitFactor[defaultOutputUnit['VRAD']];
if (_cdelt3 > 0) {
xData[rlen-i-1] = tmp1;
}
......@@ -1866,10 +1870,10 @@ var SAMPPNGPublishControl = (function (Control) {
case 'VRAD' :
if (_cdelt3 > 0) {
xData[i] = tmp * unitFactor[_cunit3] / unitFactor[defaultOutputUnit[_ctype3]];
xData[i] = tmp * unitFactor[getCunit3()] / unitFactor[defaultOutputUnit[_ctype3]];
}
else {
xData[rlen-i-1] = tmp * unitFactor[_cunit3] / unitFactor[defaultOutputUnit[_ctype3]];
xData[rlen-i-1] = tmp * unitFactor[getCunit3()] / unitFactor[defaultOutputUnit[_ctype3]];
}
break;
......@@ -2027,6 +2031,14 @@ var SAMPPNGPublishControl = (function (Control) {
iFREQ0 : 0,
iFREQ1 : _naxis3 - 1
};
var getCunit3 = function(){
if ((_origin === "GILDAS Consortium") && (_ctype3 === "VRAD")){
return "M/S";
}
return _cunit3;
}
var deleteFeature = function(evt){
console.log("var deleteFeature = function(evt){ : entering");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment