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
c37b1b78
Commit
c37b1b78
authored
9 years ago
by
Branson Craig Stephens
Browse files
Options
Downloads
Patches
Plain Diff
Fixed some bugs with EMObservation creator.
parent
57b0d163
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gracedb/view_logic.py
+17
-10
17 additions, 10 deletions
gracedb/view_logic.py
with
17 additions
and
10 deletions
gracedb/view_logic.py
+
17
−
10
View file @
c37b1b78
...
...
@@ -26,7 +26,8 @@ from django.conf import settings
import
json
import
datetime
import
dateutil
#import dateutil
from
dateutil
import
parser
def
_createEventFromForm
(
request
,
form
):
saved
=
False
...
...
@@ -382,7 +383,12 @@ def create_emobservation(d, event, user):
except
:
raise
ValueError
(
'
Please specify an EM followup MOU group
'
)
emo
.
comment
=
d
.
get
(
'
comment
'
,
''
)
# XXX I have literally no idea why this is necessary.
# emo.comment = d.get('comment', '')
comment
=
d
.
get
(
'
comment
'
,
None
)
if
not
comment
:
comment
=
''
emo
.
comment
=
comment
# Assign RA and Dec, plus widths
try
:
...
...
@@ -461,15 +467,15 @@ def create_emobservation(d, event, user):
try
:
ra
=
float
(
raRealList
[
i
])
except
:
raise
ValueError
(
'
Cannot read RA list element %d of %s
'
%
(
i
,
emo
.
raList
))
raise
ValueError
(
'
Cannot read RA list element %d of %s
'
%
(
i
,
raList
))
try
:
dec
=
float
(
decRealList
[
i
])
except
:
raise
ValueError
(
'
Cannot read Dec list element %d of %s
'
%
(
i
,
emo
.
decList
))
raise
ValueError
(
'
Cannot read Dec list element %d of %s
'
%
(
i
,
decList
))
try
:
start_time
=
startTimeRealList
[
i
]
except
:
raise
ValueError
(
'
Cannot read GPStime list element %d of %s
'
%
(
i
,
emo
.
startTimeList
))
raise
ValueError
(
'
Cannot read GPStime list element %d of %s
'
%
(
i
,
startTimeList
))
# the widths list can have 1 member to cover all, or one for each
if
mList
==
1
:
j
=
0
...
...
@@ -478,22 +484,22 @@ def create_emobservation(d, event, user):
try
:
raWidth
=
float
(
rawRealList
[
j
])
except
:
raise
ValueError
(
'
Cannot read raWidth list element %d of %s
'
%
(
i
,
emo
.
raWidthList
))
raise
ValueError
(
'
Cannot read raWidth list element %d of %s
'
%
(
i
,
raWidthList
))
try
:
decWidth
=
float
(
decwRealList
[
j
])
except
:
raise
ValueError
(
'
Cannot read raWidth list element %d of %s
'
%
(
i
,
emo
.
decWidthList
))
raise
ValueError
(
'
Cannot read raWidth list element %d of %s
'
%
(
i
,
decWidthList
))
try
:
duration
=
int
(
durationRealList
[
j
])
except
:
raise
ValueError
(
'
Cannot read duration list element %d of %s
'
%
(
i
,
emo
.
durationList
))
raise
ValueError
(
'
Cannot read duration list element %d of %s
'
%
(
i
,
durationList
))
try
:
start_time
=
dateutil
.
parser
.
parse
(
start_time
)
start_time
=
parser
.
parse
(
start_time
)
except
:
raise
ValueError
(
'
Could not parse start time list element %d of %s
'
%
(
i
,
emo
.
duration
List
))
raise
ValueError
(
'
Could not parse start time list element %d of %s
'
%
(
i
,
startTimeReal
List
))
# Create footprint object
...
...
@@ -505,3 +511,4 @@ def create_emobservation(d, event, user):
emo
.
calculateCoveringRegion
()
emo
.
save
()
return
emo
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