These examples use bundled data or small arrays. They need no JPL request, SPICE kernel, or kete installation.
pqfilt>=0.4.0 is installed with Skyloc and provides expression filtering.
1. Sample the solar spectrum
from astropy import units as uimport skyloc as slocsolar =sloc.get_solspect([600, 1000] * u.nm)solar
QTable length=2
wl
flam
dflam
fnu
ABmag
um
W / (um m2)
W / (um m2)
MJy
mag
float64
float64
float64
float64
float64
0.6
1778.6334795961054
5.335900699719788
213583776.2318217
-26.923855029501027
1.0
730.7479096063955
2.192243817262351
243751265.28579834
-27.06730157459512
wl carries wavelength units; flam is spectral irradiance per wavelength at 1 au. The default reference is the full TSIS extension, stored as 1 nm bin averages. Interpolation samples flam at points; it does not integrate a bandpass. See solar spectra before choosing a grid.
Assumptions: this example uses the IAU H–G model, unit observer and heliocentric distances in au, and phase angles in degrees. At zero phase and both distances equal to 1 au, the apparent magnitude equals hmag.
origin=0 means Python pixel indexing, so FITS reference pixel (51, 51) is Python pixel (50, 50). This header has zero SIP distortion.
Scope:sloc.FastTanSipWCS supports TAN/SIP with the documented projection and pole assumptions; it is not a general FITS WCS interpreter. The first call also includes Numba compilation. Check the API reference before using survey headers.