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
8630bd81
Commit
8630bd81
authored
Feb 02, 2026
by
BO ZHANG
🏀
Browse files
add p.add_metadata: process table HDUs
parent
33b78d87
Pipeline
#12145
passed with stage
in 0 seconds
Changes
1
Pipelines
2
Show whitespace changes
Inline
Side-by-side
csst_common/pipeline.py
View file @
8630bd81
...
...
@@ -29,9 +29,10 @@ import joblib
import
csst_dfs_client
import
csst_fs
from
csst_fs
import
s3_fs
from
csst_msc_brick
import
BrickSystem
from
.ccds
import
CCDS
from
.utils
import
retry
from
.utils
import
retry
,
table_to_hdu
,
hdu_to_table
from
.file
import
File
from
.logger
import
get_logger
from
.status
import
CsstStatus
,
CsstResult
...
...
@@ -466,6 +467,7 @@ class Pipeline:
obs_date
:
Optional
[
str
]
=
None
,
parent_uuids
:
Optional
[
list
]
=
None
,
# 父数据产品UUID列表
table_hdu_idx_list
:
Optional
[
list
]
=
None
,
# 包含BinTableHDU的索引列表
nside
:
Optional
[
int
]
=
256
,
# HEALPix nside,每种数据产品的nside可以不一样
):
meta_kwargs
=
dict
(
# 编排信息
...
...
@@ -516,11 +518,31 @@ class Pipeline:
meta
:
dict
=
io
.
generate_meta
(
**
meta_kwargs
)
self
.
logger
.
info
(
f
"Metadata:
{
meta
}
"
)
hdulist
:
fits
.
HDUList
=
io
.
append_meta
(
hdulist
,
meta
)
hdulist
.
flush
()
# 处理BinTableHDU
bs
=
BrickSystem
(
nside
=
nside
)
for
idx
in
table_hdu_idx_list
or
[]:
# TODO: BZ
pass
t
=
hdu_to_table
(
hdulist
[
idx
])
ra
=
t
[
"ra"
]
dec
=
t
[
"dec"
]
extra_info_list
=
[]
for
this_ra
,
this_dec
in
zip
(
ra
,
dec
):
extra_info_list
.
append
(
dict
(
healpix
=
bs
.
get_hosting_brick_given_coordinate
(
ra_in_deg
=
this_ra
,
dec_in_deg
=
this_dec
,
),
data_uuid
=
meta
[
"data_uuid"
],
)
)
t_extra_info_list
=
table
.
Table
(
extra_info_list
)
t_with_extra_info_list
=
table
.
hstack
([
t
,
t_extra_info_list
])
hdulist
[
idx
]
=
table_to_hdu
(
t_with_extra_info_list
,
name
=
hdulist
[
idx
].
name
,
)
hdulist
.
flush
()
return
meta
def
query_ref_cat
(
...
...
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