Jump to content

Module:Convert/extra

Frae Wikipedia, the free beuk o knawledge
-- Extra conversion data used by Module:Convert.
--
-- [[Module:Convert/data]] defines all units and is transcluded in all pages
-- where [[Module:Convert]] is used. Testing new units by editing that module
-- would invalidate the cache for all affected pages.
--
-- For quick changes and experiments with new units, this module can be edited.
-- Since this module is transcluded in only a small number of pages, changes
-- should cause little server overhead and should propagate quickly.
--
-- If a unit is defined in the data module, any definition here is ignored,
-- so defining the same unit in both modules is not an error.
-- A unit defined here can refer to units that are also defined here, and
-- can refer to units defined in the data module.
--
-- Periodically, those extra units that are wanted permanently can be removed
-- from here after being added to [[Module:Convert/data]].

local extra_units = {
    ["$/g"] = {
	per      = { "$", "g" },
	utype    = "cost $ per unit mass",
	default  = "$/lb",
    },
    ["$/oz"] = {
	per      = { "$", "oz" },
	utype    = "cost $ per unit mass",
	default  = "$/g",
    },
    ["gr water"] = {
        name1    = "grains water",
        name2    = "grains water",
        symbol   = "gr H<sub>2</sub>O",
        utype    = "volume",
        scale    = 0.00000006479891,
        default  = "cm3",
        link     = "Grain (unit)",
    },
    ["lb(f)"] = {
        name1    = "pound",
        symbol   = "lb",
        utype    = "force",
        scale    = 4.4482216152605,
        default  = "N",
        link     = "Pound-force",
    },
    ["dpi"] = {
    	name1    = "DPI",
    	name2    = "DPI",
    	symbol   = "DPI",
    	utype    = "length",
    	invert   = -1,
		iscomplex= true,
    	scale    = 1/0.0254,
    	default  = "pitch",
    	link     = "Dots per inch",
    },
    -- the convention is that resolution appears as simply micrometers dimensionally
    -- see Digital Photogrammetry: A Practical Course by Wilfried Linder
    ["pitch"] = {
    	name1    = "µm",
    	name2    = "µm",
    	symbol   = "µm",
    	utype    = "length",
    	invert   = 1,
    	scale    = 0.000001,
    	default  = "dpi",
    	link     = "Dots_per_inch#Proposed_metrication",
    },
    ["dpcm"] = {
    	name1    = "dot/cm",
    	name2    = "dot/cm",
    	symbol   = "dot/cm",
    	utype    = "length",
    	invert   = -1,
		iscomplex= true,
    	scale    = 1/0.01,
    	default  = "dpi",
    	link     = "Dots_per_inch#Proposed_metrication",
    },
    ["isp"] = {
    	name1    = "second",
    	name2    = "seconds";
    	symbol   = "s",
    	utype    = "speed",
    	invert   = 1,
    	scale    = 9.8066,
    	default  = "km/s",
    	link     = "specific impulse",
    },
    -- from F=ma, Ns/kg is equivalent to units of speed
    -- which is fortunate because convert couldn't handle it otherwise
    ["Ns/kg"] = {
    	name1    = "N-s/kg",
    	name2    = "N-s/kg";
    	symbol   = "N-s/kg",
    	utype    = "speed",
    	invert   = 1,
    	scale    = 1,
    	default  = "isp",
    	link     = "specific impulse",
    },
    ["kNs/kg"] = {
    	name1    = "kN-s/kg",
    	name2    = "kN-s/kg";
    	symbol   = "kN-s/kg",
    	utype    = "speed",
    	invert   = 1,
    	scale    = 1000,
    	default  = "isp",
    	link     = "specific impulse",
    },
    -- units of inverse speed, because invert is negative
    ["si tsfc"] = {
    	name1    = "g/(kN·s)",
    	name2    = "g/(kN·s)",
    	symbol   = "g/(kN·s)",
    	utype    = "speed",
    	invert   = -1,
		iscomplex= true,
    	scale    = 1/101972/9.8066,
    	default  = "tsfc",
    	link     = "thrust specific fuel consumption",
    },
    -- units of inverse speed, because invert is negative
    ["tsfc"] = {
    	name1    = "lb/(lbf·h)",
    	name2    = "lb/(lbf·h)",
    	symbol   = "lb/(lbf·h)",
    	utype    = "speed",
    	invert   = -1,
		iscomplex= true,
    	scale    = 1/9.8066/3600,
    	default  = "si_tsfc",
    	link     = "thrust specific fuel consumption",
    },
	["LB"] = {
		-- Experiment: same as "lb" but with extra default precision.
		name1    = "pound",
		symbol   = "lb",
		utype    = "mass",
		scale    = 0.45359237,
		exception= "integer_more_precision",
		default  = "kg",
		subdivs  = { ["oz"] = { 16, default = "kg" } },
		link     = "Pound (mass)",
	},
	["LB stlb"] = {
		combination= { "LB", "stlb" },
		utype    = "mass",
	},
	["hp/t"] = {
		name1    = "horsepower per tonne",
		name2    = "horsepower per tonne",
		symbol   = "hp/t",
		utype    = "power per unit mass",
		scale    = 0.74569987158227022,
		default  = "kW/t",
		link     = "Power-to-weight ratio",
	},
	["hp/tonne"] = {
		target   = "hp/t",
		symbol   = "hp/tonne",
		default  = "kW/tonne",
	},
	["kW/tonne"] = {
		target   = "kW/t",
		symbol   = "kW/tonne",
	},
    ["km3/d"] = {
	name1    = "cubic kilometre per day",
	name1_us = "cubic kilometer per day",
	name2    = "cubic kilometres per day",
	name2_us = "cubic kilometers per day",
	symbol   = "km<sup>3</sup>/d",
	utype    = "flow",
	scale    = 11574.074074074075,
	default  = "cuft/d",
	link     = "Cubic metre per second",
    },
    ["Sv"] = {
    	name1    = "Sv",
    	name2    = "Sv",
    	symbol   = "Sv",
    	utype    = "equivalent radiation dose",
    	scale    = 1;
    	default  = "rem",
    	prefixes = 1,
    	link     = "Sievert",
    },
    ["rem"] = {
    	name1    = "rem",
    	name2    = "rem",
    	symbol   = "rem",
    	utype    = "equivalent radiation dose",
    	scale    = 0.01;
    	default  = "sv",
    	prefixes = 1,
    	link     = "Sievert",
    },
    ["Gray"] = {
    	name1    = "Gy",
    	name2    = "Gy",
    	symbol   = "Gray",
    	utype    = "absorbed radiation dose",
    	scale    = 1;
    	default  = "rad",
    	prefixes = 1,
    	link     = "Gray (unit)",
    },
    ["rad"] = {
    	name1    = "rad",
    	name2    = "rad",
    	symbol   = "rad",
    	utype    = "absorbed radiation dose",
    	scale    = 0.01;
    	default  = "Gray",
    	prefixes = 1,
    	link     = "Rad (unit)",
    },
}

return { extra_units = extra_units }