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

Merge branch 'colorbar' into develop

parents ec02cb64 2474c641
......@@ -27,7 +27,7 @@ import os
import re
from functools import reduce
from matplotlib import pyplot as plt
import copy
import yt
......@@ -641,7 +641,8 @@ class DataBlock:
p_high = self.__getPercentile(sliceData, 99.9)
p_low = self.__getPercentile(sliceData, 0.1)
img_i = sliceData
# we work on a copy of the data
img_i = copy.deepcopy(sliceData)
for irow in range(img_i.shape[1]//2):
img_i[irow,:], img_i[img_i.shape[1] - 1 - irow,:] = img_i[img_i.shape[1] - 1 - irow,:], img_i[irow,:].copy()
......@@ -1448,10 +1449,16 @@ class DataBlock:
if iFREQ1 == None:
iFREQ1 = self.__data.shape[0]
nonanArray = np.nan_to_num(self.__data[iFREQ0:iFREQ1, iDEC, iRA].compute())
result = nonanArray.tolist()
self.__logger.debug( "getSpectrum: exiting")
return Result().ok(result)
try :
nonanArray = np.nan_to_num(self.__data[iFREQ0:iFREQ1, iDEC, iRA].compute())
result = nonanArray.tolist()
self.__logger.debug( "getSpectrum: exiting")
return Result().ok(result)
# nothing here
except IndexError as e :
return Result().wrong("IndexError")
except Exception as e:
return Result.wrong("An exception occurred :" + str(e))
def getPixelValueAtiRAiDEC(self, iRA: int, iDEC: int) -> Result:
self.__logger.debug("getPixelValueAtiRAiDEC: entering")
......
......@@ -2010,10 +2010,18 @@ class SingleSpectrumViewer extends SpectrumViewer{
*/
(resp)=>{
console.log("getSpectrum callback : entering");
if (resp.data["status"] == false) {
alert(resp.data["message"]);
if (resp.data["status"] == false ) {
DOMAccessor.showLoaderAction(false);
return;
// an error occurred
if(resp.data["message"] !== "IndexError"){
alert(resp.data["message"]);
return;
}
// there was nothing at given corrdinates
else{
return;
}
}
let plotData = self._getXAxisConfiguration();
......
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