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
csst-dfs
csst-dfs-commons
Commits
33d7e868
Commit
33d7e868
authored
Jun 17, 2022
by
Wei Shoulin
Browse files
ifs ver
parent
1c3e9698
Changes
4
Hide whitespace changes
Inline
Side-by-side
csst_dfs_commons/convert/date_utils.py
View file @
33d7e868
from
datetime
import
datetime
import
time
def
format_datetime
(
dt
):
return
dt
.
strftime
(
'%Y-%m-%d %H:%M:%S'
)
...
...
@@ -7,4 +8,10 @@ def format_date(dt):
return
dt
.
strftime
(
'%Y-%m-%d'
)
def
format_sql_datetime
(
dt
):
return
str
(
dt
)
if
isinstance
(
dt
,
datetime
)
else
dt
\ No newline at end of file
return
str
(
dt
)
if
isinstance
(
dt
,
datetime
)
else
dt
def
format_time_ms
(
float_time
):
local_time
=
time
.
localtime
(
float_time
)
data_head
=
time
.
strftime
(
"%Y-%m-%d %H:%M:%S"
,
local_time
)
data_secs
=
(
float_time
-
int
(
float_time
))
*
1000
return
"%s.%03d"
%
(
data_head
,
data_secs
)
\ No newline at end of file
csst_dfs_commons/models/ifs.py
View file @
33d7e868
import
dataclasses
from
email
import
header
from
ensurepip
import
version
from
typing
import
Dict
from
.common
import
BaseModel
,
default_field
...
...
@@ -13,6 +15,14 @@ class Level0PrcRecord(BaseModel):
prc_time
:
str
=
""
result_file_path
:
str
=
""
@
dataclasses
.
dataclass
class
Level0HeaderRecord
(
BaseModel
):
id
:
int
=
0
object_name
:
str
=
""
ra
:
float
=
0
dec
:
float
=
0
version
:
str
=
""
@
dataclasses
.
dataclass
class
Level0Record
(
BaseModel
):
id
:
int
=
0
...
...
@@ -20,7 +30,6 @@ class Level0Record(BaseModel):
obs_id
:
str
=
""
detector_no
:
str
=
""
obs_type
:
str
=
""
object_name
:
str
=
""
obs_time
:
str
=
""
exp_time
:
float
=
0
detector_status_id
:
int
=
0
...
...
csst_dfs_commons/models/mci.py
View file @
33d7e868
...
...
@@ -13,6 +13,14 @@ class Level0PrcRecord(BaseModel):
prc_time
:
str
=
""
result_file_path
:
str
=
""
@
dataclasses
.
dataclass
class
Level0HeaderRecord
(
BaseModel
):
id
:
int
=
0
object_name
:
str
=
""
ra
:
float
=
0
dec
:
float
=
0
version
:
str
=
""
@
dataclasses
.
dataclass
class
Level0Record
(
BaseModel
):
id
:
int
=
0
...
...
csst_dfs_commons/models/msc.py
View file @
33d7e868
...
...
@@ -81,9 +81,7 @@ class Level2Record(BaseModel):
@
dataclasses
.
dataclass
class
Level2CatalogRecord
(
BaseModel
):
source_id
:
int
=
0
obs_id
:
str
=
""
detector_no
:
str
=
""
level2_id
:
int
=
0
seq
:
int
=
0
flux_aper
:
list
=
dataclasses
.
field
(
default_factory
=
list
)
fluxerr_aper
:
list
=
dataclasses
.
field
(
default_factory
=
list
)
...
...
@@ -238,9 +236,11 @@ class Level2CatalogRecord(BaseModel):
disk_theta_world
:
float
=
-
1
disk_thetaerr_world
:
float
=
-
1
disk_theta_j2000
:
float
=
-
1
obs_time
:
str
=
''
brick_id_8
:
int
=
0
brick_id_16
:
int
=
0
NS8HIdx
:
int
=
0
NS16HIdx
:
int
=
0
NS32HIdx
:
int
=
0
NS64HIdx
:
int
=
0
create_time
:
str
=
''
@
dataclasses
.
dataclass
class
Level1PrcRecord
(
BaseModel
):
...
...
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