Team Ai
Datasetpublic

RGES-PIT/MachineLearning

Machine Learning Tier This dataset is a collection of synthetic microlensing light curves from the Nancy Grace Roman Space Telescope Galactic Bulge Time Domain Survey. It is intended for the training and benchmarking of machine learning models for microlensing event classification, parameter estimation, and anomaly detection. The raw distribution of event properties is not representative of what Roman will see, but should span a statistically larger set of events. More… See the full description on the dataset page: https://huggingface.co/datasets/RGES-PIT/MachineLearning.

sourceHugging Facecc0-1.0updated 2mo agoView on Hugging Face
1likes1.5kdownloads
Dataset Card

Machine Learning Tier

This dataset is a collection of synthetic microlensing light curves from the Nancy Grace Roman Space Telescope Galactic Bulge Time Domain Survey. It is intended for the training and benchmarking of machine learning models for microlensing event classification, parameter estimation, and anomaly detection.

The raw distribution of event properties is not representative of what Roman will see, but should span a statistically larger set of events. More representative samples can be drawn using the final_weight column, which is roughly proportional to the rate at which events occur relative to others in their class.

The machine learning tier data is provided as a set of normalized tables in Parquet format: RMDC26_ML_Data_obs.parquet, RMDC26_ML_Data_meta.parquet, and RMDC26_ML_Data_epoch.parquet.

Entity-Relationship Diagram

┌───────────────────┐        ┌───────────────────┐        ┌───────────────────┐
│     metadata      │        │   observations    │        │      epochs       │
├───────────────────┤        ├───────────────────┤        ├───────────────────┤
│ event_id (PK)     │◄───────├ event_id (FK)     │    ┌──►│ epoch_id (PK)     │
│ name              │        │ epoch_id (FK) ────┼────┘   │ bjd               │
│ sim_label         │        │ filt              │        │ obs_x             │
│ tE_helio          │        │ flux_uJy          │        │ obs_y             │
│ u0lens1           │        │ flux_err_uJy      │        │ obs_z             │
│ …(physical params)│        │ true_flux_uJy     │        └───────────────────┘
└───────────────────┘        │ saturation_flag   │
                             └───────────────────┘

Relationships:

  • —observations → metadata: many-to-one on event_id (each event has one metadata record)
  • —observations → epochs: many-to-one on epoch_id (each epoch has many observations)
  • —To reconstruct a full lightcurve: join all three tables on event_id and epoch_id

Tables

1. Observations Table (_obs.parquet)

Contains the primary time-series data for all events.

Column NameData TypeDescription
event_idint64Unique event identifier.
epoch_idint64Identifier for the specific observation epoch.
filtstringFilter used for the observation. Values: F087, F146, F213.
flux_uJyfloat64Measured flux in microjanskys (μJy).
flux_err_uJyfloat64Uncertainty in the measured flux in μJy.
true_flux_uJyfloat64True flux in microjanskys (μJy).
saturation_flagfloat64Saturation flag: 0 = unsaturated, 1 = saturated.

2. Metadata Table (_meta.parquet)

Contains the simulated physical parameters and lensing variables for each event.

Column NameData TypeDescription
namestringUnique event identifier (e.g., RMDC26_XXXXXX).
event_idint64Integer ID matching the observations table.
sim_labelstringSimulation category (e.g., RMDC26_1S1L_ML).
SubRunfloat64Sub-run identifier.
Fieldfloat64Field identifier.
EventIDfloat64Event ID.
final_weightfloat64Population weight for the event.
ObsGroup_0_chi2float64For binary events, the $\Delta\chi^2$ between the best-fitting single-lens (PSPL) model and the true simulated model ($\chi^2{\text{PSPL\fit}} - \chi^2{\text{true}}$). For single-source single-lens events, this instead stores the $\Delta\chi^2$ of the true simulated model vs a flat baseline fit ($\chi^2{\text{flat}} - \chi^2_{\text{true}}$).
is_out_of_seasonbooleanFlag indicating whether the event peak ($t_0$) falls in a seasonal gap (when Roman cannot observe the bulge).
t0lens1float64Time of closest approach for the primary lens.
tE_reffloat64Einstein timescale (observer reference frame).
tE_heliofloat64Einstein timescale (barycentric frame).
u0lens1float64Impact parameter.
rhofloat64Ratio of source radius to the Einstein ring radius.
piEfloat64Microlens parallax magnitude.
piEEfloat64Parallax-East term. In ecliptic coordinates.
piENfloat64Parallax-North term. In ecliptic coordinates.
piEllfloat64Parallax-component parallel to solar acceleration.
piErpfloat64Parallax-component perpendicular to solar acceleration.
rEfloat64Einstein radius of the primary lens mass (AU).
thetaEfloat64Einstein angular radius of the primary lens mass (mas).
ra_degfloat64Event right ascension in degrees.
dec_degfloat64Event declination in degrees.
galactic_lfloat64Galactic longitude (degrees).
galactic_bfloat64Galactic latitude (degrees).
fs_F146float64Source flux fraction in F146.
fs_F087float64Source flux fraction in F087.
fs_F213float64Source flux fraction in F213.
fs2_F146float64Second source flux fraction in F146.
fs2_F087float64Second source flux fraction in F087.
fs2_F213float64Second source flux fraction in F213.
Lens_F146float64Lens magnitude in F146.
Lens_F087float64Lens magnitude in F087.
Lens_F213float64Lens magnitude in F213.
Source_F146float64Source magnitude in F146.
Source_F087float64Source magnitude in F087.
Source_F213float64Source magnitude in F213.
Source2_F146float64Second source magnitude in F146.
Source2_F087float64Second source magnitude in F087.
Source2_F213float64Second source magnitude in F213.
Source_Is_Binaryfloat64Flag indicating if the source is binary.
Source_qfloat64Mass ratio of the binary source.
Source_combined_logPfloat64log period/days of binary source.
Source_total_massfloat64Total mass of binary source (MSun).
Source2_rhofloat64Ratio of second source radius to the Einstein ring radius.
Source2_sfloat64Projected separation of second source.
Source2_alphafloat64Angle of second source.
Source2_incfloat64Inclination of second source.
Source2_phasefloat64Phase of second source.
Planet_massfloat64Mass of the planet (if present).
Planet_qfloat64Planet-to-star mass ratio.
Planet_sfloat64Projected separation of the planet.
alphafloat64Trajectory angle (degrees)
Planet_periodfloat64Orbital period of the planet (years).
Planet_semimajoraxisfloat64Semimajor axis of the planet (AU).
Planet_orbphasefloat64Orbital phase of the planet (degrees).
Planet_inclinationfloat64Inclination of the planet (degrees).
Lens_Massfloat64Mass of the lens (MSun).
Lens_Distfloat64Distance to the lens (kpc).
Lens_Tefffloat64Effective temperature of the lens (K).
Lens_loggfloat64Surface gravity of the lens (cgs).
Lens_Fe_Hfloat64Metallicity of the lens.
Source_Massfloat64Mass of the source (MSun).
Source_Distfloat64Distance to the source (kpc).
Source_Tefffloat64Effective temperature of the source (K).
Source_loggfloat64Surface gravity of the source (cgs).
Source_Fe_Hfloat64Metallicity of the source.
Source2_Massfloat64Mass of the second source (MSun).
Source2_Distfloat64Distance to the second source (kpc).
Source2_Tefffloat64Effective temperature of the second source (K).
Source2_loggfloat64Surface gravity of the second source (cgs).
Source2_Fe_Hfloat64Metallicity of the second source.
extinction_F146float64Extinction in F146.
extinction_F087float64Extinction in F087.
extinction_F213float64Extinction in F213.

3. Epochs Table (_epoch.parquet)

Maps each unique observation time (BJD) and corresponding telescope coordinates (X, Y, Z relative to the Solar System Barycenter) to a unique epoch ID.

Column NameData TypeDescription
epoch_idint64Unique identifier for the epoch.
bjdfloat64Barycentric Julian Date.
obs_xfloat64Observatory X-coordinate in AU.
obs_yfloat64Observatory Y-coordinate in AU.
obs_zfloat64Observatory Z-coordinate in AU.

Simulation Details & Disclaimer

Simulation Engine: All events have been generated using the gulls simulator. More information is available at gulls-microlensing.github.io.

Stellar Populations: The input stellar population catalogs used for the source and lens stars were generated using synthpop (github.com/synthpop-galaxy/synthpop).

Event Complexity:

  • —There are three simulations included in this dataset:
  • —RMDC26_1S1L_ML: Single lens and single source events.
  • —RMDC26_1S2L_ML: One star - one planet lens and single source events.
  • —RMDC26_2S2L_ML: One star - one planet lens and potentially binary source events without source orbital motion.
  • —Note that not all lenses and sources are necessarily involved in the microlensing event. ObsGroup_0_chi2 > 160 for events from the binary lens simulations indicates that an anomaly may be present in the light curve. The anomalies may be planetary perturbations and caustic crossings, finite source effects, or parallax effects.

Representativeness & Weighting:

  • —This data set only includes potentially detectable microlensing events where the chi-squared difference between the best fit flat model and the true model is greater than 60, i.e. $\chi^2{\text{flat}} - \chi^2{\text{true}} > 60$.
  • —The full set of events is not directly representative of the raw astrophysical population due to detection significance cuts and GULLS coordinate transformations (e.g. in croin caustic-relative coordinates, the host star $t0$ and $u0$ are often transformed far outside of normal ranges or observing seasons, even though the planetary anomaly itself is actively observed in-season).
  • —To make the dataset more representative of the true underlying Galactic population, you can apply the population weights stored in the `final_weight` column directly during training and analysis, or use them to draw a resampled, less biased dataset.
  • —The `is_out_of_season` flag indicates whether the closest approach time of the primary lens (t0lens1) falls in a seasonal gap when the Galactic Bulge is unobservable. While the lightcurves of these events still show signature features of the microlensing event, their peak stellar magnification is not covered by observations. As a result, these events might be difficult for machine learning models to classify correctly, and you may want to filter them out depending on your specific modeling goals.

Dataset Structure:

  • —The dataset is split into observations, metadata, and epochs.
  • —To reconstruct a full lightcurve for an event, join the obs table with the meta table on event_id and the epoch table on epoch_id.

Disclaimer: This dataset is intended for testing and development purposes and should be used with the understanding of the biases inherent in the simulation sampling.

Sample Light Curves

Here are normalized light curves for 9 sample events from the dataset (3 from each simulation type: 1S1L, 1S2L, 2S2L), colored by filter band. Each filter's flux is divided by its median value (per event) so all bands appear on the same relative scale — the dashed gray line marks the baseline (ratio = 1). The time axis is zoomed to $t0 \pm 5 \cdot tE$.

[image]

Code Examples

The dataset is hosted on Hugging Face as RGES-PIT/MachineLearning with three configs: observations, metadata, and epochs. Below are examples for loading and working with the data.

Prerequisites

To load the metadata and epochs tables directly from Hugging Face, install the datasets and pandas libraries:

bash
pip install datasets pandas pyarrow duckdb huggingface_hub

Set your Hugging Face access token:

bash
export HF_TOKEN="hf_your_token_here"

1. Load the metadata and epochs tables

python
from datasets import load_dataset
import os

token = os.environ.get("HF_TOKEN")
assert token, "Set HF_TOKEN environment variable first"

dataset_name = "RGES-PIT/MachineLearning"

# Load metadata and epochs tables (which fit easily in RAM)
meta_df = load_dataset(dataset_name, "metadata", split="train", token=token).to_pandas()
epochs_df = load_dataset(dataset_name, "epochs", split="train", token=token).to_pandas()

print(f"Metadata     : {meta_df.shape[0]:,} rows")
print(f"Epochs       : {epochs_df.shape[0]:,} rows")

Expected output:

text
Observations : 18,441,855,367 rows
Metadata     : 372,655 rows
Epochs       : 98,974 rows

2. Reconstruct a single event's lightcurve

Because the observations table is extremely large (~160 GB in total), loading it in full is not recommended for local machines. Instead, we use DuckDB's remote hf:// protocol to fetch observations for a single event without downloading the entire table:

python
import duckdb
from huggingface_hub import HfFileSystem
import os

token = os.environ.get("HF_TOKEN")
con = duckdb.connect()
con.register_filesystem(HfFileSystem(token=token))

obs_p = "hf://datasets/RGES-PIT/MachineLearning/RMDC26_ML_Data_obs.parquet"
meta_p = "hf://datasets/RGES-PIT/MachineLearning/RMDC26_ML_Data_meta.parquet"
epoch_p = "hf://datasets/RGES-PIT/MachineLearning/RMDC26_ML_Data_epoch.parquet"

event_id = 3000

# Reconstruct a single event's lightcurve
event_obs = con.execute(f"""
    SELECT 
        o.event_id,
        m.name,
        e.bjd,
        o.filt,
        o.flux_uJy,
        m.tE_helio,
        m.sim_label
    FROM '{obs_p}' o
    JOIN '{epoch_p}' e ON o.epoch_id = e.epoch_id
    JOIN '{meta_p}' m ON o.event_id = m.event_id
    WHERE o.event_id = {event_id}
    ORDER BY e.bjd
""").df()

print(f"Event {event_id}: {event_obs['name'].iloc[0]} ({event_obs['sim_label'].iloc[0]})")
print(f"  {len(event_obs):,} observations")
print(f"  Einstein timescale tE_helio = {abs(event_obs['tE_helio'].iloc[0]):.2f} days")

Expected output:

text
Event 3000: RMDC26_003000 (RMDC26_1S1L_ML)
  49,488 observations
  Einstein timescale tE_helio = 3.55 days

3. Filter events by metadata constraints

You can perform filtering on the metadata table first, and then fetch observations for matched events. To run this efficiently over the network without full-table scans, query observations only for the target event IDs:

python
from datasets import load_dataset
import os
import duckdb
from huggingface_hub import HfFileSystem

token = os.environ.get("HF_TOKEN")
meta_df = load_dataset("RGES-PIT/MachineLearning", "metadata", split="train", token=token).to_pandas()

# Select low-significance single-lens events (chi2 <= 160)
good_events = meta_df[
    (meta_df["sim_label"] == "RMDC26_1S1L_ML") &
    (meta_df["ObsGroup_0_chi2"] <= 160)
]

print(f"{len(good_events)} events matched filters")

# Query observations count for matched events via DuckDB filter pushdown
con = duckdb.connect()
con.register_filesystem(HfFileSystem(token=token))
obs_p = "hf://datasets/RGES-PIT/MachineLearning/RMDC26_ML_Data_obs.parquet"

event_ids_str = ", ".join(map(str, good_events["event_id"].tolist()))
good_obs_count = con.execute(f"SELECT COUNT(*) FROM '{obs_p}' WHERE event_id IN ({event_ids_str})").fetchone()[0]
print(f"{good_obs_count:,} corresponding observations")

Expected output:

text
59222 events matched filters
2,930,778,336 corresponding observations

4. Sum final_weight per simulation

To verify the population representation or check the total astrophysical weights of each simulation, you can sum the final_weight column grouped by simulation label:

python
# Sum weights and count events per simulation
weights_summary = meta_df.groupby("sim_label").agg(
    total_weight=("final_weight", "sum"),
    event_count=("final_weight", "count")
).reset_index()

print(weights_summary.to_string(index=False))

Expected output:

text
     sim_label  total_weight  event_count
RMDC26_1S1L_ML  60411.874322       299466
RMDC26_1S2L_ML   1588.290136        31633
RMDC26_2S2L_ML   1940.221485        41556