Members
(constant) BUFKIT_MODELS
Models the IEM BUFKIT archive carries.
- Source:
(constant) DISPLAY_VERSION
Short form drawn on charts ("SharpJS v1.7").
- Source:
(constant) ENGINE_SETTINGS
Settings the chart engine owns (the rest belong to the controls panel).
- Source:
(constant) EXPORT_FORMATS
Export formats understood by exportSounding().
- Source:
(constant) HELP_HTML
Chart markup. The engine finds every element by its data-sjs attribute (scoped to the chart
root) and toggles a few class names for the VWP and side-panel layouts:
hodographInset ↔ hodographInsetVWP, hodographValues ↔ hodographValuesVWP,
Values5 ↔ Values5VWP, skewthidden.
- Source:
(constant) MIGRATIONS
Steps from version n to n + 1. MIGRATIONS[1] would upgrade a v1 payload to v2.
- Source:
(constant) SETTINGS_SCHEMA
key → validator. Every persisted setting must be listed here.
- Source:
(constant) SETTINGS_VERSION
User settings: the options a viewer remembers between visits.
Saved settings are always merged over DEFAULT_SETTINGS and validated key by key, so:
- new options added in a later release start at their default without touching the rest,
- options removed in a later release are dropped quietly,
- a bad or hand-edited value falls back to the default instead of breaking the chart.
Bump SETTINGS_VERSION and add a step to MIGRATIONS only when a key changes meaning or name.
- Source:
(constant) VERSION
Single source of truth for the SharpJS version (kept in sync with package.json by test/version.test.js).
- Source:
bulkShear
shear across the inflow layer (the chart's "Eff Inflow" row)
- Source:
ebwd
effective bulk wind difference: inflow base to half the parcel EL height
- Source:
raw
Raw engine structures, for anything the summary above leaves out.
- Source:
ready
Resolves once an async adapter has loaded (immediately for browser storage).
- Source:
storage
Which storage is in use: "localStorage", "cookie", "memory" or a custom adapter's kind.
- Source:
Methods
CM1Round(N, tt) → {number}
Round a CM1 value to the precision selected by tt.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
N |
number | Value to round | |
tt |
number | 1 | Precision selector (1, 2, or other; in unitless). |
- Source:
Returns:
Rounded value
- Type
- number
CToF(N) → {number}
Converts a Celsius temperature to Fahrenheit.
Parameters:
| Name | Type | Description |
|---|---|---|
N |
number | Temperature (in C). |
- Source:
Returns:
Temperature (in F).
- Type
- number
CartesianToPolarDeg(T) → {Object}
Convert Cartesian vector components to magnitude and direction angle.
Parameters:
| Name | Type | Description |
|---|---|---|
T |
Object | Vector components (in kt). |
- Source:
Returns:
Magnitude (in kt) and angle (in degrees).
- Type
- Object
CartesianToPolarDeg(cartesian) → {Object}
Converts Cartesian components to polar magnitude and direction.
Parameters:
| Name | Type | Description |
|---|---|---|
cartesian |
Object | Components in the same unit |
- Source:
Returns:
Magnitude in the component unit and
direction (in deg).
- Type
- Object
ConvertCartToPolarReal(V1) → {Object}
Converts Cartesian wind components to meteorological wind direction and speed.
Parameters:
| Name | Type | Description |
|---|---|---|
V1 |
Object | Cartesian wind components (in kt). |
- Source:
Returns:
Rounded wind direction (in deg) and speed (in kt).
- Type
- Object
ConvertPolartoCart(Slice) → {Object}
Converts a meteorological wind direction and speed into the module's Cartesian
hodograph convention, rotated by 90 degrees.
Parameters:
| Name | Type | Description |
|---|---|---|
Slice |
Object | Wind direction (in deg) and speed (in kt). |
- Source:
Returns:
Cartesian wind components (in kt).
- Type
- Object
ConvertToInfo(N, SP, isAbove) → {object}
Maps a raw sounding row into the named layer-object representation and computes
its virtual temperature.
Parameters:
| Name | Type | Description |
|---|---|---|
N |
Array.<number> | Raw sounding row: pressure (hPa), height (m), temperatures (C), wind direction (deg), wind speed (kt), and remaining source fields (in ANY). |
SP |
number | Pressure supplied to the virtual-temperature calculation (in hPa). |
isAbove |
boolean | Marks whether the layer is above the surface (in 1). |
- Source:
Returns:
Layer object with pressure (hPa), height (m), temperatures (C),
wind direction (deg), wind speed (kt), and source-dependent fields (in ANY).
- Type
- object
ConvertToRaw(N, SP) → {Array.<number>}
Convert a sounding level to the raw seven-column row layout.
Parameters:
| Name | Type | Description |
|---|---|---|
N |
object | Level fields P, H, T, D, WD, WS, and WB. |
SP |
* | Unused compatibility parameter. |
- Source:
Returns:
Raw level values: pressure (in hPa), height (in m), temperature/dewpoint/wet-bulb (in °C), direction (in degrees), and speed (in kt).
- Type
- Array.<number>
CreateInsetParams(TitleText, otherText, fillStyle, coloumn, mColoumn, Scaley, MScaleY, Canv, ctx) → {number}
Draws a label and its value in a column of the sounding-parameter canvas.
Parameters:
| Name | Type | Description |
|---|---|---|
TitleText |
string | Label text (in 1). |
otherText |
string | Value text (in 1). |
fillStyle |
string | CSS canvas fill style (in 1). |
coloumn |
number | One-based display column (in 1). |
mColoumn |
number | Total number of display columns (in 1). |
Scaley |
number | Vertical position multiplier (in 1). |
MScaleY |
number | Vertical layout scale (in 1). |
Canv |
HTMLCanvasElement | Canvas used to determine drawing dimensions (in px). |
ctx |
CanvasRenderingContext2D | Canvas 2D drawing context (in 1). |
- Source:
Returns:
Next vertical position multiplier (in 1).
- Type
- number
CtoK(N) → {number}
Converts a Celsius temperature to kelvins (despite the legacy function name).
Parameters:
| Name | Type | Description |
|---|---|---|
N |
number | Temperature (in C). |
- Source:
Returns:
Temperature (in K).
- Type
- number
DegToRad(deg) → {number}
Convert an angle from degrees to radians.
Parameters:
| Name | Type | Description |
|---|---|---|
deg |
number | Angle (in degrees). |
- Source:
Returns:
Angle (in radians).
- Type
- number
DewFromTRh(T, Rh) → {number}
Estimates dew-point temperature from air temperature and relative humidity using a
Magnus-form Clausius–Clapeyron approximation.
Parameters:
| Name | Type | Description |
|---|---|---|
T |
number | Air temperature (in C). |
Rh |
number | Relative humidity (in %). |
- Source:
- See:
-
- Bolton, D. (1980), The Computation of Equivalent Potential Temperature, https://doi.org/10.1175/1520-0493(1980)108%3C1046:TCDMAA%3E2.0.CO;2
Returns:
Dew-point temperature (in C).
- Type
- number
DrawInsetParams(Sounding, Wnd, TProf, SB, ML, MU, retrn, f, canvas) → {object|void}
Computes sounding indices and either returns a parameter summary or draws the
selected preset's parameter labels and values into a canvas.
Parameters:
| Name | Type | Description |
|---|---|---|
Sounding |
object | Sounding analysis object containing the profile (pressure in hPa, height in m, temperatures in C). |
Wnd |
object | Wind analysis and storm-relative parameters (wind in kt, direction in deg). |
TProf |
object | Thermodynamic profile and downdraft analysis (field-specific units). |
SB |
object | Surface-based parcel analysis (CAPE/CIN in J/kg, levels in m). |
ML |
object | Mixed-layer parcel analysis (CAPE/CIN in J/kg, levels in m). |
MU |
object | Most-unstable parcel analysis (CAPE/CIN in J/kg, levels in m). |
retrn |
boolean | Return the computed subset as an object instead of drawing (in 1). |
f |
object | false | Optional preset configuration to activate before rendering (in 1). |
canvas |
HTMLCanvasElement | null | Destination canvas; uses the default values canvas when null (in px). |
- Source:
Returns:
When retrn is true, an object of named analysis values with their
field-specific units (including CAPE/DCAPE in J/kg, heights in m, temperatures in F or C,
PWAT in in, mixing ratio in g/kg, and relative humidity in %); otherwise draws to the canvas
and returns no value (in 1).
- Type
- object | void
EffInflowCalc(Sounding, sfc) → {Object|false}
Finds the bottom and top pressure bounds of the effective-inflow layer by
testing parcels against the module's effective-inflow criteria.
Parameters:
| Name | Type | Description |
|---|---|---|
Sounding |
object | Sounding profile (pressure in hPa, height in m, temperatures in C). |
sfc |
object | Surface sounding layer, including pressure (in hPa). |
- Source:
Returns:
Effective-inflow base/top pressures
(in hPa) and whether the base is at the surface, or false when no qualifying layer is found (in 1).
- Type
- Object | false
FtoC(N) → {number}
Converts a Fahrenheit temperature to Celsius.
Parameters:
| Name | Type | Description |
|---|---|---|
N |
number | Temperature (in F). |
- Source:
Returns:
Temperature (in C).
- Type
- number
GetAngleFromVector(B) → {number}
Converts a vector direction to a meteorological angle in degrees.
Parameters:
| Name | Type | Description |
|---|---|---|
B |
Object | Vector components (in ANY). |
- Source:
Returns:
Direction angle (in deg).
- Type
- number
GetBM(Sounding) → {object}
Calculates parcel-based Bunkers right/left storm motions when the MU parcel
and effective-inflow layer are valid, otherwise falls back to the classic
non-parcel method. Also calculates mean wind, Corfidi upshear/downshear
motions, and deviant tornado motions.
Parameters:
| Name | Type | Description |
|---|---|---|
Sounding |
object | Sounding profile (pressure in hPa, height in m, wind in kt). |
- Source:
- See:
-
- Bunkers et al. (2000), Predicting supercell motion using a new hodograph technique, https://doi.org/10.1175/1520-0434(2000)015%3C0061:PSMUAN%3E2.0.CO;2
- Bunkers et al. (2014), https://www.weather.gov/media/unr/soo/scm/2014-JOM11.pdf
- Corfidi et al. (2003), A proposed methodology for the prediction of mesoscale convective system movement, https://doi.org/10.1175/1520-0434(2003)018%3C0997:CPAMPF%3E2.0.CO;2
Returns:
Named storm-motion vectors RM, LM, MM, US, DS, DTMR, and DTML;
each x/y component is in kt.
- Type
- object
GetCapeColor(N) → {string}
Selects a display color from CAPE value bands, using white for missing values.
Parameters:
| Name | Type | Description |
|---|---|---|
N |
number | string | null | undefined | Convective available potential energy (in J/kg). |
- Source:
Returns:
CSS RGBA/RGB color string (in 1).
- Type
- string
GetDCape(Sound) → {object}
Estimates downdraft CAPE from the minimum mean equivalent potential temperature
layer and integrates negative buoyancy during the parcel's descent.
Parameters:
| Name | Type | Description |
|---|---|---|
Sound |
object | Sounding profile (pressure in hPa, height in m, temperatures in C). |
- Source:
Returns:
Downdraft CAPE (in J/kg), downburst temperature (in F), starting
layer object, and parcel temperature/pressure traces (C and hPa).
- Type
- object
GetDryLapse(l, ST, P, eSlice) → {Array.<number>}
Generates dry-adiabatic parcel temperatures along a sequence of sounding levels.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
l |
Array.<object> | Sounding levels (pressure in hPa, height in m). | |
ST |
object | Parcel starting layer (pressure in hPa, height in m, temperatures in C). | |
P |
|||
eSlice |
object | false | false | Optional interpolated environmental layer (height in m; temperature in C). |
- Source:
Returns:
Parcel temperatures aligned with l (in C).
- Type
- Array.<number>
GetLayerByHght(Sounding, Level, addTo) → {object|false}
Retrieves or interpolates a sounding layer at a requested height; "SFC" selects
the first valid surface layer, and out-of-range heights use a boundary layer.
Parameters:
| Name | Type | Description |
|---|---|---|
Sounding |
object | Sounding profile containing pressure, height and layer data (hPa, m). |
Level |
number | string | Requested height above the first sounding level (in m), or "SFC". |
addTo |
boolean | Whether to offset Level by the first row's height (in 1). |
- Source:
Returns:
Interpolated/named sounding layer with its field-specific units,
or false when no bracketing layer is found (in ANY).
- Type
- object | false
GetLayerByPres(Sounding, Level, Type) → {object}
Retrieves or interpolates a sounding layer at a requested pressure; "SFC" and
"Last" select boundary layers, and Type can skip wind interpolation.
Parameters:
| Name | Type | Description |
|---|---|---|
Sounding |
object | Sounding profile containing pressure and layer data (hPa). |
Level |
number | string | Requested pressure (in hPa), "SFC", or "Last". |
Type |
string | Layer calculation mode; "Thermo" and "ThermoOnly" skip wind vector work (in 1). |
- Source:
Returns:
Layer object with field-specific units, including pressure (hPa),
height (m), temperatures (C), wind direction (deg), and wind speed (kt).
- Type
- object
GetLayerByTemp(Sounding, Level, wetbulb) → {object}
Retrieves or interpolates a sounding layer at a specified temperature or wet-bulb
temperature; "SFC" selects the first valid surface layer.
Parameters:
| Name | Type | Description |
|---|---|---|
Sounding |
object | Sounding profile (temperatures in C, pressure in hPa, height in m). |
Level |
number | string | Requested temperature (in C), or "SFC". |
wetbulb |
boolean | Match the wet-bulb temperature field rather than air temperature (in 1). |
- Source:
Returns:
Interpolated or boundary sounding layer with pressure (hPa), height (m),
temperatures (C), wind direction (deg), and wind speed (kt).
- Type
- object
GetLerpFactor(a, b, g) → {number}
Find the interpolation fraction that places a value at g between a and b.
Parameters:
| Name | Type | Description |
|---|---|---|
a |
number | Upper endpoint |
b |
number | Lower endpoint |
g |
number | Target value |
- Source:
Returns:
Interpolation fraction
- Type
- number
GetLerpFactor(minimum, maximum, goal) → {number}
Computes the interpolation fraction at which a linear segment reaches a target.
Parameters:
| Name | Type | Description |
|---|---|---|
minimum |
number | Lower endpoint value |
maximum |
number | Upper endpoint value |
goal |
number | Target value between the endpoints |
- Source:
Returns:
Dimensionless interpolation fraction from zero to one (in 1).
- Type
- number
GetMoistLapse(l, t, td, p) → {Array.<number>}
Generates moist-adiabatic parcel temperatures at the supplied sounding levels.
Parameters:
| Name | Type | Description |
|---|---|---|
l |
Array.<object> | Sounding levels with pressure (in hPa). |
t |
number | Starting parcel temperature (in C). |
td |
number | Starting parcel dew-point temperature (in C). |
p |
number | Starting parcel pressure (in hPa). |
- Source:
Returns:
Parcel virtual temperatures aligned with l (in C).
- Type
- Array.<number>
GetNumFromRange(V, B, T) → {number}
Calculate the fractional position of V between range endpoints B and T.
Parameters:
| Name | Type | Description |
|---|---|---|
V |
number | Value to locate |
B |
number | First endpoint |
T |
number | Second endpoint |
- Source:
Returns:
Relative position within the range
- Type
- number
GetParams(Info, Type, STPF) → {number|string|null|undefined}
Calculates the requested severe-weather, fire-weather, winter-weather, fog, or
apparent-temperature parameter from sounding, parcel, and wind analysis results.
Supported Type values include SCP, STPF, STPC, VTPC, SHIP, WNDG, PWAT,
DerechoComp, EHI, SigSvr, ttadiff, KI, TT, HDWI, BRN, Rot, DewDP1km, LCLRH,
RFTI, Fosberg, MaxT, TEHI, TTS, MaxWB, SnowSquall, ConvT, LHP, RFP, FSI, FTV,
FeelsLike, and WBGT.
Parameters:
| Name | Type | Description |
|---|---|---|
Info |
object | Analysis inputs, including sounding, parcel, wind, and thermodynamic profiles (with field-specific units). |
Type |
string | Name of the parameter to calculate (in 1). |
STPF |
boolean | Legacy optional flag; it does not affect the current calculations (in 1). |
- Source:
- See:
-
- National Weather Service, Heat Index, https://www.weather.gov/safety/heat-index
- National Weather Service, Wind Chill, https://www.weather.gov/safety/cold-wind-chill-chart
Returns:
Requested parameter. Units depend on Type: temperatures
are in F or C as applicable; temperature differences are in C; PWAT is in in; Rot is in deg;
LCLRH is in %; BRN and composite/severe indices are in 1; other specialized index units are
(in ANY). Returns "--" for some unavailable temperature outputs, null for invalid PWAT
inputs, or undefined for an unsupported Type.
- Type
- number | string | null | undefined
GetSCPColor(N) → {string}
Selects a display color from the supercell-composite-parameter value bands.
Parameters:
| Name | Type | Description |
|---|---|---|
N |
number | Supercell composite parameter (in 1). |
- Source:
Returns:
CSS RGBA color string (in 1).
- Type
- string
GetSRH(Sounding, Hbot, Htop, type, RMot) → {Object}
Integrates positive and negative storm-relative environmental helicity over a
pressure- or height-bounded sounding layer.
Parameters:
| Name | Type | Description |
|---|---|---|
Sounding |
object | Sounding profile (pressure in hPa, height in m, wind in kt). |
Hbot |
number | Bottom pressure (in hPa) for type "Pres", or height (in m) for "Hght". |
Htop |
number | Top pressure (in hPa) for type "Pres", or height (in m) for "Hght". |
type |
"Pres" | "Hght" | Selects pressure-coordinate or height-coordinate bounds (in 1). |
RMot |
Object | false | Optional storm-motion vector; uses configured motion if false (in kt). |
- Source:
- See:
-
- Davies-Jones, R., Burgess, D., and Foster, M. (1990), Test of helicity as a tornado forecast parameter, 16th Conference on Severe Local Storms, 588–592.
Returns:
Positive and negative storm-relative helicity contributions
(in m2/s2); either is NaN when the requested layer is out of sounding bounds.
- Type
- Object
GetSTPColor(N) → {string}
Selects a display color from the significant-tornado-parameter value bands.
Parameters:
| Name | Type | Description |
|---|---|---|
N |
number | Significant tornado parameter (in 1). |
- Source:
Returns:
CSS RGBA/RGB color string (in 1).
- Type
- string
KTSTOM2(N) → {number}
Converts a speed from knots to metres per second.
Parameters:
| Name | Type | Description |
|---|---|---|
N |
number | Wind speed (in kt). |
- Source:
Returns:
Wind speed (in m/s).
- Type
- number
KTStoMPH(k) → {number}
Converts wind speed from knots to miles per hour.
Parameters:
| Name | Type | Description |
|---|---|---|
k |
number | Wind speed (in kt). |
- Source:
Returns:
Wind speed (in mph).
- Type
- number
KTStoMPS(n) → {number}
Convert wind speed from knots to meters per second.
Parameters:
| Name | Type | Description |
|---|---|---|
n |
number | Wind speed (in kt). |
- Source:
Returns:
Wind speed (in m/s).
- Type
- number
LapseRateHght(Sounding, hb, ht, type) → {number|string}
Calculates the mean virtual-temperature lapse rate between two heights, either
directly or by averaging fixed-height increments.
Parameters:
| Name | Type | Description |
|---|---|---|
Sounding |
object | Sounding profile (height in m, temperature in C). |
hb |
number | string | Bottom height above ground or "SFC" (in m). |
ht |
number | Top height above ground (in m). |
type |
boolean | Whether to average incremental lapse rates (in 1). |
- Source:
Returns:
Lapse rate (in C/km), or "--" when unavailable.
- Type
- number | string
LapseRatePres(Sounding, PBot, PTop, type) → {number|string}
Calculates the mean virtual-temperature lapse rate between pressure levels,
either directly or by averaging layer increments.
Parameters:
| Name | Type | Description |
|---|---|---|
Sounding |
object | Sounding profile (pressure in hPa, height in m, temperature in C). |
PBot |
number | Bottom pressure (in hPa). |
PTop |
number | Top pressure (in hPa). |
type |
boolean | Whether to average incremental lapse rates (in 1). |
- Source:
Returns:
Lapse rate (in C/km), or "--" when unavailable.
- Type
- number | string
LastItem(arr) → {*}
Return the final element of an array.
Parameters:
| Name | Type | Description |
|---|---|---|
arr |
Array | Source array. |
- Source:
Returns:
Last array element, or undefined when the array is empty.
- Type
- *
Lerp(a, b, t) → {number}
Linearly interpolate between two numeric values.
Parameters:
| Name | Type | Description |
|---|---|---|
a |
number | Starting value |
b |
number | Ending value |
t |
number | Interpolation fraction. |
- Source:
Returns:
Interpolated value
- Type
- number
Lerp(minimum, maximum, time) → {number}
Linearly interpolates between two values.
Parameters:
| Name | Type | Description |
|---|---|---|
minimum |
number | First endpoint |
maximum |
number | Second endpoint |
time |
number | Interpolation fraction from zero to one (in 1). |
- Source:
Returns:
Interpolated value, in the endpoint unit
- Type
- number
LerpSoundingSlice()
Lerp every field between rows `Pr` and `Rr`; wind (4 = dir, 5 = speed) via u/v components.
- Source:
LiftParcel(Sounding, type, start, doEcape, FastProfile) → {object}
Lifts a surface-based, mixed-layer, most-unstable, or specified parcel; computes
CAPE/CIN and characteristic levels, and optionally calculates entraining CAPE.
Parameters:
| Name | Type | Description |
|---|---|---|
Sounding |
object | Sounding profile (pressure in hPa, height in m, temperatures in C). |
type |
string | Parcel source selector: "SB", "ML", "MU", or a specified/effective parcel (in 1). |
start |
number | Starting pressure for a specified parcel, or source-specific start value (in hPa). |
doEcape |
boolean | Whether to calculate entraining CAPE when applicable (in 1). |
FastProfile |
Array.<object> | null | Optional integer-pressure lookup of sounding layers (hPa keys). |
- Source:
Returns:
Parcel profile: temperature path (C), CAPE/CIN and related buoyancy measures
(in J/kg), LCL/LFC/EL/MPL heights (in m), level count (in 1), starting layer, and ECAPE
path/value (C and J/kg, or the documented sentinel values).
- Type
- object
M2TOKTS(N) → {number}
Converts a speed from metres per second to knots.
Parameters:
| Name | Type | Description |
|---|---|---|
N |
number | Speed (in m/s). |
- Source:
Returns:
Speed (in kt).
- Type
- number
MPHtoKTS(k) → {number}
Converts wind speed from miles per hour to knots.
Parameters:
| Name | Type | Description |
|---|---|---|
k |
number | Wind speed (in mph). |
- Source:
Returns:
Wind speed (in kt).
- Type
- number
MPStoKTS(n) → {number}
Convert wind speed from meters per second to knots.
Parameters:
| Name | Type | Description |
|---|---|---|
n |
number | Wind speed (in m/s). |
- Source:
Returns:
Wind speed (in kt).
- Type
- number
Mag(N) → {number}
Calculates the Euclidean magnitude of a two-dimensional vector.
Parameters:
| Name | Type | Description |
|---|---|---|
N |
Object | Vector components, in a shared unit (in ANY). |
- Source:
Returns:
Vector magnitude, in the same unit as the components (in ANY).
- Type
- number
MeanWind(Sounding, PBot, PTop, Inc) → {Object}
Calculates a pressure-weighted mean Cartesian wind between two pressure levels.
Parameters:
| Name | Type | Description |
|---|---|---|
Sounding |
object | Sounding profile (pressure in hPa; wind in kt). |
PBot |
number | Bottom pressure (in hPa). |
PTop |
number | Top pressure (in hPa). |
Inc |
number | Pressure sampling interval (in hPa). |
- Source:
Returns:
Pressure-weighted mean Cartesian wind components (in kt).
- Type
- Object
MeanWindNW(Sounding, PBot, PTop, Inc) → {Object}
Computes a sample-count-weighted mean Cartesian wind over a pressure interval.
Parameters:
| Name | Type | Description |
|---|---|---|
Sounding |
object | Sounding profile (pressure in hPa; wind in kt). |
PBot |
number | Bottom pressure (in hPa). |
PTop |
number | Top pressure (in hPa). |
Inc |
number | Pressure sampling interval (in hPa). |
- Source:
Returns:
Mean Cartesian wind components (in kt).
- Type
- Object
MixRatioColor(N) → {string}
Selects a display color from the mixing-ratio value bands.
Parameters:
| Name | Type | Description |
|---|---|---|
N |
number | string | Mixing ratio (in g/kg), or "--" for unavailable data. |
- Source:
Returns:
CSS RGBA/RGB color string (in 1).
- Type
- string
ModifLerp(m1, m2, v) → {number}
Modified Lerpination
Parameters:
| Name | Type | Description |
|---|---|---|
m1 |
* | Number to be (1-V) |
m2 |
* | Number to be V |
v |
* | V |
- Source:
Returns:
OH YEH
- Type
- number
PolarToCartesianDeg(Spd, Tta) → {Object}
Convert speed and direction angle to Cartesian vector components.
Parameters:
| Name | Type | Description |
|---|---|---|
Spd |
number | Vector magnitude (in kt). |
Tta |
number | Direction angle (in degrees). |
- Source:
Returns:
Cartesian components (in kt).
- Type
- Object
PolarToCartesianDeg(speed, theta) → {Object}
Converts polar coordinates to Cartesian components.
Parameters:
| Name | Type | Description |
|---|---|---|
speed |
number | Vector magnitude |
theta |
number | Direction angle (in deg). |
- Source:
Returns:
Cartesian components, in the same unit as speed
- Type
- Object
Process(text) → {object|false}
Parse supported sounding text and construct the normalized SharpJS sounding object.
Parameters:
| Name | Type | Description |
|---|---|---|
text |
string | SHARPpy, Chaser Archive JSON, or CM1 sounding text. |
- Source:
Returns:
Parsed sounding with level arrays and metadata (pressure in hPa, height in m, temperature/dewpoint in °C, direction in degrees, wind speed in kt), or false when text is null.
- Type
- object | false
QCCheck(N) → {boolean}
Test whether a value is finite enough for use in a sounding row.
Parameters:
| Name | Type | Description |
|---|---|---|
N |
number | Candidate sounding value. |
- Source:
Returns:
Whether N is not the missing-value sentinel and is not NaN.
- Type
- boolean
RadToDeg(rad) → {number}
Convert an angle from radians to degrees.
Parameters:
| Name | Type | Description |
|---|---|---|
rad |
number | Angle (in radians). |
- Source:
Returns:
Angle (in degrees).
- Type
- number
RelHum(tmp, dew) → {number}
Estimates relative humidity as the ratio of actual to saturation vapour pressure.
Parameters:
| Name | Type | Description |
|---|---|---|
tmp |
number | Air temperature (in C). |
dew |
number | Dew-point temperature (in C). |
- Source:
- See:
-
- American Meteorological Society, Glossary of Meteorology, "relative humidity", https://glossary.ametsoc.org/wiki/relative_humidity/
Returns:
Relative humidity (in %).
- Type
- number
RoundTo(N, V) → {number}
Rounds a value to the nearest multiple of a requested increment.
Parameters:
| Name | Type | Description |
|---|---|---|
N |
number | Value to round |
V |
number | Rounding increment, in the same unit as N |
- Source:
Returns:
Rounded value (in the same unit as N).
- Type
- number
RoundTo(N, m) → {number}
Round a value to the nearest multiple of 1/m.
Parameters:
| Name | Type | Description |
|---|---|---|
N |
number | Value to round |
m |
number | Scale factor (in unitless). |
- Source:
Returns:
Rounded value
- Type
- number
SALR(tmp_prcl, qt_prcl, pres_prcl, tmp_env, qv_env, eRate, prate, warmest_mixed_phase_temp, coldest_mixed_phase_temp, qt_e)
The saturated lapse rate, believe me if i knew what i was looking at i would write it downb
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
tmp_prcl |
* | ||
qt_prcl |
* | ||
pres_prcl |
* | ||
tmp_env |
* | ||
qv_env |
* | ||
eRate |
* | ||
prate |
* | ||
warmest_mixed_phase_temp |
* | 273.15 | Kelvin |
coldest_mixed_phase_temp |
* | 253.13 | Kelvin |
qt_e |
* |
- Source:
Returns:
saturated_adiabatic_lapse_rate idk :(
SharpJS(target, propsopt) → {object}
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
target |
Element | string | ||
props |
object |
<optional> |
see README → "SharpJS(target, props)" |
- Source:
Returns:
handle
- Type
- object
SurfaceLayerInfo()
First sounding row if every field passes QC, else the second row.
- Source:
USALR(tmp_prcl, qv_prcl, tmp_env, qv_env, eRate)
UNSAUTRATED Parkel
Parameters:
| Name | Type | Description |
|---|---|---|
tmp_prcl |
* | |
qv_prcl |
* | |
tmp_env |
* | |
qv_env |
* | specific humidity is weird and i dont liek it at ALL! |
eRate |
* | entrainment rate |
- Source:
Returns:
UpdateCSMotStorm(CSMOT) → {void}
Replaces the configured custom storm-motion vector.
Parameters:
| Name | Type | Description |
|---|---|---|
CSMOT |
object | Storm-motion Cartesian vector (components in kt). |
- Source:
Returns:
No value (in 1).
- Type
- void
UpdatePresets(next) → {void}
Replaces the active visualization preset configuration when a value is supplied.
Parameters:
| Name | Type | Description |
|---|---|---|
next |
object | Preset configuration object (in 1). |
- Source:
Returns:
No value (in 1).
- Type
- void
VaporPressure(temp) → {number}
Estimates saturation vapour pressure from temperature using a polynomial fit.
Parameters:
| Name | Type | Description |
|---|---|---|
temp |
number | Temperature (in C). |
- Source:
- See:
-
- Bolton, D. (1980), The Computation of Equivalent Potential Temperature, https://doi.org/10.1175/1520-0493(1980)108%3C1046:TCDMAA%3E2.0.CO;2
Returns:
Saturation vapour pressure (in hPa), or the missing-data sentinel (in ANY).
- Type
- number
VirtTemp(Slice, SP, isRaw, Conv) → {number}
Calculates virtual temperature for either a raw-array or object-form sounding
layer, and limits it to at least the layer temperature.
Parameters:
| Name | Type | Description |
|---|---|---|
Slice |
Array | object | Sounding layer; raw fields or named fields, temperatures (in C). |
SP |
number | Layer pressure used for mixing-ratio calculation (in hPa). |
isRaw |
boolean | Whether Slice uses raw-array rather than object fields (in 1). |
Conv |
boolean | Legacy mode flag; currently does not change the calculation (in 1). |
- Source:
- See:
-
- American Meteorological Society, Glossary of Meteorology, "virtual temperature", https://glossary.ametsoc.org/wiki/virtual-temperature/
Returns:
Virtual temperature (in C).
- Type
- number
WindShear(L1, L2) → {Object}
Subtracts a lower-level wind vector from an upper-level wind vector.
Parameters:
| Name | Type | Description |
|---|---|---|
L1 |
Object | Lower wind vector (in kt). |
L2 |
Object | Upper wind vector (in kt). |
- Source:
Returns:
Wind-shear vector (in kt).
- Type
- Object
WindShearAvg(L1, L2) → {Object}
Calculates the component-wise average of two Cartesian wind vectors.
Parameters:
| Name | Type | Description |
|---|---|---|
L1 |
Object | First wind vector (in kt). |
L2 |
Object | Second wind vector (in kt). |
- Source:
Returns:
Mean Cartesian wind vector (in kt).
- Type
- Object
WindShearFind(Sounding, L1, L2, modify) → {Object}
Retrieves winds at two height levels and calculates their shear vector, or
their average vector when modify is true.
Parameters:
| Name | Type | Description |
|---|---|---|
Sounding |
object | Sounding profile (height in m; wind in kt). |
L1 |
number | Lower-level height above ground (in m). |
L2 |
number | Upper-level height above ground (in m). |
modify |
boolean | Return the mean of the endpoint winds instead of their difference (in 1). |
- Source:
Returns:
Mean wind or wind-shear components (in kt); components are NaN
when the requested upper level lies outside the sounding.
- Type
- Object
WindShearFindP(Sounding, L1, L2, modify) → {Object}
Retrieves winds at two pressure levels and calculates their shear vector, or
their average vector when modify is true.
Parameters:
| Name | Type | Description |
|---|---|---|
Sounding |
object | Sounding profile (pressure in hPa; wind in kt). |
L1 |
number | Lower-level pressure (in hPa). |
L2 |
number | Upper-level pressure (in hPa). |
modify |
boolean | Return the mean of the endpoint winds instead of their difference (in 1). |
- Source:
Returns:
Mean wind or wind-shear components (in kt); components are NaN
when the requested upper level lies outside the sounding.
- Type
- Object
Wobf(temp) → {number}
Evaluates the Wobus polynomial approximation used to solve moist-adiabatic
temperature transformations.
Parameters:
| Name | Type | Description |
|---|---|---|
temp |
number | Temperature (in C). |
- Source:
Returns:
Wobus-function temperature correction (in C).
- Type
- number
absHum(vp, tmp) → {number}
ABSOLUTE humidity (cinema)
Parameters:
| Name | Type | Description |
|---|---|---|
vp |
* | vapor pressure i think PA |
tmp |
* | temp in soemthing |
- Source:
Returns:
the ABSOLTUE humdity
- Type
- number
absoluteValue(value) → {number}
Return the absolute value of a number.
Parameters:
| Name | Type | Description |
|---|---|---|
value |
number | Number to make nonnegative (in UNK). |
- Source:
Returns:
Absolute value (in UNK).
- Type
- number
alwaysAvailable()
An availability callback that always succeeds.
- Source:
analyze(input, optionsopt) → {object}
Analyze a sounding.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
input |
string | object | sounding text, a parsed sounding, or arrays for fromArrays() | |||||||||||||||||||||
options |
object |
<optional> |
Properties
|
- Source:
Returns:
see README "Headless analysis"
- Type
- object
arrayIndex(value, index) → {number}
Return the index argument supplied to an array callback.
Parameters:
| Name | Type | Description |
|---|---|---|
value |
* | Array element. |
index |
number | Element index (in unitless). |
- Source:
Returns:
Element index (in unitless).
- Type
- number
autoAdapter()
localStorage when available, otherwise a cookie, otherwise memory.
Reads fall back too, so settings saved by an older cookie-only build are still found.
- Source:
breakdownCM1(Text) → {string}
Convert a CM1 input_sounding text file into SHARPpy raw sounding text.
Parameters:
| Name | Type | Description |
|---|---|---|
Text |
string | CM1 sounding text. |
- Source:
Returns:
SHARPpy-format sounding text.
- Type
- string
bufkitPath()
IEM archive directory and file names per model (NAM 06/18Z runs live under "namm").
- Source:
buildNexradVwpSkeletonSoundingFromParse()
ISA-style thermo column for VWP-only soundings. Winds still come from the NVW product.
buildVwpSounding(input, optionsopt) → {object|null}
Build a SharpJS VWP sounding from a NEXRAD Level III NVW product.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
input |
ArrayBuffer | Uint8Array | object | Raw NVW bytes, or the result of parseVWP(). | |||||||||||||||||
options |
object |
<optional> |
Properties
|
Returns:
sounding object for viewer.update({ vwp }) / engine.applyNexradVwpStoredSounding
- Type
- object | null
calcNxtPrs(pLower, deltaZ, theta, qv_gkg) → {number}
Estimate pressure one height increment above a level using the hypsometric equation.
Parameters:
| Name | Type | Description |
|---|---|---|
pLower |
number | Pressure at the lower level (in hPa). |
deltaZ |
number | Height increment (in m). |
theta |
number | Potential temperature (in K). |
qv_gkg |
number | Water-vapor mixing ratio (in g/kg). |
Returns:
Pressure at the upper level (in hPa).
- Type
- number
calc_ecape_a(sr_wind, psi, ncape, cape)
Calculate the entraining cape of a parcel
Parameters:
| Name | Type | Description |
|---|---|---|
sr_wind |
* | 0-1 km AGL average storm relative wind magnitude |
psi |
* | Parameter defined in eqn. 52, constant for a given equilibrium level |
ncape |
* | Buoyancy dilution potential of the free troposphere (eqn. 54) |
cape |
* | Convective available potential energy (CAPE, user-defined type) |
- Source:
Returns:
Entraining CAPE (eqn. 55)
calc_ecape_ncape(hght, pres, tmp, spechum, u_wind, v_wind, snding, ifb, ift, sm, passedInfo)
Calculate the entraining CAPE (ECAPE) of a parcel
Parameters:
| Name | Type | Description |
|---|---|---|
hght |
* | height Meters |
pres |
* | pressure mb |
tmp |
* | temp Celsius |
spechum |
* | specific humidity |
u_wind |
* | x comp of wind |
v_wind |
* | y comp of wind |
snding |
* | the sounding |
ifb |
* | 0 meters |
ift |
* | 1000 meters |
sm |
* | right |
passedInfo |
* | includes {lfc, el, StormMotion:{u,v}, Cape} |
- Source:
Returns:
calc_psi(el)
Parameter defined in eqn. 52, constant for a given equilibrium level, see COMPUTE_ECAPE.m L88 (pitchfork)
Parameters:
| Name | Type | Description |
|---|---|---|
el |
* | meters equilibirum lebel |
- Source:
Returns:
psi
calc_sr_wind(pres, uwind, vwind, hght, ifb, ift, CSMot, V) → {number}
Calculate the mean storm relative (as compared to Bunkers right motion) wind magnitude in the 0-1 km AGL layer
Parameters:
| Name | Type | Description |
|---|---|---|
pres |
* | |
uwind |
* | |
vwind |
* | |
hght |
* | |
ifb |
* | |
ift |
* | |
CSMot |
* | |
V |
* |
- Source:
Returns:
storm sr wind in m/s i thinkies
- Type
- number
calculateHeightsAboveGround(pressureLevels, temperatures) → {Array.<number>}
Integrates the hypsometric equation through pressure levels to derive heights
relative to the lowest profile level.
Parameters:
| Name | Type | Description |
|---|---|---|
pressureLevels |
Array.<number> | Ordered profile pressures (in hPa). |
temperatures |
Array.<number> | Layer temperatures paired with pressureLevels (in K). |
- Source:
- See:
-
- American Meteorological Society, Glossary of Meteorology, "hypsometric equation", https://glossary.ametsoc.org/wiki/hypsometric_equation/
Returns:
Heights above the lowest profile level, paired with pressureLevels (in m).
- Type
- Array.<number>
calculatePWAT(pressures, dewpoints) → {number|null}
Integrates water-vapour mixing ratio through the valid sounding column to estimate
precipitable water, skipping invalid layers and levels above 400 hPa.
Parameters:
| Name | Type | Description |
|---|---|---|
pressures |
Array.<number> | Pressure profile, paired with dewpoints (in hPa). |
dewpoints |
Array.<number> | Dew-point temperatures paired with pressures (in C). |
- Source:
- See:
-
- American Meteorological Society, Glossary of Meteorology, "precipitable water", https://glossary.ametsoc.org/wiki/precipitable_water/
Returns:
Precipitable water (in in), rounded to two decimal places, or null
when arrays are missing or have different lengths.
- Type
- number | null
calculateQV(pressure, dewpoint) → {number}
Convert pressure and dewpoint to water-vapor mixing ratio for CM1 output.
Parameters:
| Name | Type | Description |
|---|---|---|
pressure |
number | Pressure (in hPa). |
dewpoint |
number | Dewpoint temperature (in °C). |
- Source:
Returns:
Water-vapor mixing ratio (in g/kg).
- Type
- number
celsiusToKelvin(temperature) → {number}
Convert a temperature from Celsius to kelvins.
Parameters:
| Name | Type | Description |
|---|---|---|
temperature |
number | Temperature (in °C). |
- Source:
Returns:
Temperature (in K).
- Type
- number
clamp(n, m, a) → {number}
Restrict a numeric value to inclusive lower and upper bounds.
Parameters:
| Name | Type | Description |
|---|---|---|
n |
number | Value to constrain. |
m |
number | Lower bound. |
a |
number | Upper bound. |
- Source:
Returns:
Constrained value.
- Type
- number
clone(value) → {*}
Deep-copy JSON-compatible values while leaving primitives unchanged.
Parameters:
| Name | Type | Description |
|---|---|---|
value |
* | Value to copy. |
- Source:
Returns:
A JSON-deep copy of objects or the original primitive value.
- Type
- *
combineStationLists(lists) → {Array.<string>}
Merges station IDs returned by the four possible model initialization cycles.
Parameters:
| Name | Type | Description |
|---|---|---|
lists |
Array.<Array.<string>> | BUFKIT directory station lists. |
- Source:
Returns:
Sorted unique station IDs.
- Type
- Array.<string>
compareStationCodes(a, b) → {number}
Sorts mapped stations by their BUFKIT station code.
Parameters:
| Name | Type | Description |
|---|---|---|
a |
Object | First station. |
b |
Object | Second station. |
- Source:
Returns:
Locale-aware ordering result.
- Type
- number
computeThermo(Sound)
Surface-based, mixed-layer (lowest 100 mb) and most-unstable parcels, DCAPE and the effective
inflow layer. The storm motion used for ECAPE comes from UpdateCSMotStorm().
Parameters:
| Name | Type | Description |
|---|---|---|
Sound |
object | sounding.Sounding |
- Source:
computeWindParams(Sounding, Info, DP, CSMot, WindParamsopt)
Wind parameters keyed the way the chart panels read them, e.g.
SRH01 / BWD01 / EHI01 / MeanWind.M01 (0-1 km AGL)
SRHEb03 … (0-3 km above the effective inflow base)
ESRH, EBWD, BWDE, EHIE, LCLELSHR, BRM
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
Sounding |
object | full sounding object ({ Sounding: {...} }) | |
Info |
object | result of computeThermo() | |
DP |
object | null | the displayed parcel (SB/ML/MU/custom) | |
CSMot |
Object | storm motion (chart convention: y points south) | |
WindParams |
object |
<optional> |
object to fill (the engine reuses one); a new one by default |
- Source:
compute_NCAPE(T3, p0, q0, z0, Snding, T1, T2, LFC, EL)
Normal Cape
Parameters:
| Name | Type | Description |
|---|---|---|
T3 |
* | C array |
p0 |
* | Pa array |
q0 |
* | kg/kg array |
z0 |
* | m array |
Snding |
* | Sounding |
T1 |
* | kevin |
T2 |
* | kevin |
LFC |
* | m |
EL |
* | m |
- Source:
cookieAdapter(nameopt, optsopt)
A first-party cookie. Settings are a few hundred bytes, well under the 4 KB cookie limit.
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
name |
string |
<optional> |
||||||||||||||||||||||||||
opts |
object |
<optional> |
Properties
|
- Source:
countryName(country) → {string}
Expands a country code using the browser's localized region-name data.
Parameters:
| Name | Type | Description |
|---|---|---|
country |
string | Country code from the station catalog. |
- Source:
Returns:
Human-readable country name, or the source code if unknown.
- Type
- string
createBufkitMapButton(options)
Creates a plain-JavaScript BUFKIT location picker button and its map dialog.
Parameters:
| Name | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object | Picker configuration.
Properties
|
|||||||||
|
|||||||||||
|
|||||||||||
|
- Source:
Returns:
createControls(host)
Parameters:
| Name | Type | Description |
|---|---|---|
host |
HTMLElement | |
|
- Source:
createEngine(root, optionsopt) → {*}
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
root |
HTMLElement | element containing the chart markup from viewer/template.js | |||||||||||||||||
options |
object |
<optional> |
Properties
|
||||||||||||||||
|
- Source:
Returns:
Result of the function.
- Type
- *
createSettingsStore(optionsopt)
Settings store: validated settings, persisted through an adapter.
const store = createSettingsStore({ persist: 'cookie' });
store.get(); // full settings object
store.set({ units: 'metric' }); // validate, save, notify
store.subscribe((settings) => …); // returns an unsubscribe function
store.reset(); // back to defaults and clear storage
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
<optional> |
Properties
|
- Source:
createTimeSlider(element, stage, controls, doc, onSelect)
Create the fixed, chart-width timeline and keep it clear of the controls panel.
Parameters:
| Name | Type | Description |
|---|---|---|
element |
HTMLElement | Timeline container. |
stage |
HTMLElement | Chart display area. |
controls |
HTMLElement | Controls panel. |
doc |
Document | Owning document. |
onSelect |
- Source:
Returns:
degtoRad(degrees) → {number}
Converts an angle from degrees to radians.
Parameters:
| Name | Type | Description |
|---|---|---|
degrees |
number | Angle (in deg). |
- Source:
Returns:
Angle (in rad).
- Type
- number
density_temperature(tmp, qv, qt) → {number|Array.<number>}
Calculate the density temperature including water-vapor and total-water loading.
Parameters:
| Name | Type | Description |
|---|---|---|
tmp |
number | Array.<number> | Parcel or environmental temperature (in K). |
qv |
number | Array.<number> | Specific humidity (in kg/kg). |
qt |
number | Array.<number> | Total water mixing ratio (in kg/kg). |
Returns:
Density temperature (in K), preserving the input temperature shape.
- Type
- number | Array.<number>
dewpointCFromQv(qv, p) → {number}
Derive dewpoint from water-vapor mixing ratio and pressure.
Parameters:
| Name | Type | Description |
|---|---|---|
qv |
number | Water-vapor mixing ratio (in g/kg). |
p |
number | Pressure (in hPa). |
- Source:
Returns:
Dewpoint temperature (in °C).
- Type
- number
diffFromDefaults()
Only the keys whose values differ from DEFAULT_SETTINGS (what actually needs storing).
- Source:
domega(T, T1, T2) → {number}
Calculate the temperature derivative of the mixed-phase ice fraction.
Parameters:
| Name | Type | Description |
|---|---|---|
T |
number | Temperature (in K). |
T1 |
number | Warm mixed-phase limit (in K). |
T2 |
number | Cold mixed-phase limit (in K). |
- Source:
Returns:
Ice-fraction derivative (in K⁻¹).
- Type
- number
drawCanvasPath(ctx, points, closePath, stroke, fill) → {void}
Begins, traces, and optionally closes, strokes, and fills a path.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
ctx |
CanvasRenderingContext2D | Canvas drawing context. | |
points |
Array.<{x: number, y: number}> | Points in drawing order. | |
closePath |
boolean | false | Whether to close the path. |
stroke |
boolean | true | Whether to stroke the path. |
fill |
boolean | false | Whether to fill the path. |
- Source:
Returns:
- Type
- void
drawHodographLocationInset(ctx, canvas, sounding, onTilesReady, boundsopt) → {void}
Draws an OpenStreetMap inset centered on a sounding's coordinates.
OpenStreetMap tiles include mapped state and county administrative boundaries.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
ctx |
CanvasRenderingContext2D | Hodograph drawing context. | |
canvas |
HTMLCanvasElement | Hodograph canvas. | |
sounding |
object | Current sounding object. | |
onTilesReady |
|||
bounds |
Object |
<optional> |
Optional inset bounds. |
- Source:
Returns:
- Type
- void
dry_air_density(dap, tmp) → {number}
dry air density, units idk
Parameters:
| Name | Type | Description |
|---|---|---|
dap |
* | dry air pressure Pa ? |
tmp |
* | tempereature |
- Source:
Returns:
the density of this jawn
- Type
- number
drylift(p1, t1, td1)
Lifts a parcel dry adiabatically to its LCL and returns the LCL pressure and temperature.
Parameters:
| Name | Type | Description |
|---|---|---|
p1 |
number | Initial parcel pressure (in hPa). |
t1 |
number | Initial parcel temperature (in C). |
td1 |
number | Initial parcel dew-point temperature (in C). |
- Source:
- See:
-
- Bolton, D. (1980), The Computation of Equivalent Potential Temperature, https://doi.org/10.1175/1520-0493(1980)108%3C1046:TCDMAA%3E2.0.CO;2
Returns:
dwp_from_spechum(prs, sh) → {number}
dewpoiny from spec hum
Parameters:
| Name | Type | Description |
|---|---|---|
prs |
* | Pressure in Pa |
sh |
* | Specific hudmity (ew) |
- Source:
Returns:
dew point in Kelvin?
- Type
- number
dwp_from_vaporpres(vp) → {number}
DEW POINTY
Parameters:
| Name | Type | Description |
|---|---|---|
vp |
* | VAPOR PRESSURE!!!!!!!!!!!!!!! IN Pa |
- Source:
Returns:
IN KELVIN
- Type
- number
ecape_parcel(pres, hght, tmp, dwp, u_wind, v_wind, atipv, e_switch, pa_switch, Sounding, passedInfo, CSMot, ilb, ilt, parcelObject)
Parameters:
| Name | Type | Description |
|---|---|---|
pres |
* | array |
hght |
* | array |
tmp |
* | array celsuis |
dwp |
* | array celsiius |
u_wind |
* | array |
v_wind |
* | array |
atipv |
* | align_to_input_pressure_values |
e_switch |
* | entrainment_switch |
pa_switch |
* | pseudoadiabatic_switch |
Sounding |
* | the sounding |
passedInfo |
* | {lfc, el, StormMotion:{u,v}, Cape} |
CSMot |
* | storm motion passed |
ilb |
* | inflow_layer_bottom |
ilt |
* | inflow_layer_top |
parcelObject |
The rest of params, in the parcel object that is given from the other stuff and things |
- Source:
Returns:
entrainment_rate(cape, ecape, ncape, vsr, sch) → {number}
entrainment rate in 1/m
Parameters:
| Name | Type | Description |
|---|---|---|
cape |
* | in j/kg |
ecape |
* | in j/kg |
ncape |
* | in j/kg |
vsr |
* | idk |
sch |
* | storm coloumn height |
- Source:
Returns:
entrainment rate (M^-1)
- Type
- number
expandBufkitTimeSeries(soundings) → {Array.<object>}
Expand available BUFKIT forecasts into hourly positions, marking gaps unavailable.
Parameters:
| Name | Type | Description |
|---|---|---|
soundings |
Array.<object> | Parsed BUFKIT forecast soundings. |
- Source:
Returns:
Hourly slider positions in valid-time order.
- Type
- Array.<object>
exportSounding(sounding, formatopt, optionsopt) → {Object|null}
Serialize a sounding.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
sounding |
object | |||
format |
'Default' | 'SharpJS' | 'CM1' |
<optional> |
'Default' | |
options |
object |
<optional> |
see exportToSharppy |
- Source:
Returns:
- Type
- Object | null
exportToCm1(Snding) → {Object}
Serialize a sounding as a CM1 input_sounding file.
Parameters:
| Name | Type | Description |
|---|---|---|
Snding |
object | Parsed SharpJS sounding. |
- Source:
Returns:
CM1 text and its suggested file name.
- Type
- Object
exportToSharppy(Snding, OmegaBar, optionsopt)
Parameters:
| Name | Type | Attributes | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Snding |
object | sounding object | |||||||||||||
OmegaBar |
boolean | include the OMEGA column (SharpJS flavour) | |||||||||||||
options |
object |
<optional> |
Properties
|
- Source:
(async) fetchBufkitDirectory(model, run, hour) → {Promise.<Array.<string>>}
Fetches and parses one IEM model-run directory listing.
Parameters:
| Name | Type | Description |
|---|---|---|
model |
string | BUFKIT model directory. |
run |
Date | Selected run date. |
hour |
number | Forecast initialization hour in UTC. |
- Source:
Returns:
Station ids found in the directory.
- Type
- Promise.<Array.<string>>
fetchIemBufkit(q)
Archived model forecast sounding (BUFKIT) from the IEM archive.
Parameters:
| Name | Type | Description | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
q |
object |
Properties
|
- Source:
fetchIemBufkitForecasts(q) → {Promise.<Array.<object>>}
Fetch and parse every forecast hour from one IEM BUFKIT file.
Parameters:
| Name | Type | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
q |
object | BUFKIT archive selection.
Properties
|
- Source:
Returns:
Soundings for each forecast hour, in file order.
- Type
- Promise.<Array.<object>>
fetchIemRaob(q)
Observed upper-air sounding from the IEM archive.
Parameters:
| Name | Type | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
q |
object |
Properties
|
- Source:
fetchNexradVwp(q)
NEXRAD VAD Wind Profile (NVW) from Unidata's public Level III bucket (2020 onward).
Parameters:
| Name | Type | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
q |
object |
Properties
|
- Source:
fetchNexradVwpArchive(q) → {Promise.<Array.<object>>}
Fetch every archived NEXRAD VWP volume in an inclusive UTC time window.
Parameters:
| Name | Type | Description | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
q |
object | Archive query and optional progress callback.
Properties
|
||||||||||||||||||||||||
|
- Source:
Returns:
Soundings ordered by volume time.
- Type
- Promise.<Array.<object>>
fillVwpWindColumnsFromParse(VWPSounding, P) → {void}
Populate a VWP sounding's wind and thermodynamic profile columns from parsed radar levels.
Parameters:
| Name | Type | Description |
|---|---|---|
VWPSounding |
object | Sounding structure to update in place. |
P |
object | Parsed VWP product containing times, profiles, and wind levels. |
Returns:
Updates the sounding's wind, pressure, height, temperature, moisture, and slice columns.
- Type
- void
findBlock(buf, blockId) → {number}
Find a length-validated NEXRAD product block by identifier.
Parameters:
| Name | Type | Description |
|---|---|---|
buf |
BufReader | Product bytes. |
blockId |
number | Block identifier (in unitless). |
- Source:
Returns:
Block offset (in bytes), or -1 when absent.
- Type
- number
findMessageStart(buf) → {number}
Find a valid VWP message header inside a routed or padded byte buffer.
Parameters:
| Name | Type | Description |
|---|---|---|
buf |
BufReader | Product bytes to search. |
- Source:
Returns:
Message start offset (in bytes), or -1 when no VWP message is found.
- Type
- number
findTextHeaderEnd(buf) → {number}
Locate the end of a leading WMO/AWIPS text header.
Parameters:
| Name | Type | Description |
|---|---|---|
buf |
BufReader | Product bytes. |
- Source:
Returns:
Header end offset (in bytes), or 0 when no delimiter is found.
- Type
- number
flipY(motions) → {object}
Convert chart-space storm motion vectors back to meteorological y orientation.
Parameters:
| Name | Type | Description |
|---|---|---|
motions |
object | Motion vectors keyed by storm-motion identifier; components are in kt. |
- Source:
Returns:
A new motion map with each y component sign reversed.
- Type
- object
forecastHourOf(section) → {number}
Read the forecast lead time from a BUFKIT section.
Parameters:
| Name | Type | Description |
|---|---|---|
section |
string | BUFKIT forecast section. |
- Source:
Returns:
Forecast lead time (in hours), or NaN when no STIM field is present.
- Type
- number
formatCM1Line(values, isQV) → {string}
Format one row of values as fixed-width CM1 sounding text.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
values |
Array.<(number|string)> | Values to write; columns have the units required by CM1. | |
isQV |
boolean | false | Whether the row is the surface header row. |
- Source:
Returns:
Space-padded numeric fields for one CM1 row.
- Type
- string
fromArrays(profile, optionsopt) → {object}
Build a sounding from parallel arrays (one entry per level, any vertical order).
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
profile |
object |
Properties
|
|||||||||||||||||||||||||||||||||||||||||||||
options |
object |
<optional> |
Properties
|
||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||
options.isModel |
boolean |
<optional> |
gridded model data: skip the hodograph thinning used for high-resolution observations | ||||||||||||||||||||||||||||||||||||||||||||
options.isDropsonde |
boolean |
<optional> |
use the dropsonde layout |
- Source:
Returns:
sounding
- Type
- object
getAngleDifference(angle1, angle2) → {number}
Calculates the signed shortest angular difference from angle2 to angle1.
Parameters:
| Name | Type | Description |
|---|---|---|
angle1 |
number | First direction (in deg). |
angle2 |
number | Second direction (in deg). |
- Source:
Returns:
Signed shortest angular difference in the range [-180, 180) (in deg).
- Type
- number
(async) getAviationStationCatalog() → {Promise.<Array.<object>>}
Retrieves and caches the public Aviation Weather Center station metadata.
- Source:
Returns:
Station records with identifiers and geographic metadata.
- Type
- Promise.<Array.<object>>
getHodographMapTile(zoom, x, y, view, onReady)
Loads or retrieves a cached OpenStreetMap tile.
Parameters:
| Name | Type | Description |
|---|---|---|
zoom |
number | Slippy-map zoom level. |
x |
number | Tile x-coordinate before world wrapping. |
y |
number | Tile y-coordinate. |
view |
Window | Window that supplies the Image constructor. |
onReady |
- Source:
Returns:
getLayersWithinBounds(Sounding, lowerBound, upperBound, unit)
Retrieves the layers within the specified pressure or height bounds.
Parameters:
| Name | Type | Description |
|---|---|---|
Sounding |
* | |
lowerBound |
* | |
upperBound |
* | |
unit |
* |
- Source:
Returns:
(async) getOk(url, fetchImpl) → {Promise.<Response>}
Fetch a URL and reject non-success HTTP responses.
Parameters:
| Name | Type | Description |
|---|---|---|
url |
string | Resource URL. |
fetchImpl |
function | Fetch-compatible function. |
- Source:
Returns:
Successful HTTP response.
- Type
- Promise.<Response>
h(doc, tag, attrs, …children) → {HTMLElement}
Create a DOM element, apply attributes/listeners, and append flattened children.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
doc |
Document | Owner document for the element. | |
tag |
string | HTML tag name. | |
attrs |
object | Element properties, attributes, styles, and event handlers. | |
children |
Node | string | number | null | boolean |
<repeatable> |
Child nodes or text values. |
- Source:
Returns:
Created element.
- Type
- HTMLElement
heaviside(x1, x2) → {number}
Evaluate a step function, using x2 as the value exactly at the threshold.
Parameters:
| Name | Type | Description |
|---|---|---|
x1 |
number | Signed distance from the threshold |
x2 |
number | Value at the threshold |
- Source:
Returns:
0, x2, or 1 according to the sign of x1
- Type
- number
hypsometricHeights()
Heights (m) from the hypsometric equation, integrating up from `elevation` at the first level.
- Source:
ice_fraction(tmp, warmest_mixed_phase_temp, coldest_mixed_phase_temp)
HOW MUCh ice in the air :D
Parameters:
| Name | Type | Description |
|---|---|---|
tmp |
* | in kevin idk |
warmest_mixed_phase_temp |
* | 273.15 |
coldest_mixed_phase_temp |
* | 253.15 |
- Source:
ice_fraction_deriv(tmp, warmest_mixed_phase_temp, coldest_mixed_phase_temp) → {number}
HOW MUCH ICE IS IN THE AIR BRUH!
Parameters:
| Name | Type | Description |
|---|---|---|
tmp |
* | in kevin idk |
warmest_mixed_phase_temp |
* | 273.15 |
coldest_mixed_phase_temp |
* | 253.15 |
- Source:
Returns:
IN KELVIN
- Type
- number
inflate(bytes) → {Uint8Array}
Decompress a zlib-compressed product using the available runtime implementation.
Parameters:
| Name | Type | Description |
|---|---|---|
bytes |
Uint8Array | ArrayBuffer | Compressed product bytes (in bytes). |
- Source:
Returns:
Decompressed product bytes.
- Type
- Uint8Array
injectStyles()
Add the stylesheet to `doc` once.
- Source:
isBufkitText()
True when the text looks like a BUFKIT file.
- Source:
isEmptyObject(obj) → {boolean}
Determines whether a value is a non-null object with no own enumerable keys.
Parameters:
| Name | Type | Description |
|---|---|---|
obj |
* | Value to inspect (in 1). |
- Source:
Returns:
True only for an empty, non-array object (in 1).
- Type
- boolean
isSounding()
True for a parsed SharpJS sounding object.
- Source:
keyUnix()
"OAX_NVW_2024_05_26_12_03_45" → unix seconds.
- Source:
lastSynoptic()
Most recent 00/12 Z launch at least 2 h old.
- Source:
lcltemp(temp, dwpt) → {number}
Estimates the temperature of a parcel at its lifting-condensation level.
Parameters:
| Name | Type | Description |
|---|---|---|
temp |
number | Parcel temperature (in C). |
dwpt |
number | Parcel dew-point temperature (in C). |
- Source:
- See:
-
- Bolton, D. (1980), The Computation of Equivalent Potential Temperature, https://doi.org/10.1175/1520-0493(1980)108%3C1046:TCDMAA%3E2.0.CO;2
Returns:
LCL temperature (in C), or the missing-data sentinel (in ANY).
- Type
- number
lerp(a, b, t) → {number}
Linearly interpolate between two numeric values.
Parameters:
| Name | Type | Description |
|---|---|---|
a |
number | Starting value. |
b |
number | Ending value. |
t |
number | Interpolation fraction (in unitless). |
- Source:
Returns:
Interpolated value.
- Type
- number
levelAt()
Interpolated level at a pressure (mb) or height (m AGL with { agl: true }).
- Source:
linear_interp(input_arr, output_arr, input, debug)
Linearly interpolate amazing, morel ike arrayzing :D
Parameters:
| Name | Type | Description |
|---|---|---|
input_arr |
* | |
output_arr |
* | |
input |
* | |
debug |
* |
- Source:
Returns:
listBufkitForecastHours()
Forecast hours available in a BUFKIT file, in file order.
- Source:
(async) listBufkitStationCodes(model, run) → {Promise.<Array.<string>>}
Finds recent BUFKIT archive listings for all cycles on the selected run date.
Parameters:
| Name | Type | Description |
|---|---|---|
model |
string | BUFKIT model directory. |
run |
Date | Selected run date. |
- Source:
Returns:
Available station ids in the model archive.
- Type
- Promise.<Array.<string>>
(async) listKeys(prefix, fetchImpl) → {Promise.<Array.<string>>}
List NEXRAD S3 object keys matching a prefix.
Parameters:
| Name | Type | Description |
|---|---|---|
prefix |
string | Object-key prefix. |
fetchImpl |
function | Fetch-compatible function. |
- Source:
Returns:
Matching S3 object keys.
- Type
- Promise.<Array.<string>>
ln(x) → {number}
Calculate the natural logarithm using log identities.
Parameters:
| Name | Type | Description |
|---|---|---|
x |
number | Value to take the logarithm of (in unitless). |
- Source:
Returns:
Natural logarithm of x (in unitless).
- Type
- number
loadTornadoClimo() → {*}
Lazily loads and caches tornado climatology tables.
- Source:
Returns:
Result of the function.
- Type
- *
localStorageAdapter()
localStorage, when the browser allows it (it can throw in private mode or when blocked).
- Source:
log10(val) → {number}
Calculates the base-10 logarithm of a positive scalar.
Parameters:
| Name | Type | Description |
|---|---|---|
val |
number | Input scalar (in 1). |
- Source:
Returns:
Base-10 logarithm (in 1).
- Type
- number
matchStationMetadata(codes, records) → {Array.<{code:string, city:string, state:string, country:string, lat:number, lon:number}>}
Matches IEM BUFKIT ids to aviation station records and keeps map-ready entries.
Parameters:
| Name | Type | Description |
|---|---|---|
codes |
Array.<string> | BUFKIT ids taken from the IEM file names. |
records |
Array.<object> | Aviation station catalog. |
- Source:
Returns:
Mapped BUFKIT sites.
- Type
- Array.<{code:string, city:string, state:string, country:string, lat:number, lon:number}>
mean_layer_temp(Sounding, Temp1, Temp2, Stat) → {number|null|undefined}
Calculates a layer mean statistic between two temperature-defined levels.
Supports mean vertical motion, relative humidity, precipitable water, and mixing ratio.
Parameters:
| Name | Type | Description |
|---|---|---|
Sounding |
object | Sounding analysis object containing the profile and auxiliary data (pressure in hPa, temperatures in C). |
Temp1 |
number | First bounding air temperature (in C). |
Temp2 |
number | Second bounding air temperature (in C). |
Stat |
"Omega" | "RH" | "PWAT" | "MixRat" | Statistic selector (in 1). |
- Source:
Returns:
Mean omega (in ANY), relative humidity (in %),
precipitable water (in in), or mixing ratio (in g/kg); null/undefined follows the selected
statistic's underlying calculation.
- Type
- number | null | undefined
mean_mixratio(Sounding, pb, pt) → {number}
Calculates a pressure-weighted mean mixing ratio for a layer.
Parameters:
| Name | Type | Description |
|---|---|---|
Sounding |
object | Sounding profile (pressure in hPa; dew point in C). |
pb |
number | Bottom pressure (in hPa). |
pt |
number | Top pressure (in hPa). |
- Source:
Returns:
Mean mixing ratio (in g/kg).
- Type
- number
mean_relh(Sounding, pbot, ptop) → {number}
Calculates a pressure-weighted mean relative humidity between two pressure levels.
Parameters:
| Name | Type | Description |
|---|---|---|
Sounding |
object | Sounding profile (pressure in hPa; temperatures in C). |
pbot |
number | Bottom pressure (in hPa). |
ptop |
number | Top pressure (in hPa). |
- Source:
Returns:
Pressure-weighted mean relative humidity (in %).
- Type
- number
mean_rh_in_layer(Sounding, pbot, ptop) → {number}
Calculates the arithmetic mean relative humidity over pressure-interpolated
sounding samples in a layer.
Parameters:
| Name | Type | Description |
|---|---|---|
Sounding |
object | Sounding profile (pressure in hPa; temperatures in C). |
pbot |
number | Bottom-layer pressure (in hPa). |
ptop |
number | Top-layer pressure (in hPa). |
- Source:
Returns:
Mean relative humidity (in %), or NaN when the layer has no valid samples.
- Type
- number
mean_theta(Sounding, pb, pt) → {number}
Calculates the arithmetic mean potential temperature over a pressure layer.
Parameters:
| Name | Type | Description |
|---|---|---|
Sounding |
object | Sounding profile (pressure in hPa; temperatures in C). |
pb |
number | Bottom pressure (in hPa). |
pt |
number | Top pressure (in hPa). |
- Source:
Returns:
Mean potential temperature (in C).
- Type
- number
mean_thetae(Sounding, pb, pt) → {number}
Calculates the arithmetic mean equivalent potential temperature over a pressure layer.
Parameters:
| Name | Type | Description |
|---|---|---|
Sounding |
object | Sounding profile (pressure in hPa; temperatures in C). |
pb |
number | Bottom pressure (in hPa). |
pt |
number | Top pressure (in hPa). |
- Source:
Returns:
Mean equivalent potential temperature (in C).
- Type
- number
memoryAdapter()
Keeps settings for the life of the page only.
- Source:
migrate()
Upgrade a stored payload ({ v, settings }) to the current version.
- Source:
mixratio(pres, temp) → {number}
Calculate saturation mixing ratio from pressure and temperature.
Parameters:
| Name | Type | Description |
|---|---|---|
pres |
number | Ambient pressure (in hPa). |
temp |
number | Temperature (in °C). |
- Source:
Returns:
Saturation mixing ratio (in g/kg), or -9999 for invalid input.
- Type
- number
mixratio(pres, temp) → {number}
Estimates water-vapour mixing ratio from pressure and dew-point temperature.
Parameters:
| Name | Type | Description |
|---|---|---|
pres |
number | Pressure (in hPa). |
temp |
number | Dew-point temperature (in C). |
- Source:
- See:
-
- Bolton, D. (1980), The Computation of Equivalent Potential Temperature, https://doi.org/10.1175/1520-0493(1980)108%3C1046:TCDMAA%3E2.0.CO;2
Returns:
Mixing ratio (in g/kg), or the missing-data sentinel (in ANY).
- Type
- number
mixratiohighprec(p, tdC) → {number}
Calculate high-precision water-vapor mixing ratio from pressure and dewpoint.
Parameters:
| Name | Type | Description |
|---|---|---|
p |
number | Pressure (in hPa). |
tdC |
number | Dewpoint temperature (in °C). |
- Source:
Returns:
Water-vapor mixing ratio (in g/kg).
- Type
- number
modelFromFileName()
Model id from a BUFKIT file name, e.g. "rap_kdsm.buf" → "rap", "gfs3_kdsm.buf" → "gfs".
- Source:
mount(el, initialProps) → {object}
Create the chart DOM, engine, settings store, controls, and public handle for one target.
Parameters:
| Name | Type | Description |
|---|---|---|
el |
Element | Validated container element. |
initialProps |
object | Initial chart, data, and settings options. |
- Source:
Returns:
Mounted chart handle.
- Type
- object
nearestVal(arr, target, maxDist) → {number|null}
Find the array value nearest to a target when it is within the allowed distance.
Parameters:
| Name | Type | Description |
|---|---|---|
arr |
Array.<number> | Candidate numeric values |
target |
number | Target value |
maxDist |
number | Maximum accepted absolute distance |
- Source:
Returns:
Nearest candidate, or null when none is close enough.
- Type
- number | null
nexradDate(julianDate, seconds) → {string}
Convert a NEXRAD epoch-based Julian day and seconds-of-day to an ISO timestamp.
Parameters:
| Name | Type | Description |
|---|---|---|
julianDate |
number | One-based day count since 1970-01-01 UTC (in days). |
seconds |
number | Seconds elapsed in the day (in seconds). |
- Source:
Returns:
UTC timestamp in ISO 8601 format.
- Type
- string
noop()
A callback that intentionally does nothing.
- Source:
omega(T, T1, T2) → {number}
Calculate the fractional mixed-phase ice content between two temperature limits.
Parameters:
| Name | Type | Description |
|---|---|---|
T |
number | Temperature (in K). |
T1 |
number | Warm mixed-phase limit (in K). |
T2 |
number | Cold mixed-phase limit (in K). |
- Source:
Returns:
Ice fraction from 0 to 1 (in unitless).
- Type
- number
pad(value) → {string}
Formats an integer as a zero-padded UTC date or hour component.
Parameters:
| Name | Type | Description |
|---|---|---|
value |
number | Integer to format. |
- Source:
Returns:
Two-character string.
- Type
- string
pad(n, w) → {string}
Pad a value on the left with zeroes to the requested width.
Parameters:
| Name | Type | Description |
|---|---|---|
n |
* | Value to format. |
w |
number | Output width (in characters). |
- Source:
Returns:
Zero-padded string.
- Type
- string
parseAviationStationResponse(response) → {Promise.<unknown>}
Parses the HTTP response from the aviation station catalog.
Parameters:
| Name | Type | Description |
|---|---|---|
response |
Response | Station catalog response. |
- Source:
Returns:
Parsed station JSON.
- Type
- Promise.<unknown>
parseBufkit(text, optionsopt) → {object}
Parse one forecast hour of a BUFKIT file.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
text |
string | ||||||||||||||||||||||
options |
object |
<optional> |
Properties
|
- Source:
Returns:
sounding
- Type
- object
parseBufkitTime()
"240526/1200" → Date (UTC).
- Source:
parseCM1Sounding(header, lines) → {Array.<object>}
Convert CM1 surface metadata and profile rows into pressure-level records.
Parameters:
| Name | Type | Description |
|---|---|---|
header |
Array.<number> | Surface pressure (hPa), potential temperature (K), and mixing ratio (g/kg). |
lines |
Array.<string> | CM1 sounding lines; profile height is in m, theta in K, mixing ratio in g/kg, and wind components in m/s. |
- Source:
Returns:
Profile records with pressure (in hPa), height (in m), temperature/dewpoint (in °C), direction (in degrees), and speed (in m/s).
- Type
- Array.<object>
parseIemRaob(json, indexopt) → {object}
Convert one IEM RAOB profile to a SharpJS sounding.
Dewpoints missing above the last moist level are filled by holding that level's relative humidity.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
json |
object | Response of raob.py, or one entry of its `profiles` array. | ||
index |
number |
<optional> |
0 | Which profile to use when `json.profiles` has several. |
Returns:
sounding
- Type
- object
parsePDB(buf, offset) → {object}
Read radar and volume metadata from a NEXRAD Product Description Block.
Parameters:
| Name | Type | Description |
|---|---|---|
buf |
BufReader | Product bytes. |
offset |
number | PDB start offset (in bytes). |
- Source:
Returns:
Radar metadata with latitude/longitude (in degrees), height (in ft), product/VCP codes, and volume/generation dates and times.
- Type
- object
parseSounding(text, optionsopt) → {object}
Parse any supported sounding text into a SharpJS sounding object.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
text |
string | ||||||||||||||||||
options |
object |
<optional> |
Properties
|
- Source:
Returns:
sounding
- Type
- object
parseSymbologyWinds(buf, offset, pdb) → {Array.<object>}
Decode wind barbs and chart labels from the symbology block fallback.
Parameters:
| Name | Type | Description |
|---|---|---|
buf |
BufReader | Product bytes. |
offset |
number | Symbology block offset (in bytes). |
pdb |
object | Parsed product description, including radar height (in ft). |
- Source:
Returns:
Wind levels with altitude (in km AGL and ft MSL), direction (in degrees), and speed/error (in kt).
- Type
- Array.<object>
parseTabularFull(buf, offset, radarHeightKm) → {Object}
Decode the tabular VAD output and its adaptation metadata.
Parameters:
| Name | Type | Description |
|---|---|---|
buf |
BufReader | Product bytes. |
offset |
number | Tabular block offset (in bytes). |
radarHeightKm |
number | Radar height above mean sea level (in km). |
- Source:
Returns:
Wind levels (altitude in km AGL/ft MSL, direction in degrees, speed/error in kt, range in nmi, elevation in degrees) and parsed thresholds.
- Type
- Object
parseVWP(raw) → {object}
Parse a NEXRAD Level III VWP product.
Parameters:
| Name | Type | Description |
|---|---|---|
raw |
Uint8Array | ArrayBuffer | Buffer | Raw file bytes. |
- Source:
Returns:
Structured wind profile data.
- Type
- object
polar()
Wind vector (knots, as produced by the calc functions) → direction it blows from and speed.
Same conversion the chart uses for its labels.
- Source:
polarMotion()
Storm motions are kept with y flipped (screen space) once lifted into the chart; undo that.
- Source:
pres_at_hght(pres, hghtabove, tmp) → {number}
PRessure at height whatever
Parameters:
| Name | Type | Description |
|---|---|---|
pres |
* | in mb |
hghtabove |
* | in meters |
tmp |
* | in KELVIN |
- Source:
Returns:
in mb
- Type
- number
projectHodographMapCoordinate(lat, lon, zoom) → {Object}
Projects latitude and longitude into Web Mercator world pixels.
Parameters:
| Name | Type | Description |
|---|---|---|
lat |
number | Latitude in degrees. |
lon |
number | Longitude in degrees. |
zoom |
number | Slippy-map zoom level. |
- Source:
Returns:
Projected world-pixel coordinates.
- Type
- Object
qc(val) → {number}
Check whether a numeric value falls inside the broad range accepted by this module.
Parameters:
| Name | Type | Description |
|---|---|---|
val |
number | Value to check. |
- Source:
Returns:
1 when accepted and 0 when outside the accepted range (in unitless).
- Type
- number
r_sat(tmp, prs, ice_flag, warmest_mixed_phase_temp, coldest_mixed_phase_temp)
something saturated OH I GET IT, basically mixing ratio between SOLID and LIQIUD :D
Parameters:
| Name | Type | Description |
|---|---|---|
tmp |
* | like it could be an array but i have no fucking idea lol |
prs |
* | |
ice_flag |
* | integer |
warmest_mixed_phase_temp |
* | in kelvinm |
coldest_mixed_phase_temp |
* | in kevin |
- Source:
radarIdFromHeader()
Radar id from the WMO/AWIPS text header (e.g. "NVWOAX" → "OAX"), if the file still has it.
raobStationLocation()
Location of an upper-air station from the IEM station table (cached), or null.
- Source:
(async) readFile()
Text in any supported format, or binary (NEXRAD VWP)?
- Source:
readKeyValues()
"KEY = value" pairs from a BUFKIT station block. An empty value (e.g. "STID = STNM = 1") stays ''.
- Source:
relh(p, t, td) → {number}
Calculates relative humidity from temperature and dew point; pressure is accepted
for compatibility but is not used in the calculation.
Parameters:
| Name | Type | Description |
|---|---|---|
p |
number | Pressure (in hPa). |
t |
number | Air temperature (in C). |
td |
number | Dew-point temperature (in C). |
- Source:
Returns:
Relative humidity (in %).
- Type
- number
renderChart(host) → {HTMLElement}
Build the chart inside `host`.
Parameters:
| Name | Type | Description |
|---|---|---|
host |
HTMLElement |
- Source:
Returns:
the chart root (pass it to createEngine)
- Type
- HTMLElement
resetAviationStationCatalog(error) → {never}
Clears a rejected catalog request so that a later map opening can retry.
Parameters:
| Name | Type | Description |
|---|---|---|
error |
Error | Catalog loading error. |
- Source:
Returns:
Rethrows the loading error.
- Type
- never
resolveAdapter(persist, key)
Turn the `persist` option into an adapter.
Parameters:
| Name | Type | Description |
|---|---|---|
persist |
boolean | 'auto' | 'local' | 'cookie' | 'memory' | object | |
key |
string |
- Source:
resolveTarget(target) → {Element}
Resolve a selector or validate an existing element as the chart mount target.
Parameters:
| Name | Type | Description |
|---|---|---|
target |
Element | string | CSS selector or DOM element. |
- Source:
Returns:
The element that will contain the chart.
- Type
- Element
rev_linear_interp(input_arr, output_arr, input, debug)
Its some sort of linera interpolation but idk and idc!
Parameters:
| Name | Type | Description |
|---|---|---|
input_arr |
* | |
output_arr |
* | |
input |
* | |
debug |
* |
- Source:
Returns:
sanitizeSettings()
Merge `input` over `base` keeping only known keys with valid values.
presetOverrides is merged per preset so a partial object is fine.
- Source:
satlift(p, thetam, conv) → {number}
Iteratively solves for the temperature of a saturated parcel at a pressure level.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
p |
number | Target pressure (in hPa). | |
thetam |
number | Moist-adiabatic potential-temperature parameter (in C). | |
conv |
number | 0.1 | Iteration convergence tolerance (in C). |
- Source:
Returns:
Saturated parcel temperature (in C), or the missing-data sentinel (in ANY).
- Type
- number
set(partial) → {boolean}
Parameters:
| Name | Type | Description |
|---|---|---|
partial |
object | |
|
- Source:
Returns:
whether anything changed
- Type
- boolean
sharppyText(title, body) → {string}
Wrap a sounding title and raw level rows in SHARPpy text-file markers.
Parameters:
| Name | Type | Description |
|---|---|---|
title |
string | Sounding title. |
body |
string | Formatted raw sounding rows. |
Returns:
Complete SHARPpy-format sounding text.
- Type
- string
specHum(prs, vp)
SPECIFIC humidity (dislike this thing)
Parameters:
| Name | Type | Description |
|---|---|---|
prs |
* | pressure in Pa |
vp |
* | vapor pressure in Pa |
- Source:
Returns:
in kg m^-3 i think
spec_heat_cap_of_moist_air(spechum)
Specific heat capacity of moist air .
Parameters:
| Name | Type | Description |
|---|---|---|
spechum |
* | in kg/kg i think |
- Source:
Returns:
the HEAT capacity i think
spechum_from_dwp(prs, dwp) → {number}
Specific humidity from Dewpoint
Parameters:
| Name | Type | Description |
|---|---|---|
prs |
* | in hPA i think |
dwp |
* | in kelvin maybe idk |
- Source:
Returns:
number
- Type
- number
splitSections(text) → {Array.<string>}
Split BUFKIT text into station forecast sections and trim trailing station metadata.
Parameters:
| Name | Type | Description |
|---|---|---|
text |
string | BUFKIT file contents. |
- Source:
Returns:
Forecast section strings in file order.
- Type
- Array.<string>
srhTotal(srh) → {number|null}
Normalize signed storm-relative helicity data to its rounded total.
Parameters:
| Name | Type | Description |
|---|---|---|
srh |
number | object | null | A precomputed total or a result with SRHP and SRHM (in m²/s²). |
- Source:
Returns:
Total SRH (in m²/s²), rounded to an integer, or null when unavailable.
- Type
- number | null
stationStateName(state, country) → {string}
Expands US state and territory abbreviations while retaining other region labels.
Parameters:
| Name | Type | Description |
|---|---|---|
state |
string | State or province code from the station catalog. |
country |
string | Country code from the station catalog. |
- Source:
Returns:
Human-readable state or province name.
- Type
- string
strokeCanvasLine(ctx, x1, y1, x2, y2) → {void}
Begins, traces, and strokes a single line.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
CanvasRenderingContext2D | Canvas drawing context. |
x1 |
number | Starting x-coordinate. |
y1 |
number | Starting y-coordinate. |
x2 |
number | Ending x-coordinate. |
y2 |
number | Ending y-coordinate. |
- Source:
Returns:
- Type
- void
strokeCanvasSegments(ctx, segments) → {void}
Begins and strokes independent line segments in a single canvas path.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx |
CanvasRenderingContext2D | Canvas drawing context. |
segments |
- Source:
Returns:
- Type
- void
summarizeParcel(p) → {object|null}
Select and round the public diagnostic fields from a parcel calculation.
Parameters:
| Name | Type | Description |
|---|---|---|
p |
object | null | Parcel result, including thermodynamic diagnostics. |
- Source:
Returns:
Rounded parcel fields: pressure (in hPa), heights (in m), CAPE/CIN (in J/kg), and NCAPE (in UNK); or null.
- Type
- object | null
tempCFromTheta(theta, p) → {number}
Convert potential temperature to air temperature at a pressure level.
Parameters:
| Name | Type | Description |
|---|---|---|
theta |
number | Potential temperature (in K). |
p |
number | Pressure (in hPa). |
Returns:
Air temperature (in °C).
- Type
- number
temp_at_mixrat(mr, pres) → {number}
Inverts the mixing-ratio relationship to estimate temperature at a pressure.
Parameters:
| Name | Type | Description |
|---|---|---|
mr |
number | Mixing ratio (in g/kg). |
pres |
number | Pressure (in hPa). |
- Source:
- See:
-
- Bolton, D. (1980), The Computation of Equivalent Potential Temperature, https://doi.org/10.1175/1520-0493(1980)108%3C1046:TCDMAA%3E2.0.CO;2
Returns:
Temperature (in C), or the missing-data sentinel (in ANY).
- Type
- number
thalvl(thta, temp) → {number}
Calculates the pressure at which a specified temperature lies on a dry adiabat.
Parameters:
| Name | Type | Description |
|---|---|---|
thta |
number | Potential temperature (in C). |
temp |
number | Parcel temperature (in C). |
- Source:
Returns:
Pressure (in hPa), or the missing-data sentinel (in ANY).
- Type
- number
theta(pres, temp, pres2) → {number}
Calculates potential temperature using Poisson's equation.
Parameters:
| Name | Type | Description |
|---|---|---|
pres |
number | Parcel pressure (in hPa). |
temp |
number | Parcel temperature (in C). |
pres2 |
number | Reference pressure (in hPa). |
- Source:
- See:
-
- Bolton, D. (1980), The Computation of Equivalent Potential Temperature, https://doi.org/10.1175/1520-0493(1980)108%3C1046:TCDMAA%3E2.0.CO;2
Returns:
Potential temperature (in C), or the missing-data sentinel (in ANY).
- Type
- number
thetae(p, t, td) → {number}
Calculates equivalent potential temperature by lifting a parcel dry to its LCL
and moist adiabatically to the reference pressure.
Parameters:
| Name | Type | Description |
|---|---|---|
p |
number | Parcel pressure (in hPa). |
t |
number | Parcel temperature (in C). |
td |
number | Parcel dew-point temperature (in C). |
- Source:
- See:
-
- Bolton, D. (1980), The Computation of Equivalent Potential Temperature, https://doi.org/10.1175/1520-0493(1980)108%3C1046:TCDMAA%3E2.0.CO;2
Returns:
Equivalent potential temperature (in C).
- Type
- number
thetahighprec(p, tC, p0) → {number}
Calculate potential temperature for a pressure level.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
p |
number | Pressure (in hPa). | |
tC |
number | Air temperature (in °C). | |
p0 |
number | 1000 | Reference pressure (in hPa). |
- Source:
Returns:
Potential temperature (in K).
- Type
- number
titleTime()
"2024-05-26T12:00:00Z" → "240526/1200" (SHARPpy title time).
toCelsius(v, unit) → {number}
Convert a temperature value from the selected unit to Celsius.
Parameters:
| Name | Type | Description |
|---|---|---|
v |
number | Temperature value (in the unit named by unit). |
unit |
string | Input temperature unit: C, K, or F. |
- Source:
Returns:
Temperature (in °C), or NaN when v is invalid.
- Type
- number
toDate(time) → {Date}
Normalize a supported date input and reject invalid timestamps.
Parameters:
| Name | Type | Description |
|---|---|---|
time |
Date | string | number | Date, parseable date string, or numeric timestamp (in milliseconds). |
- Source:
Returns:
Valid date object representing the same instant.
- Type
- Date
toSounding(input, optionsopt)
Accept anything SharpJS can draw and return a parsed sounding:
- text in any format parseSounding() understands
- a parsed sounding (returned as is)
- an arrays object for fromArrays(); it may also carry fromArrays options
(title, location, units, elevation, isModel, isDropsonde)
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
input |
string | object | ||
options |
object |
<optional> |
passed to parseSounding / fromArrays |
- Source:
unwrap(raw) → {BufReader}
Remove transport headers and decompress a raw NEXRAD product when needed.
Parameters:
| Name | Type | Description |
|---|---|---|
raw |
Uint8Array | ArrayBuffer | Buffer | Product data from the feed (in bytes). |
- Source:
Returns:
Reader positioned at the NEXRAD message header.
- Type
- BufReader
updraft_radius(erate)
updraft size en meter
Parameters:
| Name | Type | Description |
|---|---|---|
erate |
* | floating |
- Source:
Returns:
updrafting meters
v()
SharpJS stylesheet. Injected once per document by SharpJS() (pass { injectStyles: false } to
ship your own). Everything is scoped under .sharpjs; theme it by overriding the --sjs-* variables.
Chart geometry is in percentages of the chart box (18:12 aspect), matching the canvas
resolutions the engine draws at.
- Source:
validateAviationStationRecords(records) → {Array.<object>}
Ensures the aviation station catalog has the expected array shape.
Parameters:
| Name | Type | Description |
|---|---|---|
records |
unknown | Parsed station data. |
- Source:
Returns:
Valid station records.
- Type
- Array.<object>
vappres(temp) → {number}
Estimate saturation vapor pressure from temperature using the module's polynomial fit.
Parameters:
| Name | Type | Description |
|---|---|---|
temp |
number | Temperature (in °C). |
- Source:
Returns:
Saturation vapor pressure (in hPa), or -9999 for an invalid temperature.
- Type
- number
virtemp(pres, temp, dwpt) → {number}
Calculates virtual temperature from pressure, temperature, and dew point using
the water-vapour mixing ratio.
Parameters:
| Name | Type | Description |
|---|---|---|
pres |
number | Pressure (in hPa). |
temp |
number | Air temperature (in C). |
dwpt |
number | Dew-point temperature (in C). |
- Source:
- See:
-
- American Meteorological Society, Glossary of Meteorology, "virtual temperature", https://glossary.ametsoc.org/wiki/virtual-temperature/
Returns:
Virtual temperature (in C), or a supplied temperature/missing sentinel.
- Type
- number
vp(dwp)
Vapor pressure
Parameters:
| Name | Type | Description |
|---|---|---|
dwp |
* | in kelvin |
- Source:
Returns:
in hPA
vp_from_spechum(prs, sh) → {number}
vapor pressure from pres and spechiifih
Parameters:
| Name | Type | Description |
|---|---|---|
prs |
* | Pressure in Pa |
sh |
* | Specific hudmity (ew) |
- Source:
Returns:
Vapor Pressure in Pa!
- Type
- number
vwpVolumeMetaFromParse() → {Object}
Returns:
- Type
- Object
wetbulb(pres, tmp, dew) → {number}
Calculates wet-bulb temperature by lifting the parcel to saturation and returning
it to the original pressure.
Parameters:
| Name | Type | Description |
|---|---|---|
pres |
number | Pressure (in hPa). |
tmp |
number | Air temperature (in C). |
dew |
number | Dew-point temperature (in C). |
- Source:
Returns:
Wet-bulb temperature (in C).
- Type
- number
wetlift(p, t, p2) → {number}
Lifts a parcel moist adiabatically from its starting pressure and temperature
to a target pressure.
Parameters:
| Name | Type | Description |
|---|---|---|
p |
number | Starting pressure (in hPa). |
t |
number | Starting temperature (in C). |
p2 |
number | Target pressure (in hPa). |
- Source:
Returns:
Parcel temperature at p2 (in C), or the missing-data sentinel (in ANY).
- Type
- number
windDirDiff(dir1, dir2) → {number}
Calculate the signed shortest angular difference between two wind directions.
Parameters:
| Name | Type | Description |
|---|---|---|
dir1 |
number | First wind direction (in degrees). |
dir2 |
number | Second wind direction (in degrees). |
Returns:
Signed angular difference (in degrees).
- Type
- number
withLocation(sounding, location)
Attach a location to a sounding (used for the map inset, the tornado climatology panel and
hemisphere-aware wind barbs). Returns the same sounding.
Parameters:
| Name | Type | Description |
|---|---|---|
sounding |
object | |
location |
Object | degrees, longitude negative west |
- Source: