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_fs
Commits
da7a0c0a
Commit
da7a0c0a
authored
Sep 08, 2025
by
Matthias Weidenthaler
Browse files
Added hdu argument to query_metadata function
parent
ac09dcfb
Changes
2
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
da7a0c0a
...
@@ -111,6 +111,7 @@ The helper will send HTTP requests to an external API. CSST_BACKEND_API_URL env
...
@@ -111,6 +111,7 @@ The helper will send HTTP requests to an external API. CSST_BACKEND_API_URL env
def
query_metadata
(
def
query_metadata
(
filter
:
Dict
[
str
,
Any
],
filter
:
Dict
[
str
,
Any
],
key
:
List
[
str
],
key
:
List
[
str
],
hdu
:
int
=
0
)
->
List
[
Dict
[
str
,
Any
]]:
)
->
List
[
Dict
[
str
,
Any
]]:
"""
"""
Query for file info by metadata values.
Query for file info by metadata values.
...
@@ -118,6 +119,7 @@ def query_metadata(
...
@@ -118,6 +119,7 @@ def query_metadata(
Args:
Args:
filter: The filter dict described below.
filter: The filter dict described below.
key: A list of string values, corresponding to metadata keys that should be included in the output.
key: A list of string values, corresponding to metadata keys that should be included in the output.
hdu: The hdu the filter & key arguments refer to. Default is 0. E.g. 0, 1.
Returns:
Returns:
A List[Dict] of matching documents containing a file_path value and the keys set as 'key' parameter under 'metadata'.
A List[Dict] of matching documents containing a file_path value and the keys set as 'key' parameter under 'metadata'.
E.g. with key = ["CABEND", "qc_status"]
E.g. with key = ["CABEND", "qc_status"]
...
...
csst_fs/catalog/metadata.py
View file @
da7a0c0a
...
@@ -5,6 +5,7 @@ from typing import Dict, Any, List
...
@@ -5,6 +5,7 @@ from typing import Dict, Any, List
def
query_metadata
(
def
query_metadata
(
filter
:
Dict
[
str
,
Any
],
filter
:
Dict
[
str
,
Any
],
key
:
List
[
str
],
key
:
List
[
str
],
hdu
:
int
=
0
)
->
List
[
Dict
[
str
,
Any
]]:
)
->
List
[
Dict
[
str
,
Any
]]:
"""
"""
Query for file info by metadata values.
Query for file info by metadata values.
...
@@ -12,6 +13,7 @@ def query_metadata(
...
@@ -12,6 +13,7 @@ def query_metadata(
Args:
Args:
filter: The filter dict described below.
filter: The filter dict described below.
key: A list of string values, corresponding to metadata keys that should be included in the output.
key: A list of string values, corresponding to metadata keys that should be included in the output.
hdu: The hdu the filter & key arguments refer to. Default is 0. E.g. 0, 1.
Returns:
Returns:
A List[Dict] of matching documents containing a file_path value and the keys set as 'key' parameter under 'metadata'.
A List[Dict] of matching documents containing a file_path value and the keys set as 'key' parameter under 'metadata'.
E.g. with key = ["dataset", "instrument", "obs_group", "obs_id"]
E.g. with key = ["dataset", "instrument", "obs_group", "obs_id"]
...
@@ -41,6 +43,7 @@ def query_metadata(
...
@@ -41,6 +43,7 @@ def query_metadata(
payload
=
{
payload
=
{
"filter"
:
filter
,
"filter"
:
filter
,
"key"
:
key
,
"key"
:
key
,
"hdu"
:
hdu
}
}
try
:
try
:
...
...
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