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-pipeline
csst_common
Commits
ce63aa9e
Commit
ce63aa9e
authored
Nov 20, 2022
by
BO ZHANG
🏀
Browse files
added dm.dfs_l0_check_all()
parent
6427f7d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
csst_common/data_manager.py
View file @
ce63aa9e
...
@@ -574,7 +574,7 @@ class CsstMsDataManager:
...
@@ -574,7 +574,7 @@ class CsstMsDataManager:
def
dfs_l0_query
(
self
,
obs_id
:
str
=
"100000100"
):
def
dfs_l0_query
(
self
,
obs_id
:
str
=
"100000100"
):
""" Query L0 data from DFS. """
""" Query L0 data from DFS. """
result
=
self
.
dfs_L0DataApi
.
find
(
obs_id
=
str
(
obs_id
))
result
=
self
.
dfs_L0DataApi
.
find
(
obs_id
=
str
(
obs_id
))
print
(
f
"
{
result
[
'totalCount'
]
}
entrie
s returned from DFS."
)
print
(
f
"
{
result
[
'totalCount'
]
}
record
s returned from DFS."
)
if
not
result
[
"code"
]
==
0
:
if
not
result
[
"code"
]
==
0
:
raise
ValueError
(
f
"DFS returns non-zero code! (
{
result
[
'code'
]
}
)"
)
raise
ValueError
(
f
"DFS returns non-zero code! (
{
result
[
'code'
]
}
)"
)
tbl
=
Table
([
_
.
__dict__
for
_
in
result
[
"data"
]])
tbl
=
Table
([
_
.
__dict__
for
_
in
result
[
"data"
]])
...
@@ -586,6 +586,18 @@ class CsstMsDataManager:
...
@@ -586,6 +586,18 @@ class CsstMsDataManager:
self
.
logger_ppl
.
warning
(
f
"Record not found for detector
{
detector
:
02
d
}
and obs_type
{
obs_type
}
"
)
self
.
logger_ppl
.
warning
(
f
"Record not found for detector
{
detector
:
02
d
}
and obs_type
{
obs_type
}
"
)
return
tbl
return
tbl
def
dfs_l0_check_all
(
self
):
""" Check all C5.2 L0 data is available in DFS. """
is_good
=
True
for
obs_id
in
range
(
100000020
,
100000155
):
tbl
=
self
.
dfs_l0_query
(
obs_id
=
f
"
{
obs_id
}
"
)
if
len
(
tbl
)
==
60
:
self
.
logger_ppl
.
info
(
f
"DFS returns
{
len
(
tbl
)
}
records for obs_id=
{
obs_id
}
"
)
else
:
is_good
=
False
self
.
logger_ppl
.
warning
(
f
"DFS returns
{
len
(
tbl
)
}
records for obs_id=
{
obs_id
}
"
)
return
is_good
def
dfs_l1_query
(
self
,
obs_id
,
detector
):
def
dfs_l1_query
(
self
,
obs_id
,
detector
):
""" Query L1 data from DFS. """
""" Query L1 data from DFS. """
pass
pass
...
...
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