File size: 1,919 Bytes
8929897
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
---
license: cc-by-4.0
task_categories:
  - feature-extraction
tags:
  - astronomy
  - spectroscopy
  - gaia
  - lamost
  - stellar-spectra
pretty_name: SpecCLIP Test Data
size_categories:
  - 1K<n<10K
---

# SpecCLIP Test Data

Test data for [SpecCLIP](https://huggingface.co/astroshawn/SpecCLIP) - Cross-modal stellar spectral analysis.

## Dataset Description

This dataset contains paired Gaia XP and LAMOST LRS spectra for testing cross-modal retrieval and embedding analysis.

### Files

- **gaia_lamost_test_only.h5**: HDF5 file containing paired spectra
  - `test/source_ids`: Gaia source identifiers
  - `test/gaia_spectra`: Gaia XP spectra (N, 343)
  - `test/lamost_spectra`: LAMOST LRS spectra (N, 1462)

## Usage

### Download

```python
from huggingface_hub import hf_hub_download

# Download test data
test_data_path = hf_hub_download(
    repo_id="astroshawn/SpecCLIP-TestData-Small",
    filename="gaia_lamost_test_only.h5",
    repo_type="dataset",
    local_dir="./test_data"
)
```

Or using CLI:
```bash
huggingface-cli download astroshawn/SpecCLIP-TestData-Small --local-dir ./test_data --repo-type dataset
```

### Load Data

```python
import h5py
import numpy as np

with h5py.File(test_data_path, 'r') as f:
    source_ids = np.array(f['test/source_ids'][:])
    gaia_spectra = np.array(f['test/gaia_spectra'][:])
    lamost_spectra = np.array(f['test/lamost_spectra'][:])

print(f"Number of test samples: {len(source_ids)}")
print(f"Gaia XP spectra shape: {gaia_spectra.shape}")
print(f"LAMOST LRS spectra shape: {lamost_spectra.shape}")
```

## Use with SpecCLIP

This test data is used for:
- Building embedding databases for spectral retrieval
- Cross-modal spectrum prediction
- In-modal and cross-modal similarity search

See the [SpecCLIP model repository](https://github.com/Xiaosheng-Zhao/SpecCLIP) for usage examples.

## Citation

If you use this data, please cite the SpecCLIP paper.