Commit a0ec1b3d authored by BO ZHANG's avatar BO ZHANG 🏀
Browse files

add dm.link_data

parent b385a61b
......@@ -814,6 +814,24 @@ class CsstMsDataManager:
):
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
def from_dfs(
obs_id="100000100",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment