File size: 5,376 Bytes
e756a5b 39c39bf e756a5b 39c39bf e756a5b 39c39bf e756a5b 39c39bf e756a5b 39c39bf e756a5b 39c39bf e756a5b 39c39bf e756a5b 39c39bf e756a5b 39c39bf e756a5b e6ce039 e756a5b 39c39bf e756a5b e6ce039 e756a5b 39c39bf e756a5b 39c39bf e756a5b 39c39bf | 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 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | ---
license: other
license_name: sdrbench
license_link: https://sdrbench.github.io/
pretty_name: "SDRBench: NYX"
tags:
- scientific-data
- lossy-compression
- sdrbench
- hpc
- sz3
configs:
- config_name: files
data_files: files.jsonl
default: true
---
# SDRBench — NYX
Cosmology: adaptive-mesh hydrodynamics + N-body simulation (Nyx), 512 x 512 x 512, single precision, little-endian.
> **Raw binary arrays, not an Arrow/Parquet dataset.** `datasets.load_dataset("sdrbench/nyx")` returns the table of files (`files.jsonl`: path, dtype, shape, sha256). Read the arrays with the `sdrbench` package or `hf_hub_download` + numpy as shown below.
This repository is an **unmodified mirror** of the NYX data of [SDRBench](https://sdrbench.github.io/datasets.html), the
Scientific Data Reduction Benchmark. The originals are hosted by Argonne National Laboratory on Globus;
every archive was unpacked and its files uploaded byte-for-byte (sha256 verified) (revision `e6ce039140`). `metadata/` holds
the original SDRBench property and template files. Kept in sync automatically by
[szcompressor/sdrbench](https://github.com/szcompressor/sdrbench).
- **Data provider:** Zarija Lukic (LBNL)
- **Size:** 6.4 GB in 2 variant(s)
- **Format:** raw little-endian binary, C order (slowest dimension first); dtype and shape per field below
## Usage
```bash
pip install "sdrbench[sz3]" # sdrbench + pysz (SZ3)
```
```python
import numpy as np
import sdrbench
from pysz import sz, szConfig, szErrorBoundMode
ds = sdrbench.dataset("nyx") # default variant "original"
print(ds.fields)
x = ds["baryon_density"] # numpy array, dtype <f4, shape (512, 512, 512)
# compress with SZ3 (pysz) at a 1e-3 value-range-relative error bound
conf = szConfig()
conf.errorBoundMode = szErrorBoundMode.REL
conf.relErrorBound = 1e-3
compressed, ratio = sz.compress(np.ascontiguousarray(x), conf)
y, _ = sz.decompress(compressed, x.dtype.type, x.shape)
max_err, psnr, nrmse = sz.verify(np.asarray(x), y)
print(f"ratio {ratio:.1f}x, PSNR {psnr:.1f} dB, max error {max_err:.3g}")
```
Files are fetched on first use (in parallel with `ds.download("data/")`) and cached, pinned to the revision
of the installed `sdrbench` release; if Hugging Face is unreachable the package falls back to the original
archive on Globus. Existing local SDRBench copies can be used with `sdrbench.dataset("nyx", root="/path")`.
Without the package, with `huggingface_hub` and numpy only:
```python
from huggingface_hub import hf_hub_download
import numpy as np
p = hf_hub_download("sdrbench/nyx", "512x512x512/baryon_density.f32", repo_type="dataset", revision="e6ce03914098d6dcdf160cb3fe567e7c784c6edf")
x = np.fromfile(p, dtype="<f4").reshape((512, 512, 512))
```
## Variants and fields
### `original` (default)
`sdrbench.dataset("nyx", "original")` — folder `512x512x512/` — 7 files, 3.2 GB, from [SDRBENCH-EXASKY-NYX-512x512x512.tar.gz](https://g-d0cd3f.fd635.8443.data.globus.org/raw-data/EXASKY/NYX/SDRBENCH-EXASKY-NYX-512x512x512.tar.gz).
Six fields: baryon and dark-matter density, temperature, velocities.
| Field | dtype | Shape (C order) | File |
|---|---|---|---|
| `baryon_density` | `<f4` | 512 x 512 x 512 | `512x512x512/baryon_density.f32` |
| `dark_matter_density` | `<f4` | 512 x 512 x 512 | `512x512x512/dark_matter_density.f32` |
| `temperature` | `<f4` | 512 x 512 x 512 | `512x512x512/temperature.f32` |
| `velocity_x` | `<f4` | 512 x 512 x 512 | `512x512x512/velocity_x.f32` |
| `velocity_y` | `<f4` | 512 x 512 x 512 | `512x512x512/velocity_y.f32` |
| `velocity_z` | `<f4` | 512 x 512 x 512 | `512x512x512/velocity_z.f32` |
Other files: `512x512x512/template_data.txt`
### `log`
`sdrbench.dataset("nyx", "log")` — folder `512x512x512_log/` — 6 files, 3.2 GB, from [SDRBENCH-EXASKY-NYX-512x512x512_log.tar.gz](https://g-d0cd3f.fd635.8443.data.globus.org/raw-data/EXASKY/NYX/SDRBENCH-EXASKY-NYX-512x512x512_log.tar.gz).
The same fields with the two densities log10-transformed (recommended for visualization).
| Field | dtype | Shape (C order) | File |
|---|---|---|---|
| `baryon_density_log10` | `<f4` | 512 x 512 x 512 | `512x512x512_log/baryon_density_log10.f32` |
| `dark_matter_density_log10` | `<f4` | 512 x 512 x 512 | `512x512x512_log/dark_matter_density_log10.f32` |
| `temperature` | `<f4` | 512 x 512 x 512 | `512x512x512_log/temperature.f32` |
| `velocity_x` | `<f4` | 512 x 512 x 512 | `512x512x512_log/velocity_x.f32` |
| `velocity_y` | `<f4` | 512 x 512 x 512 | `512x512x512_log/velocity_y.f32` |
| `velocity_z` | `<f4` | 512 x 512 x 512 | `512x512x512_log/velocity_z.f32` |
## Citation
Please cite SDRBench; `sdrbench cite nyx` prints it:
```bibtex
@inproceedings{zhao2020sdrbench,
title = {{SDRBench}: Scientific Data Reduction Benchmark for Lossy Compressors},
author = {Zhao, Kai and Di, Sheng and Liang, Xin and Li, Sihuan and Tao, Dingwen and Chen, Zizhong and Cappello, Franck},
booktitle = {2020 IEEE International Conference on Big Data (Big Data)},
pages = {2716--2724},
year = {2020}
}
```
## License and terms
The data are distributed by the SDRBench team for research use under the terms of the original
data providers listed above (see the [SDRBench website](https://sdrbench.github.io/datasets.html)); please acknowledge them as
requested. Rights remain with the data providers.
|