Skip to content

torchsky.filter_profiles

Experimental surface

These APIs are under active development. Names, defaults, and result objects may change between minor releases; pin a version if you depend on them in production.

Field-observation bandpass metadata from SVO, transmission files, built-in tables, or Gaussian profiles.

Guides: fields, coadds


This reference is generated from the package source. Names are grouped by the module that defines them; import every name from the public namespace torchsky.filter_profiles unless the group text says otherwise.

Field bandpass

Filter bandpass metadata (SVO, files, Gaussians) for field workflows.

bandpass_from_svo

bandpass_from_svo(
    *,
    band_name: str,
    facility: str,
    instrument: str,
    filter_id: str | None,
    prefer: Literal["classic", "2025", "any"],
    cache_dir: Path | str | None = None,
    use_cache: bool = True,
) -> dict[str, Any]

Resolve an SVO filter profile and summarize it for a field observation.

bandpass_from_transmission_file

bandpass_from_transmission_file(
    path: Path | str,
    *,
    band_name: str,
    wavelength_unit: Literal["angstrom", "nm"] = "angstrom",
) -> dict[str, Any]

Load two-column wavelength transmission text; summarize to FieldObservation kwargs.

Lines starting with # and blank lines are ignored. First two columns are parsed as floats (comma or whitespace separated).

bandpass_gaussian

bandpass_gaussian(
    *,
    band_name: str,
    lambda_eff: float,
    lambda_min: float,
    lambda_max: float,
    sigma: float | None = None,
) -> dict[str, Any]

Gaussian transmission envelope on [lambda_min, lambda_max] (same units, e.g. Å).

field_observation_spectral_kwargs

field_observation_spectral_kwargs(
    spec: dict[str, Any],
) -> dict[str, Any]

Map a resolved bandpass dict to :class:FieldObservation keyword args.

photon_quadrature

photon_quadrature(
    wavelength: Tensor,
    throughput: Tensor,
    num_nodes: int,
    *,
    flux_convention: Literal["fnu", "flambda"] = "fnu",
) -> tuple[Tensor, Tensor]

Equal-weight quadrature nodes for a photon-counting band average.

The band average of a spectrum g seen by a photon counter is <g> = int g(l) T(l) k(l) dl / int T(l) k(l) dl with k = 1/l for f_nu (JWST, AB magnitudes) and k = l for f_lambda. The nodes are the midpoints of num_nodes equal-mass bins of that measure, so <g> ~= mean_q g(l_q); they concentrate where the band transmits. Returns (nodes, weights) in the units of wavelength; weights sum to one.

resolve_field_bandpass

resolve_field_bandpass(
    *,
    source: FieldSpectralSource,
    band_name: str,
    builtin_table: dict[
        str, tuple[float, float, float, float]
    ],
    svo_facility: str,
    svo_instrument: str,
    svo_filter_id: str | None,
    svo_prefer: Literal["classic", "2025", "any"],
    svo_cache_dir: Path | str | None = None,
    svo_use_cache: bool = True,
    transmission_path: Path | None,
    transmission_dir: Path | None,
    transmission_unit: Literal["angstrom", "nm"],
    gaussian_lambda_eff: float | None,
    gaussian_lambda_min: float | None,
    gaussian_lambda_max: float | None,
    gaussian_sigma: float | None,
) -> dict[str, Any]

Resolve spectral kwargs for one band name (e.g. F277W).