Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GraceDB Server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IGWN Computing and Software
GraceDB
GraceDB Server
Commits
fd83907e
Commit
fd83907e
authored
5 years ago
by
Brandon Piotrzkowski
Committed by
Alexander Pace
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add processing and validation in the API
parent
e2b06cb4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!30
WIP: Add RAVEN VOEvent variant
,
!29
Python3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gracedb/api/v1/events/views.py
+21
-2
21 additions, 2 deletions
gracedb/api/v1/events/views.py
with
21 additions
and
2 deletions
gracedb/api/v1/events/views.py
+
21
−
2
View file @
fd83907e
...
...
@@ -1689,6 +1689,15 @@ class VOEventList(InheritPermissionsAPIView):
Terrestrial
=
request
.
data
.
get
(
'
Terrestrial
'
,
None
)
MassGap
=
request
.
data
.
get
(
'
MassGap
'
,
None
)
# Get RAVEN data
ext_gcn
=
request
.
data
.
get
(
'
ext_gcn
'
,
None
)
ext_pipeline
=
request
.
data
.
get
(
'
ext_pipeline
'
,
None
)
ext_search
=
request
.
data
.
get
(
'
ext_search
'
,
None
)
time_coinc_far
=
request
.
data
.
get
(
'
time_coinc_far
'
,
None
)
space_coinc_far
=
request
.
data
.
get
(
'
space_coinc_far
'
,
None
)
comb_skymap_filename
=
request
.
data
.
get
(
'
comb_skymap_filename
'
,
None
)
delta_t
=
request
.
data
.
get
(
'
delta_t
'
,
None
)
# Get VOEvent types as a dict (key = short form, value = long form)
VOEVENT_TYPE_DICT
=
dict
(
VOEvent
.
VOEVENT_TYPE_CHOICES
)
...
...
@@ -1722,8 +1731,18 @@ class VOEventList(InheritPermissionsAPIView):
if
not
os
.
path
.
exists
(
skymap_file_path
):
error
=
True
msg
=
"
Skymap file {fname} does not exist
"
.
format
(
fname
=
skymap_filename
)
fname
=
skymap_filenamei
)
elif
time_coinc_far
or
space_coinc_far
:
if
not
ext_gcn
:
error
=
True
msg
=
"
External GCN ID not provided
"
elif
not
ext_pipeline
:
error
=
True
msg
=
"
External Pipeline not provided
"
elif
not
ext_search
:
error
=
True
msg
=
"
External Search not provided
"
# If there's an error, return a 400 response
if
error
:
return
Response
({
'
error
'
:
msg
},
status
=
status
.
HTTP_400_BAD_REQUEST
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment