Dataset Viewer
The dataset viewer is not available for this split.
Cannot extract the features (columns) for the split 'train' of the config 'default' of the dataset.
Error code:   FeaturesError
Exception:    ArrowTypeError
Message:      ("Expected bytes, got a 'float' object", 'Conversion failed for column metadata with type object')
Traceback:    Traceback (most recent call last):
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 151, in _generate_tables
                  pa_table = paj.read_json(
                File "pyarrow/_json.pyx", line 308, in pyarrow._json.read_json
                File "pyarrow/error.pxi", line 154, in pyarrow.lib.pyarrow_internal_check_status
                File "pyarrow/error.pxi", line 91, in pyarrow.lib.check_status
              pyarrow.lib.ArrowInvalid: JSON parse error: Column() changed from object to number in row 0
              
              During handling of the above exception, another exception occurred:
              
              Traceback (most recent call last):
                File "/src/services/worker/src/worker/job_runners/split/first_rows.py", line 228, in compute_first_rows_from_streaming_response
                  iterable_dataset = iterable_dataset._resolve_features()
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 3422, in _resolve_features
                  features = _infer_features_from_batch(self.with_format(None)._head())
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 2187, in _head
                  return next(iter(self.iter(batch_size=n)))
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 2391, in iter
                  for key, example in iterator:
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 1882, in __iter__
                  for key, pa_table in self._iter_arrow():
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 1904, in _iter_arrow
                  yield from self.ex_iterable._iter_arrow()
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 499, in _iter_arrow
                  for key, pa_table in iterator:
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 346, in _iter_arrow
                  for key, pa_table in self.generate_tables_fn(**gen_kwags):
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 181, in _generate_tables
                  pa_table = pa.Table.from_pandas(df, preserve_index=False)
                File "pyarrow/table.pxi", line 3874, in pyarrow.lib.Table.from_pandas
                File "/src/services/worker/.venv/lib/python3.9/site-packages/pyarrow/pandas_compat.py", line 611, in dataframe_to_arrays
                  arrays = [convert_column(c, f)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/pyarrow/pandas_compat.py", line 611, in <listcomp>
                  arrays = [convert_column(c, f)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/pyarrow/pandas_compat.py", line 598, in convert_column
                  raise e
                File "/src/services/worker/.venv/lib/python3.9/site-packages/pyarrow/pandas_compat.py", line 592, in convert_column
                  result = pa.array(col, type=type_, from_pandas=True, safe=safe)
                File "pyarrow/array.pxi", line 339, in pyarrow.lib.array
                File "pyarrow/array.pxi", line 85, in pyarrow.lib._ndarray_to_array
                File "pyarrow/error.pxi", line 91, in pyarrow.lib.check_status
              pyarrow.lib.ArrowTypeError: ("Expected bytes, got a 'float' object", 'Conversion failed for column metadata with type object')

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

DESI DR1 ELG Galaxy Spectra Dataset

This dataset contains 999 Emission Line Galaxy (ELG) spectra from the Dark Energy Spectroscopic Instrument (DESI) Data Release 1, along with associated metadata. This is a curated sample of high-quality galaxy spectra suitable for research and educational purposes in astronomy and cosmology.

Dataset Contents

  • metadata.csv - Galaxy properties and catalog information (999 galaxies + header)
  • spectrum_GALAXY_*.json - Individual spectrum files (999 files)
  • *.py - Analysis and visualization scripts

Metadata Columns (metadata.csv)

Column Description
targetid DESI target identifier
galaxy_type Galaxy type classification (ELG)
spectype Spectroscopic type (GALAXY)
ra, dec Right ascension and declination (degrees)
redshift Spectroscopic redshift
z_bin Redshift bin (0.6-0.8, 0.8-1.0)
survey DESI survey (main)
program Observing program (dark)
healpix HEALPix pixel ID
desi_target, bgs_target, mws_target, scnd_target DESI targeting bitmasks

Spectrum File Format

Each spectrum_GALAXY_*.json file contains:

{
  "metadata": {
    "sparcl_id": "UUID",
    "object_type": "GALAXY",
    "redshift": 0.6004,
    "redshift_err": 7.4e-05,
    "ra": 126.957,
    "dec": 3.269,
    "survey": "main",
    "data_release": "DESI-DR1",
    "targetid": 39636661465776861
  },
  "data": {
    "wavelength": [3600.0, 3600.8, ...],  // 7781 points, 3600-9824 Å
    "flux": [...],                        // Observed flux (10⁻¹⁷ erg/s/cm²/Å)
    "model": [...],                       // Best-fit model
    "inverse_variance": [...]             // 1/σ² for flux uncertainties
  }
}

Quick Start

Load metadata

import pandas as pd
metadata = pd.read_csv('metadata.csv')
print(f"Dataset contains {len(metadata)} ELG galaxies")
print(f"Redshift range: {metadata['redshift'].min():.3f} - {metadata['redshift'].max():.3f}")

Load a spectrum

import json
import numpy as np

# Load spectrum file
with open('spectrum_GALAXY_0.6004_7006c68c_20250811_152534.json', 'r') as f:
    spectrum = json.load(f)

# Extract data
wavelength = np.array(spectrum['data']['wavelength'])
flux = np.array(spectrum['data']['flux'])
model = np.array(spectrum['data']['model'])
redshift = spectrum['metadata']['redshift']

print(f"Galaxy at z={redshift:.4f}")
print(f"Spectrum covers {wavelength[0]:.0f}-{wavelength[-1]:.0f} Å")

Plot a spectrum

import matplotlib.pyplot as plt

plt.figure(figsize=(12, 6))
plt.plot(wavelength, flux, 'k-', alpha=0.7, label='Observed')
plt.plot(wavelength, model, 'r-', label='Model')
plt.xlabel('Wavelength (Å)')
plt.ylabel('Flux (10⁻¹⁷ erg/s/cm²/Å)')
plt.title(f'DESI ELG Spectrum (z={redshift:.4f})')
plt.legend()
plt.grid(True, alpha=0.3)
plt.show()

Analysis Scripts

  • plot_desi_spectra.py - Create multi-panel spectrum plots and redshift distributions
  • sample_elg_galaxies.py - Original sampling script for ELG selection
  • spectrum_downloader.py - Script used to download spectra from DESI archives

Dataset Statistics

  • Total galaxies: 999
  • Redshift range: 0.600 - 0.948
  • Spectral coverage: 3600 - 9824 Å (7781 wavelength points)
  • Galaxy type: Emission Line Galaxies (ELGs)
  • Survey: DESI Main Survey (dark time program)
Downloads last month
2