WCS loading benchmark

A small profiling note for loading FITS WCS metadata.

Use this as an implementation note when profiling WCS loading against the repository’s FITS metadata table.

Warning

This is a static benchmark archive. It expects a local FITS_DB Parquet directory and a running VizTracer viewer, so the source cells are not run by the site build. The saved output includes an old port-in-use message and is not a performance claim for current releases.

Source and current API

The notebook code and saved text output are embedded below. You can also download the original notebook. For supported WCS behavior, use the FastTanSipWCS API and offline utilities.

The widget output is not displayed because no widget state was saved. Run the notebook with a local VizTracer viewer to use it.

%load_ext viztracer
import pandas as pd
from astropy.wcs import WCS

WEEKID = "2025W21_1B"
db = (
    pd.read_parquet(f"FITS_DB/{WEEKID}.parq")
    .dropna(axis='columns', how="all")
    .drop(columns=["history", "OMEGA_MEDIAN", "OMEGA_STDDEV", "PSF_OMEGA"])
)
db.iloc[0]
filename    level2_2025W21_1B_0001_1D1_spx_l2b-v4-2025-140...
DETECTOR                                                    1
OBSID                                       2025W21_1B_0001_1
EXPIDN                                        202521102000111
DATE                                  2025-05-21T00:50:15.870
                                  ...                        
MJD-BEG                                          60814.002242
DATE-END                              2025-05-19T00:05:08.788
MJD-END                                          60814.003574
XPOSURE                                              113.5826
TELAPSE                                              118.1873
Name: 0, Length: 109, dtype: object
%%viztracer -p 8888
WCS(db.iloc[0].dropna())
!vizviewer -p 9002 viztracer_report.json
Error! Port 9002 is already in use, try another port with "--port"