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

Renamed some parameters in order to follow the naming standards and added a measureBox method

parent 22c14d01
......@@ -560,12 +560,12 @@ def getSumOverSliceRectArea():
logger.debug("getSumOverSliceRectArea - wrapper : entering" )
try:
relFITSFilePath = rebuildFilename(request.GET['relFITSFilePath'])
DECPix0 = getIntValue(request.GET['DECPix0'])
DECPix1 = getIntValue(request.GET['DECPix1'])
RAPix0 = getIntValue(request.GET['RAPix0'])
RAPix1 = getIntValue(request.GET['RAPix1'])
iDEC0 = getIntValue(request.GET['iDEC0'])
iDEC1 = getIntValue(request.GET['iDEC1'])
iRA0 = getIntValue(request.GET['iRA0'])
iRA1 = getIntValue(request.GET['iRA1'])
iFREQ = getIntValue(request.GET['iFREQ'])
result = json.dumps(dm.getSumOverSliceRectArea(relFITSFilePath, iFREQ, RAPix0, RAPix1, DECPix0, DECPix1))
result = json.dumps(dm.getSumOverSliceRectArea(relFITSFilePath, iFREQ, iRA0, iRA1, iDEC0, iDEC1))
except Exception as e:
exc_type, exc_value, exc_traceback = sys.exc_info()
message = "%s ! %s" % (type(e), "".join(traceback.format_list(traceback.extract_tb(exc_traceback))))
......@@ -881,6 +881,29 @@ def measureContour():
logger.debug("measureContour - wrapper : exiting")
return json.dumps(result)
@route( baseUrl+'/measureBox', name='measureBox', method='POST')
@enable_cors
def measureBox():
logger.debug("measureContour - wrapper : entering")
try:
body = byteify(json.loads(request.body.read()))
relFITSFilePath = rebuildFilename(body['relFITSFilePath'])
iFREQ = getIntValue(body['iFREQ'])
iRA0 = getIntValue(body['iRA0']) if 'iRA0' in body else None
iRA1 = getIntValue(body['iRA1']) if 'iRA1' in body else None
iDEC0 = getIntValue(body['iDEC0']) if 'iDEC0' in body else None
iDEC1 = getIntValue(body['iDEC1']) if 'iDEC1' in body else None
result = dm.measureBox(relFITSFilePath, iFREQ, iDEC0, iDEC1, iRA0, iRA1)
except Exception as e:
exc_type, exc_value, exc_traceback = sys.exc_info()
message = "%s ! %s" % (type(e), "".join(traceback.format_list(traceback.extract_tb(exc_traceback))))
logger.debug(message)
result = {"status": False, "message": message}
response.content_type = "application/json; charset=utf-8"
logger.debug("measureContour - wrapper : exiting")
return json.dumps(result)
"""
Given the values of a spectrum 'ydata' passed with the corresponding frequency values 'xdata'
......
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