Skip to content

minisky.quantities

quantities

Physical quantity annotations and unit conversions used by MiniSky.

minisky uses SI units internally. To convert from imperial for example:

>>> from minisky import quantities as q
>>> q.ft_to_m(1300)
396.24

Furthermore, we recommend annotating your types with quantity kind and unit metadata, for example:

>>> from minisky import quantities as q
>>> def _(alt: q.PressureAltitudeM): ...
>>> from dataclasses import dataclass
>>> @dataclass
... class Container:
...     alt: q.PressureAltitudeM
...

Use unconstrained type variables where possible. Do not unnecessarily strictly type inputs like np.ndarray | float, they destroy type information.

For more information, see: https://github.com/open-aviation/minisky/issues/38#issuecomment-5156669559

AngleDeg module-attribute

AngleDeg = Annotated[_T, isqx.ANGLE(isqx.DEG)]

AngleRad module-attribute

AngleRad = Annotated[_T, isqx.ANGLE(isqx.RAD)]

MagneticDeclinationDeg module-attribute

MagneticDeclinationDeg = Annotated[_T, isqx.ANGLE['magnetic_declination'](isqx.DEG)]

Magnetic declination (also called magnetic variation) in degrees.

It is the angular difference between true north and magnetic north. For example, with 10 degrees west declination, magnetic north lies 10 degrees west of true north, i.e. magnetic heading = true heading - magnetic declination.

LatitudeDeg module-attribute

LatitudeDeg = Annotated[_T, isqx.LATITUDE(isqx.DEG)]

LongitudeDeg module-attribute

LongitudeDeg = Annotated[_T, isqx.LONGITUDE(isqx.DEG)]

BearingDeg module-attribute

BearingDeg = Annotated[_T, isqx.ANGLE['bearing', 'true'](isqx.DEG)]

TrueHeadingDegrees module-attribute

TrueHeadingDegrees = Annotated[_T, aerospace.HEADING_TRUE(isqx.DEG)]

MagneticHeadingDegrees module-attribute

MagneticHeadingDegrees = Annotated[_T, aerospace.HEADING_MAG(isqx.DEG)]

GroundTrackDeg module-attribute

GroundTrackDeg = Annotated[_T, aerospace.GROUND_TRACK(isqx.DEG)]

BankAngleDeg module-attribute

BankAngleDeg = Annotated[_T, aerospace.BANK_ANGLE(isqx.DEG)]

BankAngleRad module-attribute

BankAngleRad = Annotated[_T, aerospace.BANK_ANGLE(isqx.RAD)]

TurnRateDegPerS module-attribute

TurnRateDegPerS = Annotated[_T, aerospace.TURN_RATE(isqx.DEG * isqx.S ** -1)]

YawRateDegPerS module-attribute

YawRateDegPerS = Annotated[_T, aerospace.YAW_RATE(isqx.DEG * isqx.S ** -1)]

WindDirectionDeg module-attribute

WindDirectionDeg = Annotated[_T, aerospace.HEADING_TRUE_WIND(isqx.DEG)]

DistanceM module-attribute

DistanceM = Annotated[_T, isqx.DISTANCE(isqx.M)]

DistanceNM module-attribute

DistanceNM = Annotated[_T, isqx.DISTANCE(isqx.usc.NMI)]

VerticalDistanceM module-attribute

VerticalDistanceM = Annotated[_T, isqx.DISTANCE['vertical'](isqx.M)]

VerticalDistanceFt module-attribute

VerticalDistanceFt = Annotated[_T, isqx.DISTANCE['vertical'](isqx.usc.FT)]

TurnRadiusM module-attribute

TurnRadiusM = Annotated[_T, aerospace.TURN_RADIUS(isqx.M)]

LengthM module-attribute

LengthM = Annotated[_T, isqx.LENGTH(isqx.M)]

PressureAltitudeM module-attribute

PressureAltitudeM = Annotated[_T, aerospace.PRESSURE_ALTITUDE(isqx.M)]

PressureAltitudeFt module-attribute

PressureAltitudeFt = Annotated[_T, aerospace.PRESSURE_ALTITUDE(isqx.usc.FT)]

MslAltitudeM module-attribute

MslAltitudeM = Annotated[_T, isqx.ALTITUDE['above_mean_sea_level'](isqx.M)]

BarometricHeightM module-attribute

BarometricHeightM = Annotated[_T, isqx.HEIGHT['barometric'](isqx.M)]

AglHeightM module-attribute

SpeedMps module-attribute

SpeedMps = Annotated[_T, isqx.SPEED(isqx.M_PERS)]

AirspeedMps module-attribute

AirspeedMps = Annotated[_T, aerospace.AIRSPEED(isqx.M_PERS)]

CalibratedAirspeedMps module-attribute

CalibratedAirspeedMps = Annotated[_T, aerospace.CALIBRATED_AIRSPEED(isqx.M_PERS)]

CalibratedAirspeedKt module-attribute

CalibratedAirspeedKt = Annotated[_T, aerospace.CALIBRATED_AIRSPEED(isqx.usc.KNOT)]

EquivalentAirspeedMps module-attribute

EquivalentAirspeedMps = Annotated[_T, aerospace.EQUIVALENT_AIRSPEED(isqx.M_PERS)]

TrueAirspeedMps module-attribute

TrueAirspeedMps = Annotated[_T, aerospace.TRUE_AIRSPEED(isqx.M_PERS)]

TrueAirspeedKt module-attribute

TrueAirspeedKt = Annotated[_T, aerospace.TRUE_AIRSPEED(isqx.usc.KNOT)]

GroundSpeedMps module-attribute

GroundSpeedMps = Annotated[_T, aerospace.GROUND_SPEED(isqx.M_PERS)]

GroundSpeedKt module-attribute

GroundSpeedKt = Annotated[_T, aerospace.GROUND_SPEED(isqx.usc.KNOT)]

WindSpeedMps module-attribute

WindSpeedMps = Annotated[_T, aerospace.WIND_SPEED(isqx.M_PERS)]

WindSpeedKt module-attribute

WindSpeedKt = Annotated[_T, aerospace.WIND_SPEED(isqx.usc.KNOT)]

VerticalRateMps module-attribute

VerticalRateMps = Annotated[_T, aerospace.VERTICAL_RATE(isqx.M * isqx.S ** -1)]

VerticalRateFpm module-attribute

VerticalRateFpm = Annotated[_T, aerospace.VERTICAL_RATE(isqx.usc.FT * isqx.MIN ** -1)]

MachNumber module-attribute

MachNumber = Annotated[_T, isqx.MACH_NUMBER]

VelocityMps module-attribute

VelocityMps = Annotated[_T, isqx.VELOCITY(isqx.M_PERS)]

AccelerationMps2 module-attribute

AccelerationMps2 = Annotated[_T, isqx.ACCELERATION(isqx.M * isqx.S ** -2)]

GravitationalAccelerationMps2 module-attribute

GravitationalAccelerationMps2 = Annotated[_T, isqx.ACCELERATION_OF_FREE_FALL(isqx.M_PERS2)]

DurationS module-attribute

DurationS = Annotated[_T, isqx.DURATION(isqx.S)]

FrequencyHz module-attribute

FrequencyHz = Annotated[_T, isqx.FREQUENCY(isqx.HZ)]

SimulationTimeS module-attribute

SimulationTimeS = Annotated[_T, isqx.TIME['simulation'](isqx.S)]

WallClockTimeS module-attribute

WallClockTimeS = Annotated[_T, isqx.TIME['wall_clock'](isqx.S)]

SpecificGasConstantJPerKgK module-attribute

SpecificGasConstantJPerKgK = Annotated[_T, isqx.SPECIFIC_GAS_CONSTANT(isqx.J * isqx.KG ** -1 * isqx.K ** -1)]

TemperatureGradientKPerM module-attribute

TemperatureGradientKPerM = Annotated[_T, _TEMPERATURE_GRADIENT(isqx.K * isqx.M ** -1)]

PositionDiffusionMPerSqrtS module-attribute

PositionDiffusionMPerSqrtS = Annotated[_T, _POSITION_DIFFUSION(isqx.M * isqx.S ** Fraction(-1, 2))]

StaticTemperatureK module-attribute

StaticTemperatureK = Annotated[_T, aerospace.STATIC_TEMPERATURE(isqx.K)]

StaticPressurePa module-attribute

StaticPressurePa = Annotated[_T, isqx.STATIC_PRESSURE(isqx.PA)]

DensityKgPerM3 module-attribute

DensityKgPerM3 = Annotated[_T, isqx.DENSITY(isqx.KG * isqx.M ** -3)]

SpeedOfSoundMps module-attribute

SpeedOfSoundMps = Annotated[_T, isqx.SPEED_OF_SOUND(isqx.M_PERS)]

MassKg module-attribute

MassKg = Annotated[_T, isqx.MASS(isqx.KG)]

MtowKg module-attribute

OewKg module-attribute

ForceN module-attribute

ForceN = Annotated[_T, isqx.FORCE(isqx.N)]

PowerW module-attribute

PowerW = Annotated[_T, isqx.POWER(isqx.W)]

EnergyJ module-attribute

EnergyJ = Annotated[_T, isqx.ENERGY(isqx.J)]

