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
a0ec1b3d
Commit
a0ec1b3d
authored
Feb 20, 2023
by
BO ZHANG
🏀
Browse files
add dm.link_data
parent
b385a61b
Changes
1
Hide whitespace changes
Inline
Side-by-side
csst_common/data_manager.py
View file @
a0ec1b3d
...
@@ -814,6 +814,24 @@ class CsstMsDataManager:
...
@@ -814,6 +814,24 @@ class CsstMsDataManager:
):
):
pass
pass
@
staticmethod
def
link_data
(
obs_id
=
"100000100"
,
dfs_root
=
"/dfsroot"
,
dir_l0
=
"/L1Pipeline/L0"
):
# query for L0 data
print
(
f
"Query obs_id=
{
obs_id
}
..."
,
end
=
""
)
recs
=
Level0DataApi
().
find
(
obs_id
=
obs_id
)
print
(
f
"
{
recs
[
'totalCount'
]
}
records obtained!"
)
assert
recs
[
"code"
]
==
0
assert
recs
[
"totalCount"
]
>
0
# make symbolic links
print
(
"Making symbolic links ..."
)
for
rec
in
recs
:
os
.
symlink
(
src
=
os
.
path
.
join
(
dfs_root
,
rec
.
file_path
),
dst
=
os
.
path
.
join
(
dir_l0
,
os
.
path
.
basename
(
rec
.
file_path
)),
)
@
staticmethod
@
staticmethod
def
from_dfs
(
def
from_dfs
(
obs_id
=
"100000100"
,
obs_id
=
"100000100"
,
...
...
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