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
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Michael William Coughlin
GraceDB Server
Commits
dc7e96dc
Commit
dc7e96dc
authored
10 years ago
by
Branson Craig Stephens
Browse files
Options
Downloads
Patches
Plain Diff
Added ingest_email prototype.
parent
451ec20b
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/management/commands/ingest_email.py
+59
-0
59 additions, 0 deletions
gracedb/management/commands/ingest_email.py
with
59 additions
and
0 deletions
gracedb/management/commands/ingest_email.py
0 → 100644
+
59
−
0
View file @
dc7e96dc
from
django.core.management.base
import
BaseCommand
from
gracedb.models
import
Event
,
EMBBEventLog
from
gracedb.models
import
EMFacility
from
django.contrib.auth.models
import
User
class
Command
(
BaseCommand
):
help
=
"
I am the email ingester!
"
def
handle
(
self
,
*
args
,
**
options
):
graceid
=
args
[
0
]
try
:
event
=
Event
.
getByGraceid
(
graceid
)
except
Exception
,
e
:
print
str
(
e
)
# create a log entry
eel
=
EMBBEventLog
(
event
=
event
)
eel
.
event
=
event
eel
.
submitter
=
User
.
objects
.
get
(
username
=
'
roy.williams@LIGO.org
'
)
# Assign a facility name
try
:
facility_name
=
'
CITT
'
facility
=
EMFacility
.
objects
.
get
(
shortName
=
facility_name
)
eel
.
facility
=
facility
except
Exception
,
e
:
print
str
(
e
)
# Assign a facility-specific footprint ID (if provided)
eel
.
footprintID
=
None
# Assign the EM spectrum string
eel
.
waveband
=
'
em.gamma
'
# Assign RA and Dec, plus widths
eel
.
ra
=
22
eel
.
dec
=
22
eel
.
raWidth
=
22
eel
.
decWidth
=
22
# Assign gpstime and duration.
eel
.
gpstime
=
22
eel
.
duration
=
22
# Assign EEL status and observation status.
eel
.
eel_status
=
'
FO
'
eel
.
obs_status
=
'
TE
'
eel
.
extra_info_dict
=
None
eel
.
comment
=
'
Hello
'
try
:
eel
.
save
()
except
Exception
as
e
:
print
str
(
e
)
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