Jump to content

Module:Storm categories/doc

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Chlod (talk | contribs) at 11:13, 21 February 2021 (Create documentation page). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

Usage

This module exports three functions for templates: p.color, p.name, and p.sortkey. It also provides p._color, p._name, and p._sortkey for use in other modules.

Color

Provides the color of the given tropical cyclone category code. This comes in the format of their raw hexidecimal code.

Code Output
<span style="padding:4px;border:1px solid black;background-color:#{{#invoke:Tropical cyclone categories|color|depression}}">depression</span> depression

Name

Provides the name of the given tropical cyclone category code. A optional basin argument can be provided as the second argument in order to slightly tweak the name of the category, if the given category definition supports it. This function is case-insensitive, and all non-alphanumeric characters are stripped.

Code Output
{{#invoke:Tropical cyclone categories|name|severe}} Severe tropical storm
{{#invoke:Tropical cyclone categories|name|Aus -- 5}} Category 5 severe tropical cyclone
{{#invoke:Tropical cyclone categories|name|cat5}} Category 5-equivalent tropical cyclone
{{#invoke:Tropical cyclone categories|name|cat5|WPac}} Category 5-equivalent super typhoon

Sortkey

The sortkey is a number that aids in sorting categories. Using the sortkey, it is possible to automatically sort a table of tropical cyclones given their category code. Due to the ambiguous nature of sortkeys, tables may be sorted incorrectly if values from other basins were used. For categories that span multiple basins, however, (e.g. depression and storm) they are given the lowest possible sortkeys in order to achieve maximum compatibility.

The sortkey format is as follows. Note that not all values between the given ranges were used. The arrangement of these were determined by their positions in the {{Storm colour}} template.

Basin Sortkey range
Global 0 to 9999
Atl/EPac/SAtl 10000 to 19999
WPac 20000 to 29999
Nio 30000 to 39999
Aus/Fiji 40000 to 49999
SWio 50000 to 59999
Historical 60000 to 69999
Global (unused) 90000 to 99999

A demonstration of a sortable table using these sortkeys can be found below. Note that it does not use categories outside of its own basin (in this case, the Atl/EPac/SAtl basin) and the global range.

Category Sortkey Code
cat3 80,030 {{#invoke:Tropical cyclone categories|sortkey|cat3}}
cat1 80,010 {{#invoke:Tropical cyclone categories|sortkey|cat1}}
cat5 80,050 {{#invoke:Tropical cyclone categories|sortkey|cat5}}
cat4 80,040 {{#invoke:Tropical cyclone categories|sortkey|cat4}}
depression 90 {{#invoke:Tropical cyclone categories|sortkey|depression}}
cat2 80,020 {{#invoke:Tropical cyclone categories|sortkey|cat2}}

Compatibility

This module was designed to be backwards-compatible with {{Tc nom list}} as of revision 919481476 and {{Storm colour}} as of revision 990905269. For category names that did not have matching colors, their colors have been guessed. For colors with aliases that were too vague (e.g. 5 for the color of cat5, but could have also meant Aus5 or shem5), the vague alias works only with p.color.

Compatibility with {{Storm colour}} Compatibility with {{Tc nom list}}
No comparison table yet.
Name {{Tc nom list}} Module:Tropical cyclone categories Equal?
depression Tropical depression Tropical depression yes
shemdepression Tropical depression Tropical depression yes
swiodepression Tropical depression Tropical depression yes
spdepression Tropical depression Tropical depression yes
nwpdepression Tropical depression Tropical depression yes
storm Tropical storm Tropical storm yes
nwpstorm Tropical storm Tropical storm yes
niodepression Depression Depression yes
deepdepression Deep depression Deep depression yes
cyclstorm Cyclonic storm Cyclonic storm yes
svrcyclstorm Severe cyclonic storm Severe cyclonic storm yes
vsvrcyclstorm Very severe cyclonic storm Very severe cyclonic storm yes
esvrcyclstorm Extremely severe cyclonic storm Extremely severe cyclonic storm yes
sprcyclstorm Super cyclonic storm Super cyclonic storm yes
ZODW Zone of disturbed weather Zone of disturbed weather yes
subdisturbance Subtropical disturbance Subtropical disturbance yes
moddepression Moderate tropical depression Moderate tropical depression yes
mtstorm Moderate tropical storm Moderate tropical storm yes
STS Severe tropical storm Severe tropical storm yes
swiosts Severe tropical storm Severe tropical storm yes
severedep Severe tropical depression Severe tropical depression yes
shemtc Tropical cyclone Tropical cyclone yes
swiotc Tropical cyclone Tropical cyclone yes
intense Intense tropical cyclone Intense tropical cyclone yes
vintense Very intense tropical cyclone Very intense tropical cyclone yes
low Tropical low Tropical low yes
sublow Subtropical low Subtropical low yes
Aus1 Category 1 tropical cyclone Category 1 tropical cyclone yes
Aus2 Category 2 tropical cyclone Category 2 tropical cyclone yes
Aus3 Category 3 severe tropical cyclone Category 3 severe tropical cyclone yes
Aus4 Category 4 severe tropical cyclone Category 4 severe tropical cyclone yes
Aus5 Category 5 severe tropical cyclone Category 5 severe tropical cyclone yes
shemsvrtc Severe tropical cyclone Severe tropical cyclone yes
disturbance Tropical disturbance Tropical disturbance yes
swiodisturbance Tropical disturbance Tropical disturbance yes
TY Typhoon Typhoon yes
typhoon Typhoon Typhoon yes
subdepression Subtropical depression Subtropical depression yes
swsubdep Subtropical depression Subtropical depression yes
subtropical Subtropical storm Subtropical storm yes
subtropicalcyclone Subtropical cyclone Subtropical cyclone yes
cat1 Category 1-equivalent tropical cyclone Category 1-equivalent tropical cyclone yes
cat2 Category 2-equivalent tropical cyclone Category 2-equivalent tropical cyclone yes
cat3 Category 3-equivalent tropical cyclone Category 3-equivalent tropical cyclone yes
cat4 Category 4-equivalent tropical cyclone Category 4-equivalent tropical cyclone yes
cat5 Category 5-equivalent tropical cyclone Category 5-equivalent tropical cyclone yes
cat1 (Atl) Category 1 hurricane Category 1 hurricane yes
cat2 (Atl) Category 2 hurricane Category 2 hurricane yes
cat3 (Atl) Category 3 major hurricane Category 3 major hurricane yes
cat4 (Atl) Category 4 major hurricane Category 4 major hurricane yes
cat5 (Atl) Category 5 major hurricane Category 5 major hurricane yes
cat1 (EPac) Category 1 hurricane Category 1 hurricane yes
cat2 (EPac) Category 2 hurricane Category 2 hurricane yes
cat3 (EPac) Category 3 major hurricane Category 3 major hurricane yes
cat4 (EPac) Category 4 major hurricane Category 4 major hurricane yes
cat5 (EPac) Category 5 major hurricane Category 5 major hurricane yes
cat1 (SAtl) Category 1-equivalent hurricane Category 1-equivalent hurricane yes
cat2 (SAtl) Category 2-equivalent hurricane Category 2-equivalent hurricane yes
cat3 (SAtl) Category 3-equivalent hurricane Category 3-equivalent hurricane yes
cat4 (SAtl) Category 4-equivalent hurricane Category 4-equivalent hurricane yes
cat5 (SAtl) Category 5-equivalent hurricane Category 5-equivalent hurricane yes
cat1 (WPac) Category 1-equivalent typhoon Category 1-equivalent typhoon yes
cat2 (WPac) Category 2-equivalent typhoon Category 2-equivalent typhoon yes
cat3 (WPac) Category 3-equivalent typhoon Category 3-equivalent typhoon yes
cat4 (WPac) Category 4-equivalent typhoon Category 4-equivalent typhoon yes
cat5 (WPac) Category 5-equivalent super typhoon Category 5-equivalent super typhoon yes
potential Potential tropical cyclone Potential tropical cyclone yes
extratropical Extratropical cyclone Extratropical cyclone yes
STY Category 4-equivalent super typhoon Category 4-equivalent super typhoon yes
MD Monsoon depression Monsoon depression yes
#default Unknown-strength storm Unknown-strength storm yes