EnergyWh module-attribute

EnergyWh = Annotated[_T, isqx.ENERGY(isqx.W * isqx.HOUR)]

MassFlowKgPerS module-attribute

MassFlowKgPerS = Annotated[_T, isqx.MASS_FLOW_RATE(isqx.KG * isqx.S ** -1)]

AreaM2 module-attribute

AreaM2 = Annotated[_T, isqx.AREA(isqx.M ** 2)]

DragCoefficient module-attribute

DragCoefficient = Annotated[_T, isqx.DRAG_COEFFICIENT]

ZeroLiftDragCoefficient module-attribute

ZeroLiftDragCoefficient = Annotated[_T, aerospace.ZERO_LIFT_DRAG_COEFFICIENT]

LiftInducedDragCoefficient module-attribute

LiftInducedDragCoefficient = Annotated[_T, aerospace.LIFT_INDUCED_DRAG_COEFFICIENT]

InducedDragFactor module-attribute

InducedDragFactor = Annotated[_T, isqx.Dimensionless('induced_drag_factor')]

OswaldEfficiency module-attribute

OswaldEfficiency = Annotated[_T, aerospace.OSWALD_EFFICIENCY]

BypassRatio module-attribute

BypassRatio = Annotated[_T, aerospace.BYPASS_RATIO]

deg_to_arcmin module-attribute

deg_to_arcmin = isqx.convert(isqx.DEG, _ARCMINUTE)

arcmin_to_arcsec module-attribute

arcmin_to_arcsec = isqx.convert(_ARCMINUTE, _ARCSECOND)

ft_to_m module-attribute

ft_to_m = isqx.convert(isqx.usc.FT, isqx.M)

km_to_m module-attribute

km_to_m = isqx.convert(isqx.KILO * isqx.M, isqx.M)

khz_to_hz module-attribute

khz_to_hz = isqx.convert(isqx.KILO * isqx.HZ, isqx.HZ)

mhz_to_hz module-attribute

mhz_to_hz = isqx.convert(isqx.MEGA * isqx.HZ, isqx.HZ)

hz_to_khz module-attribute

hz_to_khz = isqx.convert(isqx.HZ, isqx.KILO * isqx.HZ)

hz_to_mhz module-attribute

hz_to_mhz = isqx.convert(isqx.HZ, isqx.MEGA * isqx.HZ)

m_to_ft module-attribute

m_to_ft = isqx.convert(isqx.M, isqx.usc.FT)

nmi_to_m module-attribute

nmi_to_m = isqx.convert(isqx.usc.NMI, isqx.M)

m_to_nmi module-attribute

m_to_nmi = isqx.convert(isqx.M, isqx.usc.NMI)

kt_to_mps module-attribute

kt_to_mps = isqx.convert(isqx.usc.KNOT, isqx.M_PERS)

kmh_to_mps module-attribute

kmh_to_mps = isqx.convert(isqx.KILO * isqx.M / isqx.HOUR, isqx.M_PERS)

mps_to_kt module-attribute

mps_to_kt = isqx.convert(isqx.M_PERS, isqx.usc.KNOT)

fpm_to_mps module-attribute

fpm_to_mps = isqx.convert(isqx.usc.FT * isqx.MIN ** -1, isqx.M * isqx.S ** -1)

fpm_per_s_to_mps2 module-attribute

fpm_per_s_to_mps2 = isqx.convert(isqx.usc.FT * isqx.MIN ** -1 * isqx.S ** -1, isqx.M * isqx.S ** -2)

mps_to_fpm module-attribute

mps_to_fpm = isqx.convert(isqx.M * isqx.S ** -1, isqx.usc.FT * isqx.MIN ** -1)

kw_to_w module-attribute

kw_to_w = isqx.convert(isqx.KILO * isqx.W, isqx.W)

wh_to_j module-attribute

wh_to_j = isqx.convert(isqx.W * isqx.HOUR, isqx.J)

j_to_wh module-attribute

j_to_wh = isqx.convert(isqx.J, isqx.W * isqx.HOUR)

min_to_s module-attribute

min_to_s = isqx.convert(isqx.MIN, isqx.S)

s_to_min module-attribute

s_to_min = isqx.convert(isqx.S, isqx.MIN)

hour_to_s module-attribute

hour_to_s = isqx.convert(isqx.HOUR, isqx.S)

n_to_kn module-attribute

n_to_kn = isqx.convert(isqx.N, isqx.KILO * isqx.N)

n_to_lbf module-attribute

n_to_lbf = isqx.convert(isqx.N, isqx.usc.LBF)

lbf_to_n module-attribute

lbf_to_n = isqx.convert(isqx.usc.LBF, isqx.N)