deepextractor.data.glitch_data¶
Utilities for downloading DeepExtractor glitch reconstructions from HuggingFace.
Module Contents¶
- deepextractor.data.glitch_data.download_glitch_data(data_dir: str | pathlib.Path = 'data/', include_derivatives: bool = False, force: bool = False) dict[str, pathlib.Path][source]¶
Download DeepExtractor glitch reconstructions from HuggingFace.
Downloads time-domain reconstructions of seven LIGO O3 glitch classes (35,000 samples total: Blip, Fast Scattering, Koi Fish, Low Frequency Burst, Scattered Light, Tomte, Whistle) from
tomdooney/deepextractor-glitch-reconstructionson HuggingFace.These reconstructions were produced by DeepExtractor and are suitable for training generative models such as GlitchGAN.
- Parameters:
data_dir – Directory to save downloaded files. Created if it does not exist.
include_derivatives – If
True, also download the first-order time-derivative array required for cDVGAN training (adds ~2.1 GB).force – If
True, re-download files even if they already exist locally.
- Returns:
Mapping of
{"samples", "labels", "label_order"}(and"derivatives"if requested) to their local file paths.- Return type:
Examples
>>> from deepextractor.data import download_glitch_data >>> paths = download_glitch_data("data/glitches/") >>> import numpy as np >>> X = np.load(paths["samples"]) # (35000, 8192) >>> y = np.load(paths["labels"]) # (35000, 7) >>> classes = np.load(paths["label_order"], allow_pickle=True)