Taos API Reference
    Preparing search index...

    Class SstField

    A loaded SST field: the GPU value-texture plus the range metadata a shader needs to decode it. Owns the texture (call destroy to release it).

    Index

    Properties

    texture: Texture

    Equirect value-texture (rgba8unorm, non-srgb): R = normalized temperature, A = valid mask.

    Range + provenance metadata.

    Accessors

    • get attribution(): string

      Attribution string that must be shown while this layer is on screen.

      Returns string

    Methods

    • Temperature (°C) at a geodetic point via nearest-cell lookup, or null over land / no-data / off-grid. Matches the equirect layout (col 0 = lon −180, row 0 = lat +90).

      Parameters

      • lonDeg: number
      • latDeg: number

      Returns number | null

    • Loads a baked SST snapshot: the metadata JSON and the value-texture PNG. The PNG is uploaded with srgb:false so the red channel decodes linearly (no gamma), and decoded once on the CPU (via an OffscreenCanvas) into a °C grid for point readouts.

      Parameters

      • device: GPUDevice

        The WebGPU device.

      • pngUrl: string

        URL of the baked equirect value-texture (from bake_sst.mjs).

      • metaUrl: string

        URL of the JSON sidecar.

      Returns Promise<SstField>

    • Streams the latest OISST day live from the NOAA NCEI ERDDAP as gridded JSON and builds the same value-texture + °C grid as load. Browser-direct (NCEI sends CORS *), no proxy. Tries the near-real-time product first, then the finalized one.

      The dataset is 0–360° longitude; this rolls it to the module's −180..180 contract and clamps temperatures into the shared [tMinC, tMaxC] range so live and baked fields are interchangeable everywhere downstream.

      Parameters

      • device: GPUDevice

        The WebGPU device.

      • opts: { stride?: number; date?: string } = {}
        • Optionalstride?: number

          Grid decimation of the 0.25° source (default 4 → ~1°, ~3.8 MB).

        • Optionaldate?: string

          Day to fetch as YYYY-MM-DD (or full ISO). Omit for the latest day.

      Returns Promise<SstField>

    • The available date range for loadLive, as { start, end } epoch-seconds — the union across the NRT + finalized NCEI datasets. Fetched from their .das metadata; cheap. Used to bound a date scrubber.

      Returns Promise<{ start: number; end: number }>