Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Liu Dezi
csst_msc_sim
Commits
3d7404e7
Commit
3d7404e7
authored
Mar 31, 2024
by
Fang Yuedong
Browse files
bug fix: datetime conversion in ImageHeader.py
parent
964a402e
Changes
1
Hide whitespace changes
Inline
Side-by-side
ObservationSim/Config/Header/ImageHeader.py
View file @
3d7404e7
...
@@ -352,7 +352,7 @@ def generatePrimaryHeader(xlen = 9216, ylen = 9232, pointNum = '1', ra = 60, dec
...
@@ -352,7 +352,7 @@ def generatePrimaryHeader(xlen = 9216, ylen = 9232, pointNum = '1', ra = 60, dec
# ccdnum = str(k)
# ccdnum = str(k)
datetime_obs
=
datetime
.
utcfromtimestamp
(
time_pt
)
datetime_obs
=
datetime
.
utcfromtimestamp
(
time_pt
)
datetime_obs
=
datetime
_obs
.
replace
(
microsecond
=
round
(
datetime_obs
.
microsecond
,
-
5
))
datetime_obs
=
datetime
.
utcfromtimestamp
(
np
.
round
(
datetime_obs
.
timestamp
(),
1
))
# date_obs = datetime_obs.strftime("%y%m%d")
# date_obs = datetime_obs.strftime("%y%m%d")
# time_obs = datetime_obs.strftime("%H%M%S%f")[:-5]
# time_obs = datetime_obs.strftime("%H%M%S%f")[:-5]
...
@@ -558,9 +558,11 @@ def generateExtensionHeader(chip, xlen = 9216, ylen = 9232,ra = 60, dec = -40, p
...
@@ -558,9 +558,11 @@ def generateExtensionHeader(chip, xlen = 9216, ylen = 9232,ra = 60, dec = -40, p
# t_s2 = str(tend_read.datetime).split()
# t_s2 = str(tend_read.datetime).split()
# h_ext['ROTIME1'] = t_s2[0] + 'T' + t_s2[1]
# h_ext['ROTIME1'] = t_s2[0] + 'T' + t_s2[1]
tstart1
=
tstart
.
datetime
.
replace
(
microsecond
=
round
(
tstart
.
datetime
.
microsecond
,
-
5
))
# tstart1=tstart.datetime.replace(microsecond=round(tstart.datetime.microsecond, -5))
tstart1
=
datetime
.
utcfromtimestamp
(
np
.
round
(
datetime
.
utcfromtimestamp
(
tstart
.
unix
).
timestamp
(),
1
))
h_ext
[
'ROTIME0'
]
=
tstart1
.
strftime
(
"%Y-%m-%dT%H:%M:%S.%f"
)[:
-
5
]
h_ext
[
'ROTIME0'
]
=
tstart1
.
strftime
(
"%Y-%m-%dT%H:%M:%S.%f"
)[:
-
5
]
tend_read1
=
tend_read
.
datetime
.
replace
(
microsecond
=
round
(
tend_read
.
datetime
.
microsecond
,
-
5
))
# tend_read1 = tend_read.datetime.replace(microsecond=round(tend_read.datetime.microsecond, -5))
tend_read1
=
datetime
.
utcfromtimestamp
(
np
.
round
(
datetime
.
utcfromtimestamp
(
tend_read
.
unix
).
timestamp
(),
1
))
h_ext
[
'ROTIME1'
]
=
tend_read1
.
strftime
(
"%Y-%m-%dT%H:%M:%S.%f"
)[:
-
5
]
h_ext
[
'ROTIME1'
]
=
tend_read1
.
strftime
(
"%Y-%m-%dT%H:%M:%S.%f"
)[:
-
5
]
# h_ext['POS_ANG'] = pa
# h_ext['POS_ANG'] = pa
header_wcs
=
WCS_def
(
xlen
=
xlen
,
ylen
=
ylen
,
gapy
=
898.0
,
gapx1
=
534
,
gapx2
=
1309
,
ra_ref
=
ra
,
dec_ref
=
dec
,
pa
=
pa
,
pixel_scale
=
pixel_scale
,
pixel_size
=
pixel_size
,
header_wcs
=
WCS_def
(
xlen
=
xlen
,
ylen
=
ylen
,
gapy
=
898.0
,
gapx1
=
534
,
gapx2
=
1309
,
ra_ref
=
ra
,
dec_ref
=
dec
,
pa
=
pa
,
pixel_scale
=
pixel_scale
,
pixel_size
=
pixel_size
,
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment