Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Caillat Michel
yafits
Commits
db09e1fc
Commit
db09e1fc
authored
Dec 09, 2019
by
Caillat Michel
Browse files
Renamed some parameters in order to follow the naming standards and added a measureBox method
parent
22c14d01
Changes
1
Hide whitespace changes
Inline
Side-by-side
yafitss/serverWsgi.py
View file @
db09e1fc
...
...
@@ -560,12 +560,12 @@ def getSumOverSliceRectArea():
logger
.
debug
(
"getSumOverSliceRectArea - wrapper : entering"
)
try
:
relFITSFilePath
=
rebuildFilename
(
request
.
GET
[
'relFITSFilePath'
])
DEC
Pix
0
=
getIntValue
(
request
.
GET
[
'DEC
Pix
0'
])
DEC
Pix
1
=
getIntValue
(
request
.
GET
[
'DEC
Pix
1'
])
RA
Pix
0
=
getIntValue
(
request
.
GET
[
'RA
Pix
0'
])
RA
Pix
1
=
getIntValue
(
request
.
GET
[
'RA
Pix
1'
])
i
DEC0
=
getIntValue
(
request
.
GET
[
'
i
DEC0'
])
i
DEC1
=
getIntValue
(
request
.
GET
[
'
i
DEC1'
])
i
RA0
=
getIntValue
(
request
.
GET
[
'
i
RA0'
])
i
RA1
=
getIntValue
(
request
.
GET
[
'
i
RA1'
])
iFREQ
=
getIntValue
(
request
.
GET
[
'iFREQ'
])
result
=
json
.
dumps
(
dm
.
getSumOverSliceRectArea
(
relFITSFilePath
,
iFREQ
,
RA
Pix
0
,
RA
Pix
1
,
DEC
Pix
0
,
DEC
Pix
1
))
result
=
json
.
dumps
(
dm
.
getSumOverSliceRectArea
(
relFITSFilePath
,
iFREQ
,
i
RA0
,
i
RA1
,
i
DEC0
,
i
DEC1
))
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'
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment