Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

IRSA Tutorials

SED fitting on OpenUniverse2024 Roman and Rubin Photometry

Learning Goals

By the end of this tutorial, you will be able to:

Introduction

The OpenUniverse2024 dataset provides simulated multiwavelength observations combining Roman and Rubin realistic survey data. In this tutorial, we walk through a complete technique-focused workflow for analyzing a small sample of galaxies—from accessing the data, to constructing broadband SEDs, to running a first-pass physical model using Prospector.

As an astrophysical case study, we choose to focus on supernova host galaxies. By measuring the SEDs of these hosts across optical to infrared wavelengths, we can estimate key physical properties—such as stellar mass and star formation rate. Comparing these properties between Type Ia and core-collapse supernova hosts helps reveal how different progenitor channels trace galaxy environments. We expect that Type Ia events, originating from older stellar populations, to have occured in more massive, evolved galaxies, whereas we expect core-collapse SNe to follow sites of active star formation in lower-mass systems. Exploring the distribution of supernova type as a function of host stellar mass thus provides direct insight into how stellar evolution, galaxy growth, and transient populations are linked.

Instructions

We use Prospector in this tutorial to do the SED fitting. Running the full SED fitting step in this notebook can take a long time (~30 minutes for a sample of five). You do not need to run those fits unless you want to generate your own results for a custom sample — otherwise. We have provided an output file to explore and visualize the results. If you do want to run the fitting yourself, you will need to uncomment the relevant cell in section 3A.

Input

In this tutorial, we’ve hard-coded the cloud storage paths for the data files needed to run the examples. This allows you to jump straight into the analysis without worrying about locating or downloading the data manually. If you’d like to learn more about how cloud-based data access works—including how to browse and read files in the cloud—see the IRSA Cloud Access Introduction tutorial.

Output

Assumptions and Simplifications

In this tutorial we adopt several simplifying assumptions to keep the workflow fast and transparent:

Imports

Some dependencies (like fsps and prospector) require specialized setup as described below

1. Define the targets

We begin by identifying our target galaxies — in this example, galaxies hosting simulated supernovae. The OpenUniverse2024 dataset stores different aspects of the data in separate Parquet files:

We’ll explore the structure of these Parquet files and then join them into a single table.

1.1 Figure out what is in the OpenUniverse parquet files.

list out some basic information including column names

Notebook Cell
Found 30 columns and 5329 rows

Column names:
   id
   ra
   dec
   host_id
   gentype
   model_name
   start_mjd
   end_mjd
   z_CMB
   mw_EBV
   mw_extinction_applied
   AV
   RV
   v_pec
   host_ra
   host_dec
   host_mag_g
   host_mag_i
   host_mag_F
   host_sn_sep
   peak_mjd
   peak_mag_g
   peak_mag_i
   peak_mag_F
   lens_dmu
   lens_dmu_applied
   model_param_names
   model_param_values
   MW_av
   MW_rv
<ArrowStringArray> [ 'FIXMAG', 'NON1ASED.PISN-STELLA-HYDROGENIC', 'NON1ASED.SLSN-I-BBFIT', 'NON1ASED.V19_CC+HostXT_WAVEEXT', 'SALT3.NIR_WAVEEXT', 'NON1ASED.SNIax', 'NON1ASED.TDE-BBFIT'] Length: 7, dtype: str

1.2 Merge Catalogs

Next we merge the SN sample with the host galaxy fluxes and physical properties. This ensures that each supernova has associated photometric and physical data from its host galaxy, suitable for SED fitting.

Notebook Cell
  Loaded 59584 SN entries
  Joined galaxy tables → 3450580 rows
✅ SN–host join completed: 58078 matched hosts
  Redshift range of SN sample: 0.033–2.980
Loading...
['id', 'ra', 'dec', 'host_id', 'gentype', 'model_name', 'start_mjd', 'end_mjd', 'z_CMB', 'mw_EBV', 'mw_extinction_applied', 'AV', 'RV', 'v_pec', 'host_ra', 'host_dec', 'host_mag_g', 'host_mag_i', 'host_mag_F', 'host_sn_sep', 'peak_mjd', 'peak_mag_g', 'peak_mag_i', 'peak_mag_F', 'lens_dmu', 'lens_dmu_applied', 'model_param_names', 'model_param_values', 'MW_av', 'MW_rv', 'galaxy_id', 'lsst_flux_u', 'lsst_flux_g', 'lsst_flux_r', 'lsst_flux_i', 'lsst_flux_z', 'lsst_flux_y', 'roman_flux_W146', 'roman_flux_R062', 'roman_flux_Z087', 'roman_flux_Y106', 'roman_flux_J129', 'roman_flux_H158', 'roman_flux_F184', 'roman_flux_K213', 'redshift', 'um_source_galaxy_obs_sm']

1.3 Verify catalog matching worked

To confirm that the SN–host matching worked properly, we compare the supernova redshift (z_CMB) to its host galaxy redshift. A tight correlation along the 1:1 line indicates successful matching.

Notebook Cell
<Figure size 600x600 with 1 Axes>

1.4 Save and/or reload the targets

You may want to save your sample of targets to a file and then, next time you need it, skip the cell above and load the sample from file. This can save time when your sample is large, help ensure that the same input data is used for reproduceability, etc.

2. Clean and Visualize data

With the matched sample we just built, we can visualize their spectral energy distributions (SEDs). We will:

Notebook Cell
Notebook Cell
Notebook Cell
Notebook Cell

We now plot flux versus wavelength for one galaxy, comparing Roman and Rubin photometric points. The goal is to get a qualitative sense of the galaxy’s broadband SED shape.

<Figure size 640x480 with 1 Axes>
Notebook Cell
<Figure size 640x480 with 1 Axes>

3. SED fitting

In this section we will use Prospector, a Bayesian SED fitting code built on FSPS, to infer stellar population parameters for our galaxies by fitting their SEDs. We choose Prospector because it is an open-source, powerful, yet flexible package to infer stellar population properties that is widely used in the community.

There are two ways to proceed, depending on whether you want to run your own fits or use existing results.

Option A — Run new fits (slow)

This option performs fresh Prospector fits for a small subset of galaxies (20 by default). It is the most transparent path, showing every step of the fitting process and how the models are generated. However, it is computationally expensive — each fit can take several minutes, and the total run may exceed half an hour on a modest machine.

Choose this option if you:

Option B — Use existing results(fast)

This option simply reads the saved results (sn_fits.h5) from a previous run. It is ideal for quickly exploring the fitted parameters, verifying trends, or reproducing plots without waiting for new fits to complete.

Choose this option if you:


Both paths produce the same variables — df_small, obs_list, and outputs — so all of the downstream analysis and plotting cells will work identically. If you are following this notebook for the first time, start with Option B by leaving RUN_FITS = Falseto get a sense of the workflow, and come back later to experiment with Option A when you are ready to explore the full fitting process.


3A. Run new SED fits (optional, slow)

Prospector has its own built in functions to do writing and reading, but

  1. they don’t work for multiple galaxy fits, and

  2. they error out on numpy not liking something, so we’ll build our own below called save_outputs_hdf5

Notebook Cell
Notebook Cell
Notebook Cell
Notebook Cell
Notebook Cell
Notebook Cell

3A. Step 1: Explore fitting options

One set of options you have when using Prospector is which filters to use. OpenUniverse uses Rubin and Roman data but Prospector can include many other filters. A list of all available sedpy filters are here

or you can list out the available filters below.

['acs_wfc_f435w', 'acs_wfc_f475w', 'acs_wfc_f555w', 'acs_wfc_f606w', 'acs_wfc_f625w', 'acs_wfc_f775w', 'acs_wfc_f814w', 'acs_wfc_f850lp', 'bass_g', 'bass_r', 'bessell_B', 'bessell_I', 'bessell_R', 'bessell_U', 'bessell_V', 'cfht_megacam_gs_9401', 'cfht_megacam_is_9701', 'cfht_megacam_rs_9601', 'cfht_megacam_us_9301', 'cfht_megacam_zs_9801']

A second set of options is which star formation history to choose. Here we show a basic description of all pre-defined parameter sets.

'type_defaults':
  Explicitly sets dust amd IMF types.
'ssp':
  Basic set of (free) parameters for a delta function SFH
'parametric_sfh':
  Basic set of (free) parameters for a delay-tau SFH.
'dust_emission':
  The set of (fixed) dust emission parameters.
'nebular':
  The set of nebular emission parameters, with gas_logz tied to stellar logzsol.
'nebular_marginalization':
  Marginalize over emission amplitudes line contained inthe observed spectrum
'fit_eline_redshift':
  Fit for the redshift of the emission lines separatelyfrom the stellar redshift
'agn_eline':
  Add AGN emission lines
'outlier_model':
  The set of outlier (mixture) models for spectroscopy and photometry
'agn':
  The set of (fixed) AGN dusty torus emission parameters.
'igm':
  The set of (fixed) IGM absorption parameters.
'spectral_smoothing':
  Set of parameters for spectal smoothing.
'optimize_speccal':
  Set of parameters (most of which are fixed) for optimizing a polynomial calibration vector.
'fit_speccal':
  Set of parameters (most of which are free) for sampling the coefficients of a polynomial calibration vector.
'burst_sfh':
  The set of (fixed) parameters for an SF burst added to a parameteric SFH, with the burst time controlled by `fage_burst`.
'logm_sfh':
  Non-parameteric SFH fitting for log-mass in fixed time bins
'continuity_sfh':
  Non-parameteric SFH fitting for mass in fixed time bins with a smoothness prior
'continuity_flex_sfh':
  Non-parameteric SFH fitting for mass in flexible time bins with a smoothness prior
'continuity_psb_sfh':
  Non-parameteric SFH fitting for mass in Nfixed fixed bins and Nflex flexible time bins with a smoothness prior
'dirichlet_sfh':
  Non-parameteric SFH with Dirichlet prior (fractional SFR)
'stochastic_sfh':
  Stochastic SFH which correlates the SFRs between time bins based on model in TFC2020
'alpha':
  The prospector-alpha model, Leja et al. 2017
'beta':
  The prospector-beta model; Wang, Leja, et al. 2023

3A. Step 2: Model setup

3A. Step 3: Data setup

This cell prepares the data for fitting by choosing a small subset of galaxies to fit and putting the data into the format that is expected by Prospector.

Selected 20 host galaxies (10 Ia + 10 CC)
model_name
SALT3.NIR_WAVEEXT                 10
NON1ASED.V19_CC+HostXT_WAVEEXT     9
NON1ASED.SNIax                     1
Name: count, dtype: int64
{'wavelength': None, 'spectrum': None, 'unc': None, 'redshift': 1.4406788412470974, 'maggies': array([1.07464378e-11, 9.68911388e-12, 8.66487259e-12, 8.28597604e-12, 9.21316808e-12, 1.62278892e-11, 7.17411889e-12, 9.21316808e-12, 1.49021622e-11, 1.69117154e-11, 1.67915300e-11, 1.83956757e-11, 1.92673138e-11, 2.22090034e-11]), 'maggies_unc': array([1.07464378e-12, 9.68911388e-13, 8.66487259e-13, 8.28597604e-13, 9.21316808e-13, 1.62278892e-12, 7.17411889e-13, 9.21316808e-13, 1.49021622e-12, 1.69117154e-12, 1.67915300e-12, 1.83956757e-12, 1.92673138e-12, 2.22090034e-12]), 'filters': [<class 'sedpy.observate.Filter'>(lsst_baseline_u), <class 'sedpy.observate.Filter'>(lsst_baseline_g), <class 'sedpy.observate.Filter'>(lsst_baseline_r), <class 'sedpy.observate.Filter'>(lsst_baseline_i), <class 'sedpy.observate.Filter'>(lsst_baseline_z), <class 'sedpy.observate.Filter'>(lsst_baseline_y), <class 'sedpy.observate.Filter'>(roman_wfi_f062), <class 'sedpy.observate.Filter'>(roman_wfi_f087), <class 'sedpy.observate.Filter'>(roman_wfi_f106), <class 'sedpy.observate.Filter'>(roman_wfi_f129), <class 'sedpy.observate.Filter'>(roman_wfi_f146), <class 'sedpy.observate.Filter'>(roman_wfi_f158), <class 'sedpy.observate.Filter'>(roman_wfi_f184), <class 'sedpy.observate.Filter'>(roman_wfi_f213)], 'galaxy_id': 10050100813968, 'phot_mask': array([ True, True, True, True, True, True, True, True, True, True, True, True, True, True]), 'filternames': ['lsst_baseline_u', 'lsst_baseline_g', 'lsst_baseline_r', 'lsst_baseline_i', 'lsst_baseline_z', 'lsst_baseline_y', 'roman_wfi_f062', 'roman_wfi_f087', 'roman_wfi_f106', 'roman_wfi_f129', 'roman_wfi_f146', 'roman_wfi_f158', 'roman_wfi_f184', 'roman_wfi_f213'], 'logify_spectrum': False, 'ndof': 14}

3A. Step 4: Run the fits

FSPS installation and setup

This notebook uses FSPS to fit SEDs. You will need to download this repo and set the path correcly. The full size will a few GBs. The following cell will have some simple commands to do the downloading and basic setup. Please uncomment these lines or otherwise follow the instructions on the FSPS link instead.

Fornax users can ignore this cell altogether, both the data and the environment variable is set up for the IRSA environment.

Now that the the data is downloaded and path is properly set, do the import and verifications:

Running the fits

3B. Use existing results(fast, default)

If you already have a saved sn_fits.h5 file from a previous run, use this section to quickly load the fitted results instead of re-running Prospector.

Notebook Cell
Notebook Cell
[download] Fetching results file from Google Drive → sn_fits.h5
Downloading...
From: https://drive.google.com/uc?id=1BuymtEXJsxbd8PqwkIEmff-76JGGa650
To: /home/runner/work/irsa-tutorials/irsa-tutorials/tutorials/simulated-data/OpenUniverse2024/sn_fits.h5
  0%|          | 0.00/3.83M [00:00<?, ?B/s]
100%|██████████| 3.83M/3.83M [00:00<00:00, 41.0MB/s]

[load] Loaded 20 galaxies from sn_fits.h5
✅ Loaded 20 fits and matched 20 galaxies in df_scaled

4. Plot the results

After fitting, we can visualize the results by comparing observed and modeled SEDs and inspecting posterior parameter distributions.

4.1 Plot the SEDs with their best fit from Prospector

Notebook Cell
<Figure size 800x600 with 2 Axes>
<Figure size 800x600 with 2 Axes>
<Figure size 800x600 with 2 Axes>
<Figure size 800x600 with 2 Axes>
<Figure size 800x600 with 2 Axes>

4.2 Plot corner plots of posteriors

Notebook Cell
[Galaxy 10050000231601] Plotting corner with 1809 samples across 5 parameters
<Figure size 1000x900 with 25 Axes>
[Galaxy 10050000627698] Plotting corner with 1884 samples across 5 parameters
<Figure size 1000x900 with 25 Axes>

5. Verification

As a sanity check, we compare the stellar masses derived by Prospector to the “true” simulated stellar masses stored in the OpenUniverse catalog. Agreement along the 1:1 line indicates successful recovery of physical parameters.

Notebook Cell
Input mass [1.94016064e+08 9.80352560e+07 2.43979584e+08 2.17925312e+08
 1.07500816e+08 1.29884296e+08 1.43338496e+09 3.64248218e+09
 3.90629811e+09 7.93237632e+08 1.13509094e+09 4.91075400e+07
 3.30186720e+08 2.97556429e+09 1.25218163e+09 2.22853530e+09
 8.18764400e+07 6.56323277e+09 2.43161984e+09 7.62999347e+09]
<Figure size 600x600 with 1 Axes>

The example shown here does not yield particularly accurate stellar‐mass estimates — this is understandable given the simplifying assumptions used in the tutorial. As noted in the Assumptions section above, these quick Prospector runs are intended to demonstrate how to use and visualize OpenUniverse data rather than to optimize astrophysical fits. Users are encouraged to experiment with model parameters, priors, and error settings to obtain more realistic results.

6. Host galaxy properties as a function of SN type

Finally, we examine whether host galaxy properties differ between Type Ia and Core-Collapse supernovae. We compare the distribution of Prospector-derived stellar masses for the two SN classes.

Notebook Cell
<Figure size 800x500 with 1 Axes>

Distribution of Prospector-derived host galaxy stellar masses for Type Ia and Core-Collapse supernovae. The two distributions do not show a clear separation, which likely reflects the limited accuracy of the stellar-mass fits in this quick demonstration. As discussed in the stellar-mass verification figure (Section 5), the simplified assumptions used in the tutorial—such as fixed flux uncertainties and basic model priors—introduce significant scatter that can obscure any underlying physical differences between the SN host populations. Larger sample sizes or more attention to fit assumptions may clarify this plot.

Acknowledgements

About this notebook

Authors: Jessica Krick, Jaladh Singhal, Brigitta Sipőcz

Updated: 2026-02-12

Contact: IRSA Helpdesk with questions or problems.

Runtime: As of the date above, this notebook takes about 70s to run to completion on a machine with 8GB RAM and 2 CPU without running any of the SED fitting. Running this tutorial including fitting on 20 galaxies takes about 40 minutes to run to completion on a machine with 64GB RAM and 16 CPU.

AI Acknowledgement: This tutorial was developed with the assistance of OpenAI’s ChatGPT (GPT-5)

References

Johnson, B. D., Leja, J., Conroy, C., & Speagle, J. S. (2021). Stellar Population Inference with Prospector. The Astrophysical Journal Supplement Series, 254(2), 22.

Leja, J., Johnson, B. D., Conroy, C., van Dokkum, P. G., & Byler, N. (2017). An Older, More Quiescent Universe from Panchromatic SED Fitting of the 3D-HST Survey. The Astrophysical Journal, 837 (2), 170.

Conroy, C., Gunn, J. E., & White, M. (2009). The Propagation of Uncertainties in Stellar Population Synthesis Modeling. The Astrophysical Journal, 699(1), 486–506.

Conroy, C., & Gunn, J. E. (2010). The Propagation of Uncertainties in Stellar Population Synthesis Modeling. II. The Challenge of Comparing Galaxy Evolution Models to Observations. The Astrophysical Journal, 712(2), 833–857.

Johnson, B. D. (2024). python-fsps: Python bindings to the Flexible Stellar Population Synthesis (FSPS) code (Version 0.4.7) Computersoftware. Zenodo. Ben Johnson et al. (2024)

Speagle, J. S. (2020). DYNESTY: a dynamic nested sampling package for estimating Bayesian posteriors and evidences. Monthly Notices of the Royal Astronomical Society, 493(3), 3132–3158.

Speagle, J. S. (2025). dynesty: Dynamic Nested Sampling in Python (Version 2.1.0) Computersoftware. Zenodo. Sergey Koposov et al. (2025)

Foreman-Mackey, D., Hogg, D. W., Lang, D., & Goodman, J. (2013). emcee: The MCMC Hammer. Publications of the Astronomical Society of the Pacific, 125(925), 306–312.

The Roman Supernova Cosmology Project Infrastructure Team (2025). OpenUniverse2024: A shared, simulated view of the sky for the next generation of cosmological surveys. Monthly Notices of the Royal Astronomical Society, 1729T. Open Universe Team (2025)

total time 27.324543237686157
References
  1. Ben Johnson, Dan Foreman-Mackey, Jonathan Sick, Joel Leja, Mike Walmsley, Erik Tollerud, Henry Leung, Spencer Scott, & Minjung Park. (2024). dfm/python-fsps: v0.4.7. Zenodo. 10.5281/ZENODO.12447779
  2. Sergey Koposov, Josh Speagle, Kyle Barbary, Gregory Ashton, Ed Bennett, Johannes Buchner, Carl Scheffler, Colm Talbot, Ben Cook, James Guillochon, Patricio Cubillos, Andrés Asensio Ramos, Matthieu Dartiailh, Ilya, Erik Tollerud, Dustin Lang, Ben Johnson, jtmendel, Edward Higson, … joezuntz. (2025). joshspeagle/dynesty: v3.0.0. Zenodo. 10.5281/ZENODO.17268284
  3. Open Universe Team. (2025). OpenUniverse 2024 Simulated Roman and Rubin Images: Full Area. IPAC. 10.26131/IRSA596