Back to projects
Aug 17, 2026
2 min read

Lucero (ipynb-jjsm-tools)

My Python toolkit for astronomy notebooks: project setup, LaTeX-matched figures, S3 data loading, aperture photometry, zero points and CMD/HR diagrams

Lucero (published as ipynb-jjsm-tools) is the utility package I use in every notebook. Most of it started as code from homework and lab assignments at UC, especially the observational astronomy courses, that I kept copying from one notebook to the next until it became a package. It helps me set a standard style across notebooks and plots.

pip install "ipynb-jjsm-tools[full] @ git+https://github.com/jj-sm/ipynb-jjsm-tools.git"

The extras are notebook (Jupyter), lab (astronomy tooling) and full (both). It is usually imported as lab:

import ipynb_jjsm_tools as lab

Modules

  • setup: set the project root and create the usual folders, activate or install LaTeX, and size figures in centimetres (cm_to_in, size, set_font_sizes) so plots match the report’s fonts.
  • download: S3Client, to load data from S3-compatible storage with credentials from a .env file or Colab secrets.
  • photometry: apertures, aperture flux and instrumental magnitudes; zero-point calibration with compute_zeropoint and plot_zeropoint_fit; and scan_aperture_radii with plot_radius_optimization to pick the best aperture.
  • plot:
    • FITS images with WCS axes (plot_image).
    • Color–magnitude and HR diagrams with isochrone overlays, plus shift_isochrone to apply distance modulus, extinction and reddening in one call.
    • Star profiles with Gaussian fits (plot_star_profile).
    • A scatter + fit + residuals panel (scatter_with_fit).
  • CLI: jjsm-setup installs LaTeX and can create a uv virtual environment.

It is also the default toolkit on the lab server: astrolab-setup installs it in the ~/.ipynb environment that astroenvs uses as its Jupyter kernel.