Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GWalarm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
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
Borja Sorazu
GWalarm
Commits
6cf9f621
Commit
6cf9f621
authored
5 years ago
by
Christian
Browse files
Options
Downloads
Patches
Plain Diff
Moved formatting of some parameters to main app file
parent
b464e59f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gcn_test.py
+4
-4
4 additions, 4 deletions
gcn_test.py
with
4 additions
and
4 deletions
gcn_test.py
+
4
−
4
View file @
6cf9f621
...
@@ -168,7 +168,7 @@ def process_gcn(payload, root):
...
@@ -168,7 +168,7 @@ def process_gcn(payload, root):
table
=
h5file
.
get_node
(
"
/events
"
,
'
EventSimulation
'
)
table
=
h5file
.
get_node
(
"
/events
"
,
'
EventSimulation
'
)
det_event
=
table
.
row
det_event
=
table
.
row
for
key
,
value
in
params
.
items
():
for
key
,
value
in
params
.
items
():
#
print(key, '=', value)
#
print(key, '=', value)
if
key
==
'
FAR
'
:
if
key
==
'
FAR
'
:
per_yr
=
float
(
value
)
*
scipy
.
constants
.
year
per_yr
=
float
(
value
)
*
scipy
.
constants
.
year
if
per_yr
<=
1
:
if
per_yr
<=
1
:
...
@@ -181,7 +181,7 @@ def process_gcn(payload, root):
...
@@ -181,7 +181,7 @@ def process_gcn(payload, root):
val
=
"
One every
"
+
str
(
"
{0:.3f}
"
.
format
(
oneinyr
))
+
"
yrs
"
val
=
"
One every
"
+
str
(
"
{0:.3f}
"
.
format
(
oneinyr
))
+
"
yrs
"
det_event
[
key
]
=
val
det_event
[
key
]
=
val
descriptions
[
key
]
=
descs
[
i
]
descriptions
[
key
]
=
descs
[
i
]
el
if
key
==
'
Pkt_Ser_Num
'
:
if
key
==
'
Pkt_Ser_Num
'
:
key
=
'
Revision
'
key
=
'
Revision
'
det_event
[
key
]
=
value
det_event
[
key
]
=
value
descriptions
[
key
]
=
descs
[
i
]
descriptions
[
key
]
=
descs
[
i
]
...
@@ -223,7 +223,7 @@ def process_gcn(payload, root):
...
@@ -223,7 +223,7 @@ def process_gcn(payload, root):
det_formtime
=
one
+
'
at
'
+
two
det_formtime
=
one
+
'
at
'
+
two
det_event
[
'
DetectionTime
'
]
=
det_formtime
det_event
[
'
DetectionTime
'
]
=
det_formtime
upt_time
=
root
.
find
(
'
.//Date
'
)
upt_time
=
root
.
find
(
'
.//Date
'
)
upt_text
=
upt_time
.
text
upt_text
=
upt_time
.
text
[
one1
,
two1
]
=
upt_text
.
split
(
'
T
'
)
[
one1
,
two1
]
=
upt_text
.
split
(
'
T
'
)
...
@@ -271,6 +271,6 @@ def process_gcn(payload, root):
...
@@ -271,6 +271,6 @@ def process_gcn(payload, root):
#testing
#testing
#os.chdir('./event_data')
#os.chdir('./event_data')
#import lxml
#import lxml
#payload = open('
PreviousEventToRead
.xml', 'rb').read()
#payload = open('
S190828l-1-Preliminary
.xml', 'rb').read()
#root = lxml.etree.fromstring(payload)
#root = lxml.etree.fromstring(payload)
#process_gcn(payload, root)
#process_gcn(payload, root)
\ No newline at end of file
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