Skip to content
GitLab
Explore
Projects
Groups
Snippets
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
d3678fb3
Commit
d3678fb3
authored
1 year ago
by
BO ZHANG
Browse files
Options
Download
Email Patches
Plain Diff
add DFS utils
parent
f263c7a0
dev
main
No related merge requests found
Pipeline
#2787
passed with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
csst_common/dfs.py
+19
-1
csst_common/dfs.py
with
19 additions
and
1 deletion
+19
-1
csst_common/dfs.py
+
19
-
1
View file @
d3678fb3
...
...
@@ -9,8 +9,9 @@ Modified-History:
2023-07-11, Bo Zhang, updated DFS
2023-12-08, Bo Zhang, tweaks
2023-12-20, Bo Zhang, do nothing in DFS.__init__()
2023-12-28, Bo Zhang, add DFS.rec_to_table and DFS.rec_to_dlist
"""
from
astropy.table
import
Table
from
csst_dfs_api.common.catalog
import
CatalogApi
from
csst_dfs_api.facility
import
(
Level0DataApi
,
...
...
@@ -48,6 +49,10 @@ class DFS:
def
L2DataApi
(
self
):
return
Level2DataApi
()
@
property
def
L2TypeApi
(
self
):
return
Level2TypeApi
()
@
property
def
OtherDataApi
(
self
):
return
OtherDataApi
()
...
...
@@ -55,3 +60,16 @@ class DFS:
@
property
def
CatApi
(
self
):
return
CatalogApi
()
@
staticmethod
def
rec_to_table
(
rec
):
assert
rec
[
"code"
]
==
0
,
rec
data
=
list
(
zip
(
*
rec
[
"data"
]))
colnames
=
rec
[
"columns"
]
return
Table
(
data
=
data
,
names
=
colnames
)
@
staticmethod
def
rec_to_dlist
(
rec
):
assert
rec
[
"code"
]
==
0
,
rec
colnames
=
rec
[
"columns"
]
return
[
dict
(
zip
(
colnames
,
_
))
for
_
in
rec
[
"data"
]]
This diff is collapsed.
Click to expand it.
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
Menu
Explore
Projects
Groups
Snippets