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

Generalized the systematic use of relFITSFilePath as the variable or key name...

Generalized the systematic use of relFITSFilePath as the variable or key name to specify the path to a FITS file relative to its root directory on the server ( cf. env var YAFITSS_FITSDIR )
parent 8db2553a
This diff is collapsed.
......@@ -120,7 +120,7 @@ class DataManagerImpl :
d["lazy"] = d["folder"]
if entry.endswith(".fits") :
size = DataBlock.convert_size(os.path.getsize(p))
d["title"] = "<a href = 'visit/?path=%s/%s' target = '_blank'>%s %s</a>" % (relKey, entry, entry, size)
d["title"] = "<a href = 'visit/?relFITSFilePath=%s/%s' target = '_blank'>%s %s</a>" % (relKey, entry, entry, size)
else:
d["title"] = entry
children.append(d)
......
......@@ -134,12 +134,12 @@ def upAnWaiting():
@route( baseUrl+'/degToHMSDMS', name='degToHMSDMS', method='GET')
@enable_cors
def degToHMSDMS():
fileName = rebuildFilename(request.GET['fileName'])
relFITSFilePath = rebuildFilename(request.GET['relPNGFilePath'])
ra = getFloatValue(request.GET['ra'])
dec = getFloatValue(request.GET['dec'])
sessionID = request.GET['sessionID']
response.content_type = "application/json; charset=utf-8"
return json.dumps(dm.degToHMSDMS(ra, dec, fileName))
return json.dumps(dm.degToHMSDMS(ra, dec, relFITSFilePath))
"""
......@@ -151,14 +151,14 @@ def degToHMSDMS():
@enable_cors
def rangeToHMS():
fileName = rebuildFilename(request.GET['fileName'])
relFITSFilePath = rebuildFilename(request.GET['relFITSFilePath'])
sessionID = request.GET['sessionID']
start = getIntValue(request.GET['start'])
end = getIntValue(request.GET['end'])
step = getIntValue(request.GET['step'])
response.content_type = "application/json; charset=utf-8"
return json.dumps(dm.rangeToHMS(start, end, step, fileName))
return json.dumps(dm.rangeToHMS(start, end, step, relFITSFilePath))
"""
Given a FITS filename and an interval of positive integers values and
......@@ -169,24 +169,24 @@ def rangeToHMS():
@enable_cors
def rangeToDMS():
fileName = rebuildFilename(request.GET['fileName'])
relFITSFilePath = rebuildFilename(request.GET['relFITSFilePath'])
sessionID = request.GET['sessionID']
start = getIntValue(request.GET['start'])
end = getIntValue(request.GET['end'])
step = getIntValue(request.GET['step'])
response.content_type = "application/json; charset=utf-8"
return json.dumps(dm.rangeToDMS(start, end, step, fileName))
return json.dumps(dm.rangeToDMS(start, end, step, relFITSFilePath))
"""
Given fileName read corresponding the FITS file in memory
Given relFITSFilePath read corresponding the FITS file in memory
returns the FITS header of that file.
"""
@route( baseUrl+'/setData', name='setData', method='GET')
@enable_cors
def setData():
logger.debug("setData : entering")
relFITSFilePath = rebuildFilename(request.GET['fileName'])
relFITSFilePath = rebuildFilename(request.GET['relFITSFilePath'])
sessionID = request.GET['sessionID']
response.content_type = "application/json; charset=utf-8"
result = dm.setData(relFITSFilePath)
......@@ -195,17 +195,17 @@ def setData():
"""
Given filename return the shape of the data cube contained
in fileName
in relFITSFilePath
"""
@route( baseUrl+'/getDimensions', name='getDimensions', method='GET')
@enable_cors
def getDimensions():
fileName = rebuildFilename(request.GET['fileName'])
relFITSFilePath = rebuildFilename(request.GET['relFITSFilePath'])
sessionID = request.GET['sessionID']
response.content_type = "application/json; charset=utf-8"
return json.dumps(dm.getDimensions(fileName))
return json.dumps(dm.getDimensions(relFITSFilePath))
"""
Given a multidimensional array l
......@@ -242,9 +242,9 @@ def getPixelValueAtiFreqiRAiDEC():
"""
Given an integer sliceNumb and an integer step
and a string fileName
and a string relFITSFilePath
returns a 2D array made of one pixel every (step, step)
of the slice sliceNumb in the datacube contained in fileName
of the slice sliceNumb in the datacube contained in relFITSFilePath
"""
@route( baseUrl+'/getSlice', name='getSlice', method='GET')
@enable_cors
......@@ -271,7 +271,7 @@ def getSlice():
def getFreq():
logger.debug("getFreq - wrapper : entering" )
relFITSFilePath = rebuildFilename(request.GET['fileName'])
relFITSFilePath = rebuildFilename(request.GET['relFITSFilePath'])
sessionID = request.GET['sessionID']
x = getIntValue(request.GET['x'])
y = getIntValue(request.GET['y'])
......@@ -348,7 +348,7 @@ def getSumOverSliceRectArea():
@enable_cors
def getAverage():
fileName = rebuildFilename(request.GET['fileName'])
relFITSFilePath = rebuildFilename(request.GET['relFITSFilePath'])
sessionID = request.GET['sessionID']
step = getIntValue(request.GET['step'])
startY = getIntValue(request.GET['startY'])
......@@ -357,7 +357,7 @@ def getAverage():
endX = getIntValue(request.GET['endX'])
startZ = getIntValue(request.GET['startZ'])
endZ = getIntValue(request.GET['endZ'])
result = dm.getAverage(fileName, step, startZ, endZ, startY, endY, startX, endX)
result = dm.getAverage(relFITSFilePath, step, startZ, endZ, startY, endY, startX, endX)
response.content_type = "application/json; charset=utf-8"
return json.dumps(result)
......@@ -380,7 +380,7 @@ def createFits():
return json.dumps(dm.createFits(relFITSFilePath, iRA, iDEC))
"""
Given fileName
Given relFITSFilePath
returns the FITS header
"""
@route( baseUrl+'/getHeader', name='getHeader', method='GET')
......@@ -389,7 +389,7 @@ def getHeader():
global logger
global dm
logger.debug("getHeader : entering")
relFITSFilePath = rebuildFilename(request.GET['fileName'])
relFITSFilePath = rebuildFilename(request.GET['relFITSFilePath'])
logger.debug(f"relFITSFilePath = {relFITSFilePath}")
response.content_type = "application/json; charset=utf-8"
result = json.dumps(dm.getHeader(relFITSFilePath))
......@@ -397,17 +397,17 @@ def getHeader():
return result
"""
Given fileName
Given relFITSFilePath
returns the area in the RA x DEC plane of the data contained in the data cube
as a pair of pairs ((ramin, ramax), ( decmin, decmax))
"""
@route( baseUrl+'/RADECRangeInDegrees', name='RADECRangeInDegrees', method='GET')
@enable_cors
def RADECRangeInDegrees():
fileName = rebuildFilename(request.GET['fileName'])
relFITSFilePath = rebuildFilename(request.GET['relFITSFilePath'])
sessionID = request.GET['sessionID']
response.content_type = "application/json; charset=utf-8"
return json.dumps(dm.RADECRangeInDegrees(fileName))
return json.dumps(dm.RADECRangeInDegrees(relFITSFilePath))
"""
Given relFITSFilePath and sliceIndex
......
<hr>
yafits is ready to browse and visualize your FITS files.
<hr>
......@@ -106,7 +106,7 @@ router.post('/', function(req, res, next) {
var dec = req.body.dec;
client.invoke("degToHMSDMS", parseInt(ra), parseInt(dec), req.body.fileName, req.sessionID, function (error, res, more) {
client.invoke("degToHMSDMS", parseInt(ra), parseInt(dec), req.body.relFITSFilePath, req.sessionID, function (error, res, more) {
self.setHeader('Content-Type', 'application/json');
self.send(JSON.stringify({ data: res }));
});
......@@ -117,7 +117,7 @@ router.post('/', function(req, res, next) {
var endR = req.body.end;
var step = req.body.step;
client.invoke("rangeToHMS", startR, endR, step, req.body.fileName, req.sessionID, function (error, res, more) {
client.invoke("rangeToHMS", startR, endR, step, req.body.relFITSFilePath, req.sessionID, function (error, res, more) {
self.setHeader('Content-Type', 'application/json');
self.send(JSON.stringify({ data: res }));
});
......@@ -128,14 +128,14 @@ router.post('/', function(req, res, next) {
endR = req.body.end;
step = req.body.step;
client.invoke("rangeToDMS", startR, endR, step, req.body.fileName, req.sessionID, function (error, res, more) {
client.invoke("rangeToDMS", startR, endR, step, req.body.relFITSFilePath, req.sessionID, function (error, res, more) {
self.setHeader('Content-Type', 'application/json');
self.send(JSON.stringify(result));
});
}
else if (method == "RADECRangeInDegrees") {
client.invoke("RADECRangeInDegrees", req.body.fileName, req.sessionID, function (error, res, more) {
client.invoke("RADECRangeInDegrees", req.body.relFITSFilePath, req.sessionID, function (error, res, more) {
self.setHeader('Content-type', 'application/json');
let result = {data: res};
console.log ("About to return '" + JSON.stringify(result, 0, 4) + "'");
......@@ -144,9 +144,9 @@ router.post('/', function(req, res, next) {
}
else if (method === "getHeader") {
var fileName = req.body.name;
var relFITSFilePath = req.body.name;
client.invoke("setData", fileName, req.sessionID, function (error, res, more) {
client.invoke("setData", relFITSFilePath, req.sessionID, function (error, res, more) {
if (error) {
var message = error.toString();
console.log(message);
......@@ -164,7 +164,7 @@ router.post('/', function(req, res, next) {
var sliceB = req.body.slice ? req.body.slice : 0;
step = parseInt(req.body.step) ? parseInt(req.body.step) : 1;
client.invoke("getSlice", sliceB, step, req.body.fileName, req.sessionID, function(error, res, more) {
client.invoke("getSlice", sliceB, step, req.body.relFITSFilePath, req.sessionID, function(error, res, more) {
console.log("getSlice: ");
self.setHeader('Content-Type', 'application/json');
console.log("getSlice : start sending slice to client");
......@@ -178,7 +178,7 @@ router.post('/', function(req, res, next) {
var zmax = parseInt(req.body.zmax) ? parseInt(req.body.zmax) : null;
step = parseInt(req.body.step) ? parseInt(req.body.step) : 1;
client.invoke("getAverage", req.body.fileName, req.sessionID, step, zmin, zmax, function(error, res, more) {
client.invoke("getAverage", req.body.relFITSFilePath, req.sessionID, step, zmin, zmax, function(error, res, more) {
console.log("getAverage:");
self.setHeader('Content-Type', 'application/json');
console.log("getAverage : start sending slice to client");
......@@ -191,7 +191,7 @@ router.post('/', function(req, res, next) {
var x = req.body.x ? req.body.x : 0;
var y = req.body.y ? req.body.y : 0;
client.invoke("getFreq", req.body.fileName, req.sessionID, parseInt(x), parseInt(y), function(error, res, more) {
client.invoke("getFreq", req.body.relFITSFilePath, req.sessionID, parseInt(x), parseInt(y), function(error, res, more) {
console.log("getFreq: ");
self.setHeader('Content-Type', 'application/json');
self.send(JSON.stringify({ data: res }));
......@@ -204,8 +204,8 @@ router.post('/', function(req, res, next) {
var xmax = parseInt(req.body.xmax)|| null;
var ymax = parseInt(req.body.ymax) || null;
// client.invoke("getFreqAverage", req.body.fileName, req.sessionID, xmin, xmax, ymin, ymax, function(error, res, more) {
client.invoke("getFreqAverage", req.body.fileName, req.sessionID, ymin, ymax, xmin, xmax, function(error, res, more) {
// client.invoke("getFreqAverage", req.body.relFITSFilePath, req.sessionID, xmin, xmax, ymin, ymax, function(error, res, more) {
client.invoke("getFreqAverage", req.body.relFITSFilePath, req.sessionID, ymin, ymax, xmin, xmax, function(error, res, more) {
self.setHeader('Content-Type', 'application/json');
self.send(JSON.stringify({ data: res }));
});
......
......@@ -33,45 +33,45 @@ var renderingCapabilities = null;
var clienthttp = {
server : "http://"+yafitssHost+":"+yafitssPort+"/artemix",
setData : function(fileName, sessionID, callback){
request(this.server+"/setData?fileName="+fileName+"&sessionID="+sessionID, { json: true }, function(error, response, body){
setData : function(relFITSFilePath, sessionID, callback){
request(this.server+"/setData?relFITSFilePath="+relFITSFilePath+"&sessionID="+sessionID, { json: true }, function(error, response, body){
callback(error, response, body);
});
},
degToHMSDMS : function(fileName, sessionID, ra, dec, callback){
request(this.server+"/degToHMSDMS?fileName="+fileName+"&sessionID="+sessionID+"&ra="+ra+"&dec="+dec, { json: true }, function(error, response, body){
degToHMSDMS : function(relFITSFilePath, sessionID, ra, dec, callback){
request(this.server+"/degToHMSDMS?relFITSFilePath="+relFITSFilePath+"&sessionID="+sessionID+"&ra="+ra+"&dec="+dec, { json: true }, function(error, response, body){
callback(error, response, body);
});
},
rangeToHMS : function(fileName, sessionID, start, end, step, callback){
request(this.server+"/rangeToHMS?fileName="+fileName+"&sessionID="+sessionID+"&start="+start+"&end="+end+"&step="+step, { json: true }, function(error, response, body){
rangeToHMS : function(relFITSFilePath, sessionID, start, end, step, callback){
request(this.server+"/rangeToHMS?relFITSFilePath="+relFITSFilePath+"&sessionID="+sessionID+"&start="+start+"&end="+end+"&step="+step, { json: true }, function(error, response, body){
callback(error, response, body);
});
},
rangeToDMS : function(fileName, sessionID, start, end, step, callback){
request(this.server+"/rangeToDMS?fileName="+fileName+"&sessionID="+sessionID+"&start="+start+"&end="+end+"&step="+step, { json: true }, function(error, response, body){
rangeToDMS : function(relFITSFilePath, sessionID, start, end, step, callback){
request(this.server+"/rangeToDMS?relFITSFilePath="+relFITSFilePath+"&sessionID="+sessionID+"&start="+start+"&end="+end+"&step="+step, { json: true }, function(error, response, body){
callback(error, response, body);
});
},
getSlice : function(fileName, sessionID, sliceNumb, step, callback){
request(this.server+"/getSlice?fileName="+fileName+"&sessionID="+sessionID+"&sliceNumb="+sliceNumb+"&step="+step, { json: true }, function(error, response, body){
getSlice : function(relFITSFilePath, sessionID, sliceNumb, step, callback){
request(this.server+"/getSlice?relFITSFilePath="+relFITSFilePath+"&sessionID="+sessionID+"&sliceNumb="+sliceNumb+"&step="+step, { json: true }, function(error, response, body){
callback(error, response, body);
});
},
getAverage : function(fileName, sessionID, step, startY, endY, startX, endX, startZ, endZ, callback){
request(this.server+"/getAverage?fileName="+fileName+"&sessionID="+sessionID+"&step="+step+"&startY="+startY+"&endY="+endY+"&startX="+startX+"&endX="+endX+"&startZ="+startZ+"&endZ="+endZ,
getAverage : function(relFITSFilePath, sessionID, step, startY, endY, startX, endX, startZ, endZ, callback){
request(this.server+"/getAverage?relFITSFilePath="+relFITSFilePath+"&sessionID="+sessionID+"&step="+step+"&startY="+startY+"&endY="+endY+"&startX="+startX+"&endX="+endX+"&startZ="+startZ+"&endZ="+endZ,
{ json: true }, function(error, response, body){
callback(error, response, body);
});
},
getFreq : function(fileName, sessionID, x, y, startZ, endZ, callback){
request(this.server+"/getFreq?fileName="+fileName+"&sessionID="+sessionID+"&x="+x+"&y="+y+"&startZ="+startZ+"&endZ="+endZ,
getFreq : function(relFITSFilePath, sessionID, x, y, startZ, endZ, callback){
request(this.server+"/getFreq?relFITSFilePath="+relFITSFilePath+"&sessionID="+sessionID+"&x="+x+"&y="+y+"&startZ="+startZ+"&endZ="+endZ,
{ json: true }, function(error, response, body){
callback(error, response, body);
});
......@@ -109,14 +109,14 @@ var clienthttp = {
});
},
RADECRangeInDegrees : function(fileName, sessionID, callback){
request(this.server+"/RADECRangeInDegrees?fileName="+fileName+"&sessionID="+sessionID, { json: true }, function(error, response, body){
RADECRangeInDegrees : function(relFITSFilePath, sessionID, callback){
request(this.server+"/RADECRangeInDegrees?relFITSFilePath="+relFITSFilePath+"&sessionID="+sessionID, { json: true }, function(error, response, body){
callback(error, response, body);
});
},
getHeader : function (fileName, sessionID, callback) {
request(this.server+"/getHeader?fileName="+fileName+"&sessionID="+sessionID, { json: true }, function(error, response, body){
getHeader : function (relFITSFilePath, sessionID, callback) {
request(this.server+"/getHeader?relFITSFilePath="+relFITSFilePath+"&sessionID="+sessionID, { json: true }, function(error, response, body){
callback(error, response, body);
});
},
......@@ -237,12 +237,12 @@ router.get('/',
function(req, res) {
console.log("getHeader http request callback: arming");
var path_to_fits = req.query.path;
var relFITSFilePath = req.query.relFITSFilePath;
// retrieve the product name, i.e. the simple filename without extension nor prefix.
var product = path.parse(req.query.path).name;
var product = path.parse(req.query.relFITSFilePath).name;
let reqUrl = req.originalUrl;
if (req.headers.referer) {
clienthttp.getHeader(path_to_fits, req.query.sessionID ? req.query.sessionID : 0, (error, response, body) => {
clienthttp.getHeader(relFITSFilePath, req.query.sessionID ? req.query.sessionID : 0, (error, response, body) => {
console.log("getHeader http request callback: entering")
if (error) {
var message = error.toString();
......@@ -250,8 +250,8 @@ router.get('/',
}
else if (body["status"] == false){
var params = {
title: 'Loading ' + path_to_fits,
path_to_fits: path_to_fits,
title: 'Loading ' + relFITSFilePath,
relFITSFilePath: relFITSFilePath,
useSAMP:useSAMP,
urlRoot:URLRoot(req.headers.referer)
}
......@@ -261,8 +261,8 @@ router.get('/',
header = JSON.parse(body["result"]);
useSAMP = useSAMP && (header["INSTRUME"] != "SITELLE");
var params = {
title: 'View of '+path_to_fits,
path_to_fits: path_to_fits,
title: 'View of '+relFITSFilePath,
relFITSFilePath: relFITSFilePath,
product: product,
header: header,
useSAMP: useSAMP,
......@@ -285,7 +285,7 @@ router.get('/',
else {
let params = {
title : 'No display',
path_to_fits: path_to_fits,
relFITSFilePath: relFITSFilePath,
header : header
}
res.render('olqv_error', params);
......@@ -341,7 +341,7 @@ router.post('/', function(req, res, next) {
var ra = req.body.ra;
var dec = req.body.dec;
clienthttp.degToHMSDMS(req.body.fileName, req.sessionID ?req.sessionID : 0, parseInt(ra), parseInt(dec), (error, response, body)=>{
clienthttp.degToHMSDMS(req.body.relFITSFilePath, req.sessionID ?req.sessionID : 0, parseInt(ra), parseInt(dec), (error, response, body)=>{
self.setHeader('Content-Type', 'application/json');
self.send(JSON.stringify({ data: body }));
});
......@@ -352,7 +352,7 @@ router.post('/', function(req, res, next) {
var endR = req.body.end;
var step = req.body.step;
clienthttp.rangeToHMS( req.body.fileName, req.sessionID ?req.sessionID : 0, startR, endR, step, (error, response, body)=>{
clienthttp.rangeToHMS( req.body.relFITSFilePath, req.sessionID ?req.sessionID : 0, startR, endR, step, (error, response, body)=>{
console.log("rangeToHMS");
self.setHeader('Content-Type', 'application/json');
self.send(JSON.stringify({ data: body }));
......@@ -364,7 +364,7 @@ router.post('/', function(req, res, next) {
let endR = req.body.end;
let step = req.body.step;
clienthttp.rangeToDMS(req.body.fileName, req.sessionID ?req.sessionID : 0, startR, endR, step, (error, response, body)=>{
clienthttp.rangeToDMS(req.body.relFITSFilePath, req.sessionID ?req.sessionID : 0, startR, endR, step, (error, response, body)=>{
console.log("rangeToDMS callback : entering");
self.setHeader('Content-Type', 'application/json');
self.send(JSON.stringify({ data: body }));
......@@ -373,7 +373,7 @@ router.post('/', function(req, res, next) {
}
else if (method == "RADECRangeInDegrees") {
clienthttp.RADECRangeInDegrees(req.body.fileName, req.body.sessionID ?req.body.sessionID : 0, (error, response, body) => {
clienthttp.RADECRangeInDegrees(req.body.relFITSFilePath, req.body.sessionID ?req.body.sessionID : 0, (error, response, body) => {
console.log("RADECRangeInDegrees callback : entering");
self.setHeader('Content-type', 'application/json');
let result = {data: body};
......@@ -384,9 +384,9 @@ router.post('/', function(req, res, next) {
}
else if (method === "getHeader") {
var fileName = req.body.name;
var relFITSFilePath = req.body.name;
clienthttp.setData(fileName, req.sessionID ?req.sessionID : 0, (error, response, body)=>{
clienthttp.setData(relFITSFilePath, req.sessionID ?req.sessionID : 0, (error, response, body)=>{
console.log("getHeader callback : entering");
if (error) {
var message = error.toString();
......@@ -404,7 +404,7 @@ router.post('/', function(req, res, next) {
else if(method === "getSlice"){
var sliceB = req.body.slice ? req.body.slice : 0;
step = parseInt(req.body.step) ? parseInt(req.body.step) : 1;
clienthttp.getSlice(req.body.fileName, req.sessionID ?req.sessionID : 0, sliceB, step, (error, response, body)=>{
clienthttp.getSlice(req.body.relFITSFilePath, req.sessionID ?req.sessionID : 0, sliceB, step, (error, response, body)=>{
console.log("getSlice callback : entering ");
self.setHeader('Content-Type', 'application/json');
console.log("getSlice : start sending slice to client");
......@@ -418,7 +418,7 @@ router.post('/', function(req, res, next) {
var zmax = parseInt(req.body.zmax) ? parseInt(req.body.zmax) : null;
step = parseInt(req.body.step) ? parseInt(req.body.step) : 1;
//console.log("### average values : "+ zmin + " "+zmax+" "+step);
clienthttp.getAverage(req.body.fileName, req.sessionID ?req.sessionID : 0, step, null, null, null, null, zmin, zmax, (error, response, body)=>{
clienthttp.getAverage(req.body.relFITSFilePath, req.sessionID ?req.sessionID : 0, step, null, null, null, null, zmin, zmax, (error, response, body)=>{
console.log("getAverage callback : entering");
self.setHeader('Content-Type', 'application/json');
console.log("getAverage : start sending slice to client");
......@@ -431,7 +431,7 @@ router.post('/', function(req, res, next) {
var x = req.body.x ? req.body.x : 0;
var y = req.body.y ? req.body.y : 0;
clienthttp.getFreq(req.body.fileName, req.sessionID ? req.sessionID:0, parseInt(x), parseInt(y), null, null, (error, response, body)=>{
clienthttp.getFreq(req.body.relFITSFilePath, req.sessionID ? req.sessionID:0, parseInt(x), parseInt(y), null, null, (error, response, body)=>{
console.log("getFreq callback : entering");
self.setHeader('Content-Type', 'application/json');
self.send(JSON.stringify({ data: body }));
......@@ -598,11 +598,11 @@ router.post('/', function(req, res, next) {
}
else if (method === "getFitsHeader") {
var path = req.body.path;
var relFITSFilePath = req.body.relFITSFilePath;
// Find the corresponding entry in DB
//{fields: {"_id": 0}
Fitsinfo.find({"Path": path}, {"_id": 0}, function(err, fitsHeader) {
Fitsinfo.find({"Path": relFITSFilePath}, {"_id": 0}, function(err, fitsHeader) {
if (err) {
console.log(err);
} else {
......@@ -632,7 +632,7 @@ router.post('/', function(req, res, next) {
router.post('/setData', function(req, res, next) {
console.log("router.post('/setData', function(req, res, next) { : entering");
// we need a FITS header
clienthttp.setData(encodeURI(req.body.fileName), req.sessionID ?req.sessionID : 0, (error, response, body) => {
clienthttp.setData(encodeURI(req.body.relFITSFilePath), req.sessionID ?req.sessionID : 0, (error, response, body) => {
console.log("setData callback : entering");
if (error) {
var message = error.toString();
......@@ -657,7 +657,7 @@ router.post('/setData', function(req, res, next) {
router.post('/png', function(req, res, next) {
console.log("router.post('/png', function(req, res, next) { : entering");
clienthttp.getOneSliceAsPNG(req.body.path, req.body.si, req.body.ittName, req.body.lutName, req.body.vmName, req.body.sessionID ? req.body.sessionID : 0, (error, response, body)=>{
clienthttp.getOneSliceAsPNG(req.body.relFITSFilePath, req.body.si, req.body.ittName, req.body.lutName, req.body.vmName, req.body.sessionID ? req.body.sessionID : 0, (error, response, body)=>{
console.log("getOneSliceAsPNG callback : entering");
if (error) {
console.log(error);
......@@ -674,7 +674,7 @@ router.post('/png', function(req, res, next) {
router.post('/sumpng', function(req, res, next) {
console.log("router.post('/sumpng', function(req, res, next) {: entering");
clienthttp.getSummedSliceRangeAsPNG(req.body.path, req.body.si0, req.body.si1, req.body.ittName, req.body.lutName, req.body.vmName, req.body.sessionID ? req.body.sessionID : 0, (error, response, body) => {
clienthttp.getSummedSliceRangeAsPNG(req.body.relFITSFilePath, req.body.si0, req.body.si1, req.body.ittName, req.body.lutName, req.body.vmName, req.body.sessionID ? req.body.sessionID : 0, (error, response, body) => {
console.log("getSummedSliceRangeAsPNG callback entering");
if (error){
console.log(error);
......
......@@ -833,9 +833,9 @@ var SAMPPNGPublishControl = (function (Control) {
lutName = $('#LUTSelector').find(':selected').text().trim()
vmName = $('#VideoModeSelector').find(':selected').text().trim()
console.log("ittName = " + ittName + ", lutName = " + lutName + "videoModeNamee = " + vmName);
$.post('png', {'si': _sliceIndex, 'path': _relFITSFilePath, 'ittName': ittName, 'lutName': lutName , 'vmName' : vmName}).done(
$.post('png', {'si': _sliceIndex, 'relFITSFilePath': _relFITSFilePath, 'ittName': ittName, 'lutName': lutName , 'vmName' : vmName}).done(
function(resp) {
console.log("$.post('/png', {'si': _sliceIndex, 'path': _path}).done(: entering");
console.log("$.post('/png', {'si': _sliceIndex, 'relFITSFilePath': _relFITSFilePath}).done(: entering");
if (resp["status"] == false) {
alert ("Something went wrong during the generation of the image. The message was '" + resp["message"] +"'");
}
......@@ -874,11 +874,11 @@ var SAMPPNGPublishControl = (function (Control) {
console.log('_updateSliceWithPOST: exiting');
};
let _displaySlice = function(path, sliceIndex) {
let _displaySlice = function(relFITSFilePath, sliceIndex) {
console.log('_displaySlice : entering');
console.log("path = ", path);
console.log("relFITSFilePath = ", relFITSFilePath);
_sliceIndex = sliceIndex;
_path = path;
_relFITSFilePath = relFITSFilePath;
_updateSliceWithPOST();
console.log('_displaySlice : exiting');
......@@ -890,9 +890,9 @@ var SAMPPNGPublishControl = (function (Control) {
ittName = $('#ITTSelector').find(':selected').text().trim()
lutName = $('#LUTSelector').find(':selected').text().trim()
vmName = $('#VideoModeSelector').find(':selected').text().trim()
$.post('sumpng', {'si0': _sliceIndex0, 'si1': _sliceIndex1, 'path': _relFITSFilePath, 'ittName': ittName, 'lutName': lutName, 'vmName' :vmName}).done(
$.post('sumpng', {'si0': _sliceIndex0, 'si1': _sliceIndex1, 'relFITSFilePath': _relFITSFilePath, 'ittName': ittName, 'lutName': lutName, 'vmName' :vmName}).done(
function (resp) {
console.log("$.post('/sumpng', {'si0': _sliceIndex0, 'si1': _sliceIndex1, 'path': path}).done() : entering");
console.log("$.post('/sumpng', {'si0': _sliceIndex0, 'si1': _sliceIndex1, 'relFITSFilePath': relFITSFilePath}).done() : entering");
if (resp["status"] == false) {
alert ("Something went wrong during the generation of the image. The message was '" + resp["message"] +"'");
}
......@@ -920,18 +920,18 @@ var SAMPPNGPublishControl = (function (Control) {
sAMPPublisher.setSummedSlicesRelPNGPath(path_to_png);
<%}%>
document.getElementById('loading').style.display="none";
console.log("$.post('/sumpng', {'si0': _sliceIndex0, 'si1': _sliceIndex1, 'path': path}).done() : exiting");
console.log("$.post('/sumpng', {'si0': _sliceIndex0, 'si1': _sliceIndex1, 'relFITSFilePath': relFITSFilePath}).done() : exiting");
});
console.log("_updateSummedSlicesWithPOST : exiting");
};
let _displaySummedSlices = function(path, sliceIndex0, sliceIndex1) {
console.log("let _displaySummedSlices = function(path, sliceIndex0, sliceIndex1) { : entering");
let _displaySummedSlices = function(relFITSFilePath, sliceIndex0, sliceIndex1) {
console.log("let _displaySummedSlices = function(relFITSFilePath, sliceIndex0, sliceIndex1) { : entering");
_sliceIndex0 = sliceIndex0;
_sliceIndex1 = sliceIndex1;
_path = path;
_relFITSFilePath = relFITSFilePath;
_updateSummedSlicesWithPOST();
console.log("let _displaySummedSlices = function(path, sliceIndex0, sliceIndex1) { : exiting");
console.log("let _displaySummedSlices = function(relFITSFilePath, sliceIndex0, sliceIndex1) { : exiting");
};
this.display = function(sliceIndex, sliceIndex0, sliceIndex1) {
......@@ -1131,7 +1131,7 @@ var SAMPPNGPublishControl = (function (Control) {
/*
** A class to display a spectrum
*/
function SpectrumViewer (path_to_fits, FITSHeader, itsGD){
function SpectrumViewer (relFITSFilePath, FITSHeader, itsGD){
console.log("SpectrumViewer: entering");
var ifrequencyMarker = 0;
......@@ -1160,7 +1160,7 @@ var SAMPPNGPublishControl = (function (Control) {