Skip to content

Add multi-wavelength spectroscopy tutorial#203

Open
aditya-pandey-dev wants to merge 7 commits intoJuliaAstro:mainfrom
aditya-pandey-dev:add-spectroscopy-tutorial
Open

Add multi-wavelength spectroscopy tutorial#203
aditya-pandey-dev wants to merge 7 commits intoJuliaAstro:mainfrom
aditya-pandey-dev:add-spectroscopy-tutorial

Conversation

@aditya-pandey-dev
Copy link

@aditya-pandey-dev aditya-pandey-dev commented Mar 20, 2026

Closes #202

What's included

A new tutorial at docs/src/tutorials/multi-wavelength-spectroscopy.md covering a realistic end-to-end spectroscopy workflow:

  1. Loading a real SDSS DR14 spectrum from a FITS binary table (FITSIO.jl)
  2. Attaching physical units — Å, erg/s/cm²/Å (Unitful + UnitfulAstro)
  3. Fλ ↔ Fν conversion (Jansky)
  4. Dust extinction with CCM89, OD94, CAL00 laws (DustExtinction.jl)
  5. Spectral axis inspection via spectral_axis / flux_axis (Spectra.jl)
  6. Automatic uncertainty propagation (Measurements.jl)
  7. Synthetic blackbody spectra at 4 temperatures
  8. Spectral arithmetic — sky subtraction, scaling
  9. Cosmological redshift + luminosity distances (Cosmology.jl)

Testing

Includes test/test_tutorial.jl — a standalone verification script:

julia --project=docs/ test/test_tutorial.jl

All 5 dependency tests pass on Julia 1.12.5

Packages exercised

Spectra.jl, FITSIO.jl, DustExtinction.jl, UnitfulAstro.jl, Measurements.jl, Cosmology.jl, Plots.jl

Notes

  • Code blocks use plain julia fences (not @example) since Spectra.jl
    is installed from GitHub and not yet in the General registry
  • continuum() is referenced as a planned future feature with a link to
    Towards SpectraBase.jl [name tbd] Spectra.jl#41
  • [compat] bounds added for all new registered dependencies

Adds an end-to-end spectroscopy tutorial covering:
- Loading real SDSS spectra from FITS files (FITSIO.jl)
- Physical units and Fλ↔Fν conversions (Unitful + UnitfulAstro)
- Dust extinction with CCM89, OD94, CAL00 laws (DustExtinction.jl)
- Spectral axis inspection via spectral_axis/flux_axis (Spectra.jl)
- Automatic uncertainty propagation (Measurements.jl)
- Synthetic blackbody spectra generation (Spectra.jl)
- Spectral arithmetic: sky subtraction and scaling
- Cosmological redshift and luminosity distances (Cosmology.jl)

Includes test/test_tutorial.jl — standalone verification script.
Updates docs/Project.toml with [compat] bounds for all new deps.

Closes JuliaAstro#202
DustExtinction='0.6, 1' excluded v0.11.x (current release),
creating an unsolvable constraint with FITSIO 0.17 in CI.
Tutorial uses plain julia code blocks (not @example), so
docs build environment does not need to install tutorial
dependencies. Extra packages were causing CI resolution
failures in the JuliaAstroDocs test suite.
The CI test runner picks up all .jl files in test/ and tries
to execute them. test_tutorial.jl requires packages not present
in the test environment, causing JuliaAstroDocs to error.

Users can run the tutorial locally by installing the packages
listed in the tutorial's Packages section.
@aditya-pandey-dev
Copy link
Author

@icweaver can you check the PR. What changes should I do?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant