Datasets:
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: cc-by-4.0
|
| 3 |
+
task_categories:
|
| 4 |
+
- feature-extraction
|
| 5 |
+
tags:
|
| 6 |
+
- astronomy
|
| 7 |
+
- spectroscopy
|
| 8 |
+
- gaia
|
| 9 |
+
- lamost
|
| 10 |
+
- stellar-spectra
|
| 11 |
+
pretty_name: SpecCLIP Test Data
|
| 12 |
+
size_categories:
|
| 13 |
+
- 1K<n<10K
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
# SpecCLIP Test Data
|
| 17 |
+
|
| 18 |
+
Test data for [SpecCLIP](https://huggingface.co/astroshawn/SpecCLIP) - Cross-modal stellar spectral analysis.
|
| 19 |
+
|
| 20 |
+
## Dataset Description
|
| 21 |
+
|
| 22 |
+
This dataset contains paired Gaia XP and LAMOST LRS spectra for testing cross-modal retrieval and embedding analysis.
|
| 23 |
+
|
| 24 |
+
### Files
|
| 25 |
+
|
| 26 |
+
- **gaia_lamost_test_only.h5**: HDF5 file containing paired spectra
|
| 27 |
+
- `test/source_ids`: Gaia source identifiers
|
| 28 |
+
- `test/gaia_spectra`: Gaia XP spectra (N, 343)
|
| 29 |
+
- `test/lamost_spectra`: LAMOST LRS spectra (N, 1462)
|
| 30 |
+
|
| 31 |
+
## Usage
|
| 32 |
+
|
| 33 |
+
### Download
|
| 34 |
+
|
| 35 |
+
```python
|
| 36 |
+
from huggingface_hub import hf_hub_download
|
| 37 |
+
|
| 38 |
+
# Download test data
|
| 39 |
+
test_data_path = hf_hub_download(
|
| 40 |
+
repo_id="astroshawn/SpecCLIP-TestData-Small",
|
| 41 |
+
filename="gaia_lamost_test_only.h5",
|
| 42 |
+
repo_type="dataset",
|
| 43 |
+
local_dir="./test_data"
|
| 44 |
+
)
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
Or using CLI:
|
| 48 |
+
```bash
|
| 49 |
+
huggingface-cli download astroshawn/SpecCLIP-TestData-Small --local-dir ./test_data --repo-type dataset
|
| 50 |
+
```
|
| 51 |
+
|
| 52 |
+
### Load Data
|
| 53 |
+
|
| 54 |
+
```python
|
| 55 |
+
import h5py
|
| 56 |
+
import numpy as np
|
| 57 |
+
|
| 58 |
+
with h5py.File(test_data_path, 'r') as f:
|
| 59 |
+
source_ids = np.array(f['test/source_ids'][:])
|
| 60 |
+
gaia_spectra = np.array(f['test/gaia_spectra'][:])
|
| 61 |
+
lamost_spectra = np.array(f['test/lamost_spectra'][:])
|
| 62 |
+
|
| 63 |
+
print(f"Number of test samples: {len(source_ids)}")
|
| 64 |
+
print(f"Gaia XP spectra shape: {gaia_spectra.shape}")
|
| 65 |
+
print(f"LAMOST LRS spectra shape: {lamost_spectra.shape}")
|
| 66 |
+
```
|
| 67 |
+
|
| 68 |
+
## Use with SpecCLIP
|
| 69 |
+
|
| 70 |
+
This test data is used for:
|
| 71 |
+
- Building embedding databases for spectral retrieval
|
| 72 |
+
- Cross-modal spectrum prediction
|
| 73 |
+
- In-modal and cross-modal similarity search
|
| 74 |
+
|
| 75 |
+
See the [SpecCLIP model repository](https://github.com/Xiaosheng-Zhao/SpecCLIP) for usage examples.
|
| 76 |
+
|
| 77 |
+
## Citation
|
| 78 |
+
|
| 79 |
+
If you use this data, please cite the SpecCLIP paper.
|