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
ODA
api clients
oda_integral_wrapper
Commits
e14e62dc
Commit
e14e62dc
authored
Nov 06, 2022
by
Carlo Ferrigno
Browse files
Cleaning fits save for SPI-ACS
parent
e8d9ae86
Changes
1
Hide whitespace changes
Inline
Side-by-side
oda_integral_wrapper/wrapper.py
View file @
e14e62dc
...
...
@@ -1201,12 +1201,19 @@ class INTEGRALwrapper(object):
timepixr
=
0.5
dt
=
timedel
*
timepixr
hdu
.
header
[
'TSTART'
]
=
hdu
.
data
[
'TIME'
][
0
]
-
dt
hdu
.
header
[
'TSTOP'
]
=
hdu
.
data
[
'TIME'
][
-
1
]
+
dt
hdu
.
header
[
'TSTOP'
]
=
hdu
.
data
[
'TIME'
][
-
1
]
+
dt
hdu
.
header
[
'TFIRST'
]
=
hdu
.
data
[
'TIME'
][
0
]
-
dt
hdu
.
header
[
'TLAST'
]
=
hdu
.
data
[
'TIME'
][
-
1
]
+
dt
conversion
=
1
if
instrument
==
'SPI-ACS'
:
INTEGRALwrapper
.
__log
.
debug
(
'SPI-ACS times are in seconds in the header'
)
conversion
=
86400.
hdu
.
header
[
'TFIRST'
]
=
hdu
.
header
[
'TSTART'
]
hdu
.
header
[
'TLAST'
]
=
hdu
.
header
[
'TSTART'
]
#hdu.header['TSTART'] = hdu.header['TSTART'] / conversion
#hdu.header['TSTOP'] = hdu.header['TSTOP'] / conversion
else
:
hdu
.
header
[
'TSTART'
]
=
hdu
.
data
[
'TIME'
][
0
]
-
dt
hdu
.
header
[
'TSTOP'
]
=
hdu
.
data
[
'TIME'
][
-
1
]
+
dt
hdu
.
header
[
'TFIRST'
]
=
hdu
.
data
[
'TIME'
][
0
]
-
dt
hdu
.
header
[
'TLAST'
]
=
hdu
.
data
[
'TIME'
][
-
1
]
+
dt
hdu
.
header
[
'TELAPSE'
]
=
hdu
.
header
[
'TLAST'
]
-
hdu
.
header
[
'TFIRST'
]
ontime
=
0
...
...
@@ -1219,8 +1226,9 @@ class INTEGRALwrapper(object):
fits
.
writeto
(
lc_fn
,
hdu
.
data
,
header
=
hdu
.
header
,
overwrite
=
True
)
mjdref
=
float
(
hdu
.
header
[
'MJDREF'
])
tstart
=
float
(
hdu
.
header
[
'TSTART'
])
+
mjdref
tstop
=
float
(
hdu
.
header
[
'TSTOP'
])
+
mjdref
INTEGRALwrapper
.
__log
.
debug
(
'%g %g'
%
(
float
(
hdu
.
header
[
'TSTART'
])
,
float
(
hdu
.
header
[
'TSTOP'
])
))
tstart
=
float
(
hdu
.
header
[
'TSTART'
])
/
conversion
+
mjdref
tstop
=
float
(
hdu
.
header
[
'TSTOP'
])
/
conversion
+
mjdref
try
:
exposure
=
float
(
hdu
.
header
[
'EXPOSURE'
])
except
:
...
...
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